Skip to content

Commit

Permalink
Merge pull request #1573 from TouK/dev
Browse files Browse the repository at this point in the history
dev -> master
  • Loading branch information
JulianWielga authored Dec 6, 2024
2 parents 35f6bbc + 0611a30 commit 255c46e
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
- uses: codecov/codecov-action@v3
- name: Store test results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
## [1.9.1-beta.4](https://github.com/touk/nk-windows/compare/v1.9.1-beta.3...v1.9.1-beta.4) (2024-12-05)


### Bug Fixes

* window position ([23a895b](https://github.com/touk/nk-windows/commit/23a895b07a5f37d897f5b796463b5bc2bd0afcf1))

## [1.9.1-beta.3](https://github.com/touk/nk-windows/compare/v1.9.1-beta.2...v1.9.1-beta.3) (2024-11-27)


### Bug Fixes

* Maximum update depth exceeded error ([e15935a](https://github.com/touk/nk-windows/commit/e15935acb84771237fee072b58109153741ae61c))

## [1.9.1-beta.2](https://github.com/touk/nk-windows/compare/v1.9.1-beta.1...v1.9.1-beta.2) (2024-11-27)


### Bug Fixes

* revert change animation library ([13736c3](https://github.com/touk/nk-windows/commit/13736c3594bbfc340d0687b66a2fe0e58dbf4dc1))

## [1.9.1-beta.1](https://github.com/touk/nk-windows/compare/v1.9.0...v1.9.1-beta.1) (2024-11-25)


### Bug Fixes

* issue with manually change window size ([9af367b](https://github.com/touk/nk-windows/commit/9af367b8a92fdfb47b7b267f26f57fb724e21f36))

# [1.9.0](https://github.com/touk/nk-windows/compare/v1.8.0...v1.9.0) (2024-09-16)


Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@touk/window-manager",
"version": "1.9.0",
"version": "1.9.1-beta.4",
"types": "./cjs/index.d.ts",
"main": "./cjs/index.js",
"module": "./esm/index.js",
Expand Down Expand Up @@ -127,7 +127,7 @@
"react-focus-lock": "2.12.1",
"react-hotkeys-hook": "4.5.0",
"react-inspector": "6.0.2",
"react-rnd": "10.4.10",
"react-rnd": "10.4.13",
"react-transition-group": "4.4.5",
"reselect": "5.1.0",
"rooks": "7.14.1"
Expand Down
9 changes: 6 additions & 3 deletions src/components/window/WindowFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, { forwardRef, PropsWithChildren, RefObject, useCallback, useEffect
import FocusLock from "react-focus-lock";
import { Position, Rnd } from "react-rnd";
import { CSSTransition } from "react-transition-group";
import { useMutationObserver, usePreviousDifferent, usePreviousImmediate } from "rooks";
import { useDebounce, useMutationObserver, usePreviousDifferent, usePreviousImmediate } from "rooks";
import { DRAG_HANDLE_CLASS_NAME, DRAG_PREVENT_CLASS_NAME } from "../../consts";
import { useViewportSize } from "../../hooks";
import { useScrollFix } from "../../hooks/useScrollFix";
Expand Down Expand Up @@ -169,12 +169,15 @@ export const WindowFrame = forwardRef((props: PropsWithChildren<WindowFrameProps
[size, windowMargin],
);

// it fixes an issue with Maximum update depth exceeded error
const debounceSetPosition = useDebounce(setPosition, 0, { leading: true });

useLayoutEffect(() => {
if (contentAvailable && position && !(maximized || wasMaximized)) {
const newValue = calcEdgePosition(viewport);
setPosition((current) => (isEqual(newValue, current) ? current : newValue));
debounceSetPosition((current) => (isEqual(newValue, current) ? current : newValue));
}
}, [contentAvailable, wasMaximized, calcEdgePosition, maximized, position, viewport]);
}, [contentAvailable, wasMaximized, calcEdgePosition, maximized, position, viewport, debounceSetPosition]);

const savePosition = useCallback((position: Position) => !maximized && setPosition(roundCoords(position)), [maximized]);

Expand Down
2 changes: 1 addition & 1 deletion src/themeHooks.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { css, cx } from "@emotion/css";
import { useTheme } from "@emotion/react";
import React, { useMemo } from "react";
import { useMemo } from "react";
import { rgba } from "./rgba";

export function useFrameTheme() {
Expand Down

0 comments on commit 255c46e

Please sign in to comment.