Skip to content

fix(tui): avoid stacking editor layers on session start - #741

Open
outlier27-cell wants to merge 2 commits into
openpi-dev:mainfrom
outlier27-cell:fix/issue-740-editor-layer-reinstall
Open

outlier27-cell wants to merge 2 commits into
openpi-dev:mainfrom
outlier27-cell:fix/issue-740-editor-layer-reinstall

Conversation

@outlier27-cell

Copy link
Copy Markdown
Contributor

Problem

Repeated Pi session_start events on one TUI context rebuilt OpenPI's editor factory from the already-wrapped factory. Each /new, /resume, or /reload could therefore stack every registered editor layer again.

Closes #740

Value

The active editor keeps one composition of each OpenPI layer across session starts, preventing duplicated editor behavior and nested rendering overhead.

Approach

  • Capture the base editor factory when the coordinator first receives an active TUI context.
  • Compose registered layers from that preserved base until the context is released.
  • Add a regression that registers the same layer twice on one context and checks the wrapper depth remains one.

Validation

  • node --test --experimental-strip-types tests/extensions/shared/editor-layers.test.ts (2 passing)
  • bun run check
  • bun run test reproduced existing failures in unmodified clear-context, renderer-chain, and Git fixture suites; the new editor-layer regression passed before the run was stopped. Exact-head GitHub CI is tracked for the final cross-platform result.

Impact

No new UI surface or configuration. Editor layers retain their existing registration order and lifecycle while repeated session starts remain idempotent.

@outlier27-cell

Copy link
Copy Markdown
Contributor Author

@tt-a1i 请审核此 PR。当前精确提交的 GitHub CI 已全部通过,修改范围与回归测试均已在 PR 说明中列明;现仅等待维护者审核。

This branch has not been deployed

No deployments
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.

bug(tui): repeated session starts stack shared editor layers

1 participant