Repository navigation
feat(station-chrome): animate header insets on sidebar and chat toggles - #1883
Merged
Merged
Conversation
Header rows animated their pinned-chrome inset only while a station opened or closed, so collapsing the app sidebar or closing the chat pane slid the panes while the header content jumped by the whole reservation and then glided. usePaneLayoutInsetTransition replaces useStationToggleInsetTransition and also triggers on the sidebar collapse flag and on the chat pane opening or closing. Tab, session and route changes still snap, and so does dragging the chat divider.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Station and chat header rows reserve an inset under the window's pinned chrome. #1838 made that inset animate only while a station opens or closes (
useStationToggleInsetTransition), so tab changes stopped gliding the header controls. The sidebar collapse and the chat pane opening or closing also move a pane onPANE_WIDTH_TRANSITION_CLASSESand change the same reservation. For those toggles the inset still snapped: the header content jumped by the whole reservation on the first frame, then glided along with the pane, landing somewhere it never travelled to.Solution
usePaneLayoutInsetTransition(insrc/scaffold/AppLayout) replacesuseStationToggleInsetTransition. It watches a layout signature made of three flags: station open (effectiveChatPanelMaximizedAtom), sidebar collapsed (sidebarCollapsedAtom), and chat pane open (chatWidthAtom > 0).CHROME_INSET_TRANSITION_CLASSESfor 320 ms. The class is added in the same render as the new inset, and each change ends only its own timer.ChatPanelHeader, the My StationTabBar, andAgentStationTopHeader. TheCHROME_INSET_TRANSITION_CLASSESdoc comment is updated to match.Potential risks
Verification
pnpm exec vitest run --config config/vitest.config.ts src/scaffold/AppLayout src/engines/ChatPanel/__tests__ src/engines/ChatPanel/ChatPanelHeader src/modules/WorkStation/shared/TabBar src/scaffold/WorkbenchChrome src/components/layout: 168 passed.usePaneLayoutInsetTransition.test.tscovers: at rest; sidebar, chat pane and station toggles; tab re-renders; overlapping changes; divider drags.npx tsgo --noEmit: exit 0. No remaining references touseStationToggleInsetTransitionundersrc/ortests/.pnpm exec prettier --checkandpnpm exec eslint --max-warnings 0 --report-unused-disable-directiveson the changed files: clean.Pre-commit hook ran.trailer because it was made in a linked worktree, where.gitis a file and the stats step cannot write its output.