Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe terminal cache refactoring centralizes resize behavior into a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR refactors v1 terminal cache fit/refresh logic into a single Confidence Score: 5/5Safe to merge — clean refactor with no logic regressions and improved correctness around viewport state and visibility guards. All findings are P2 or lower. The centralized fitAndRefresh() function is logically equivalent to the three inline blocks it replaces, with added improvements (viewport preservation, refresh-only-when-visible). No data loss, race conditions, or broken contracts identified. No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/v1-terminal-cache.ts | Centralizes fit/refresh logic into fitAndRefresh(), adds container tracking, and preserves viewport state around resize — clean refactor with no logic regressions found. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[attachToContainer] --> B[entry.container = container]
B --> C[appendChild wrapper]
C --> D[fitAndRefresh]
D --> E{hostIsVisible?}
E -- No --> F[return false]
E -- Yes --> G[save viewport state\nwasPinnedToBottom / savedViewportY]
G --> H[fitAddon.fit]
H --> I[update lastCols / lastRows]
I --> J{wasPinnedToBottom?}
J -- Yes --> K[scrollToBottom]
J -- No --> L[scrollToLine clamped to baseY]
K --> M[xterm.refresh 0..rows-1]
L --> M
M --> N[return cols/rows changed?]
N --> O{ResizeObserver callback}
O --> D
N --> P{updateAppearance}
P --> Q[update font options]
Q --> D
D2[detachFromContainer] --> R[disconnect ResizeObserver]
R --> S[entry.container = null]
S --> T[wrapper.remove]
Reviews (1): Last reviewed commit: "fix v1 terminal resize repaint" | Re-trigger Greptile
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
3 PR (#442, #443, #444) で取り込み済みの 9 commits を git 履歴上もマージ済みに記録する。 内容差分は無し (merge -s ours)。 取り込み内容: - 6b96acd Improve sidebar group management UX (superset-sh#3745) - a4079e7 Update dashboard sidebar workspace icons (superset-sh#3755) - d3753d0 [codex] Use dynamic footer copyright years (superset-sh#3754) - ce606be Handle browser passthrough during v2 resize (superset-sh#3744) - b1e1eb7 Refactor v2 workspace page (superset-sh#3747) - 8693869 [codex] move v2 toggle to experimental settings (superset-sh#3748) - ef3f381 Revert "fix(desktop): refit v2 terminal after font settle (superset-sh#3742)" (superset-sh#3750) - 手動移植 (vibrancy patch 維持) - 25b2d52 Show terminal sessions from all workspaces in dropdown (superset-sh#3751) - 62737db fix v1 terminal resize repaint (superset-sh#3756)
Summary
Fixes the v1 terminal resize/fit path so cached terminals repaint correctly after attach, resize, and font appearance changes.
Root cause
The v1 cached terminal fit logic was duplicated across attach, resize, and appearance updates. It fit only when the container was visible, but did not consistently preserve viewport state around
fit()and refresh the visible rows after fitting. That can leave stale or blank glyph rendering after resize/reattach flows.Changes
fitAndRefresh().Validation
bunx @biomejs/biome@2.4.2 check --write --unsafe apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/v1-terminal-cache.tsbun test apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/hooks/useTerminalLifecycle.test.tsbun run --cwd apps/desktop typecheckSummary by cubic
Fixes v1 terminal repaint so cached terminals render correctly after attach, resize, and font changes. Centralizes fit logic to preserve scroll state and only trigger backend resize when size actually changes.
fitAndRefresh()to fit, restore pinned-bottom or scrolled viewport, and refresh visible rows.ResizeObserverin the cache.lastCols/lastRowsand invoke resize callback only when cols/rows change.Written for commit d61cefe. Summary will update on new commits.
Summary by CodeRabbit