Skip to content

upstream取り込み: v1 terminal dimensions sync fix (#3545, 手動移植)#316

Merged
MocA-Love merged 1 commit intomainfrom
upstream-merge/pr9-terminal-dim-sync
Apr 18, 2026
Merged

upstream取り込み: v1 terminal dimensions sync fix (#3545, 手動移植)#316
MocA-Love merged 1 commit intomainfrom
upstream-merge/pr9-terminal-dim-sync

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

概要

upstream から v1 terminal の backend dimension 同期 fix を取り込む PR。behind 1 → 0(PR8 と合わせて)。

取り込み commit

SHA 内容 分類
867ef8746 fix(desktop): sync v1 terminal dimensions to backend on connect (superset-sh#3545) — 1 file, +13 要検討(手動移植)

fork 適応修正(手動移植の理由)

fork は useTerminalLifecycle.ts の cold-restore 処理周りで upstream と diverge しているため、straight cherry-pick は git apply fail。

移植内容:

  1. syncBackendDimensions helper を const { xterm, fitAddon, searchAddon } = cached; 直後に追加(upstream と同じ位置)
  2. 1st createOrAttach.onSuccesssetConnectionError(null) 直後に呼び出し(upstream と同じ)
  3. 2nd createOrAttach.onSuccesssetConnectionError(null) 直後に呼び出し(upstream は markTerminalSessionReady(paneId) 直後だが、fork はそれを cold-restore 対応で deferred しているため setConnectionError 直後へ移動)

Codex pre-review

Yes(全5項目):

  • closure scope OK
  • 2nd site placement 妥当(cold-restore でも動作整合、backend resize は存在しないセッションに対して "not found" で握り潰される実装)
  • clientWidth/Height === 0 ガード妥当
  • fitAddon.fit() 重複は意図的 2-phase(attach 時 + settled layout 後)、副作用許容範囲

検証

  • typecheck: 全 26 タスク pass
  • lint: 3件 baseline、regression なし

テストチェックリスト

  • preset tab / 新規 workspace 作成で v1 terminal 起動 → shell prompt が正しい幅で折り返されるか(従来は stale defaults で折り返し誤り)
  • cold-restore 復帰で regression なし

Manually port upstream 867ef87 (superset-sh#3545) to fork's useTerminalLifecycle.
Straight cherry-pick failed because fork has diverged around cold-restore
handling — notably the 2nd createOrAttach success handler does NOT call
markTerminalSessionReady / startStream here (deferred until the real
shell spawns), so upstream's syncBackendDimensions() call point shifts
up by a few lines.

Adds the same syncBackendDimensions() helper and calls it at both
createOrAttach onSuccess sites so the backend PTY sees the settled
container dims before flex layout has a chance to resize (preset tabs,
new workspace bulk creation were spawning at stale defaults).
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

Warning

Rate limit exceeded

@MocA-Love has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 55 minutes and 18 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 55 minutes and 18 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c79a6707-56f7-4912-abba-198af627e78a

📥 Commits

Reviewing files that changed from the base of the PR and between 53a0018 and a142d28.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/hooks/useTerminalLifecycle.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch upstream-merge/pr9-terminal-dim-sync

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MocA-Love MocA-Love merged commit 57e66ab into main Apr 18, 2026
14 checks passed
MocA-Love added a commit that referenced this pull request Apr 18, 2026
…al dim sync)

- 1979f4c fix(desktop): v2 sidebar section count reflects visually grouped workspaces (superset-sh#3544) → PR #315 (clean cherry-pick)
- 867ef87 fix(desktop): sync v1 terminal dimensions to backend on connect (superset-sh#3545) → PR #316 (manual port for fork cold-restore divergence)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant