Skip to content

fix(selection-polish): macOS 選區潤色預覽窗 rebase 後內容左收/半渲染修復(Seg-1) - #1073

Open
leonoxo wants to merge 2 commits into
Open-Less:betafrom
leonoxo:seg1/selection-preview-macos-beta
Open

fix(selection-polish): macOS 選區潤色預覽窗 rebase 後內容左收/半渲染修復(Seg-1)#1073
leonoxo wants to merge 2 commits into
Open-Less:betafrom
leonoxo:seg1/selection-preview-macos-beta

Conversation

@leonoxo

@leonoxo leonoxo commented Sep 13, 2026

Copy link
Copy Markdown

變更範圍(Seg-1,8 檔、0 UE 重疊)

rebase 至 upstream beta 新 base c4e8e887(UI 2.0 改版後),收口 macOS 選區潤色預覽窗:

  • 確認回寫可靠性(51e2ebba):confirm 按鈕穩定性 + scaffolding echo strip
  • <main> 全寬修補(c21d8205):flex:1 1 auto + width:100%,修復重 base 後預覽窗內容左收/半渲染。根因:#root 為 row flex,<main> 缺寬度行為 → 內容收縮至內容寬靠左;新 base 改版後此路徑被放大。修復嚴格封閉於 SelectionPolishPreview.tsx(+2 行)

檔案

crates/openless-core/src/prompts.rs                 |  16 +
crates/openless-core/src/selection_service.rs       |  84 ++++-
crates/openless-core/src/streaming_insert.rs        | 123 +++++++
crates/openless-core/tests/selection_contract.rs    | 103 +++++-
app/src-tauri/src/core_adapters.rs                  |  22 ++
app/src-tauri/src/lib.rs                            | 390 +++++++++++++++++++-
app/src-tauri/src/selection.rs                      |  44 ++-
app/src/pages/SelectionPolishPreview.tsx            |   7 +
8 files, +756/−33, 0 UE (UE 鏈 Seg-2 另開分支處理)

本地驗證(macOS aarch64,2026-09-13)

  • tsc --noEmit + release build EXIT=0
  • e2e 5/5 輪完整鏈(新建獨立文件 → 熱鍵圈選 → 預覽窗 → confirm 回寫):
    • textarea 滿寬 5/5(AX 量測 rel_x=18 / width=604px = 視窗 640−padding 36)
    • 半渲染 5/5 未再現
    • confirm 回寫 4/5 WRITE-VERIFIED(88→293/120/142/251 chars);1 輪文字不變經 log 判定為 LLM 回顯(stream chars=88=原文長),非 confirm 路徑問題,屬獨立線

附註

…g echo strip

Rebased onto origin/beta (c4e8e88); scoped to the confirmation/apply
path only, decoupled from the user-envelope prompt redesign (Open-Less#1045
segment 2).

- macOS preview window: non-activating NSPanel, first-click key guard
  (windowNumber + fixed title), resign key before reactivating the
  target app, pre-insert front-most revalidation.
- SelectionPolishPreview: reset busy/error on re-show (window reuse).
- selection_service: settle_confirm_failure keeps transient platform
  failures retryable (no cancel, preview stays).
- scaffolding: strip_echoed_scaffolding conservative echo removal +
  selection_user_prompt (selected_text envelope), contract tests.

Verified: openless-core 805 tests + integration suites green,
tsc --noEmit clean, cargo check clean.
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