Skip to content

fix(chat): focus input when clicking composer space - #417

Merged
oxwen11 merged 1 commit into
mainfrom
pie/3770c8de
Sep 30, 2026
Merged

oxwen11 merged 1 commit into
mainfrom
pie/3770c8de

Conversation

@oxwen11

@oxwen11 oxwen11 commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Focus ChatInput when clicking non-interactive space anywhere inside the composer focus-ring surface.
  • Preserve button/menu behavior and native editor cursor positioning.
  • Add browser regression coverage for stacked and inline composers.

Verification

  • 4 browser tests passed (composer focus and existing layout tests).
  • App typecheck, scoped oxlint, formatting, and diff checks passed.
  • React Doctor: no diagnostics; score API unavailable.
  • Isolated UI verification: clicked draft toolbar space and session inline padding; both focused the editor and displayed the ring. Before/after screenshots and recording attached.

Security

No trust-boundary, permission, persistence, or network changes.

Draft composer before blank-space click

Draft composer after blank-space click

Session composer before padding click

Session composer after padding click

recording-001.webm

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 2af4583.

@pkg-pr-new

pkg-pr-new Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
npx https://pkg.pr.new/oxwen11/pie/@getpie/cli@417

commit: 2af4583

@oxwen11

oxwen11 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

auto-merge: no

head 108a8d25ea0d16aad6396cce72178d4ca073f3d0 — required CI green (Check, react-doctor, both Publish @getpie/cli preview), MERGEABLE (BEHIND).

exclusion (not ui-presentation):

  • chat-composer-frame.tsx adds a new onClick handler on PromptInput that inspects event.target / closest(...) and calls controller?.focus() — new interaction flow + handler, not idle/hover/focus/active visibility via class/style tokens
  • .agents/rules/auto-merge/ui-presentation.md rejects handlers / interaction flows; exclusions also cover new functional product behavior and non-presentational fixes
  • new chat-composer-frame.test.tsx asserts the click→focus product control flow (surfaces focus; toolbar button must not), so the test is tied to the new behavior rather than presentation-only coverage

Din review-first: comment/decide only — not merging.

@oxwen11

oxwen11 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Review-and-merge gate record — not merged

  • Head: 9292b679a44de0389264ef94f029535944a13a09.
  • Current target main and trusted rules commit: d7f4b7a95588e5de2aeefbe790e65111e89195f6.
  • Policy: trusted PR workflow, with review, security and acceptance rules from that base (not PR-proposed or retired rules).
  • Context: fix(chat): focus input when clicking composer space. Same-repository, author oxwen11, open, non-draft.

Required CI observed for this head

Blocking gate and conclusion

  • Required CI has not all passed at this head (see failed or queued/in-progress results above).

Stopped before code review and independent verification; not merged. These are gate observations, not an implementation-quality verdict. No branch update, conflict resolution, CI rerun, protection bypass or fix-and-merge was performed.

Revisit only after a relevant change resolves the recorded blocker: an author-provided head containing current main with no conflict where necessary, and every required check present, executed and successful for the candidate version. The next eligible version starts again at CI; unchanged blockers need no duplicate review/comment.

@oxwen11

oxwen11 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

CI 失败定位与修复方向

  • Head:9292b679a44de0389264ef94f029535944a13a09
  • 当前 main / 可信规则 commit:8f7546548ca95b7167c2261ebe87f4425806cf65
  • 失败检查日志

CLI 构建成功,失败在 Publish preview to pkg.pr.new;日志出现 HTTP 500,随后 Headers Timeout Error。与 #415/#416 同类发布服务/网络故障,暂无证据要求改本 PR 的产品代码。先确认服务恢复,再进行有依据的一次失败 job 重试;若仍失败继续诊断而非反复刷绿。此候选还需包含当前 main,届时使用新 head 的完整 CI 与独立 UI 验收。

这是对既有阻塞新增的日志定位,不是代码审查通过。未本地重现或验证修复方案,未修改分支、重跑 CI 或合并。修复/环境恢复并得到满足当前 base 的全绿候选后,重新从 CI → 审查 → 独立验收开始。

@oxwen11

oxwen11 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

无新决策分支同步

旧 head 9292b679a44de0389264ef94f029535944a13a09 已通过 GitHub 原生 rebase 更新为 8eddde02798b273a79a34b88c0cc7710180343a7;compare 确认包含当前 main/可信规则 8f7546548ca95b7167c2261ebe87f4425806cf65,behind_by=0,无人工冲突取舍。

此前唯一失败来自 pkg.pr.new 发布服务;随后实际发布已恢复(#402 的发布步骤及 #416 的一次受控重试均成功)。本次同步是为消除 base lag,新版本触发完整 CI,不是反复重跑同一失败候选。待新 CI 全成功再审查与独立 UI 验收;尚未批准或合并。

@oxwen11

oxwen11 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

After independently accepted #415 merged, this PR was updated using GitHub-native rebase from 8eddde02798b273a79a34b88c0cc7710180343a7 to 2af458329d7e2e588484ab02a370540d02553dc6, now containing main 8c11d477ac4a8b5453c401d3983430b2028df204. New required CI is pending. Previous-head evidence is not reused as acceptance; review and independent Web/Desktop verification will follow only after every required check succeeds. No merge or deferred auto-merge has been armed.

@oxwen11

oxwen11 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

auto-merge: no

head 2af458329d7e2e588484ab02a370540d02553dc6 — required CI green (Check, react-doctor, both Publish @getpie/cli preview, Continuous Releases, React Doctor), MERGEABLE (CLEAN). Prior no was on 108a8d25ea0d16aad6396cce72178d4ca073f3d0; re-reviewed this updated head (adds browser tests; product hunk unchanged in kind).

exclusion (not ui-presentation):

  • chat-composer-frame.tsx adds a new onClick handler on PromptInput that inspects event.target / closest(...) and calls controller?.focus() — new interaction flow + handler, not idle/hover/focus/active visibility via class/style tokens
  • .agents/rules/auto-merge/ui-presentation.md rejects handlers, conditions/control flow, and interaction flows
  • new test file does not move the product hunk into an allowed group

Din review-first: no squash-merge.

@oxwen11

oxwen11 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Independent review and acceptance — passed

  • Reviewed/tested head: 2af458329d7e2e588484ab02a370540d02553dc6.
  • Base and trusted rules: 8c11d477ac4a8b5453c401d3983430b2028df204.
  • Full two-file diff, both production composer callers, controller focus behavior and shared form/button/input implementations reviewed. No blocking correctness, accessibility, compatibility or security finding. The form-local handler respects prevented events and interactive descendants; native editor caret placement and control behavior remain intact. No RPC, permission, persistence, model or network contract is changed.

Checks actually run

  • Frozen dependency installation in a clean reviewer-owned worktree pinned to the candidate.
  • pnpm exec vitest run --config apps/app/vitest.browser.config.ts apps/app/src/features/chat/components/chat-composer-frame.test.tsx apps/app/src/features/chat/components/input/composer-layout.test.tsx: 2 files / 4 tests passed. Covers stacked/inline padding, toolbar space, nested button content and direct editor clicks, plus existing layout behavior.
  • Turbo Server/Core build: 3 tasks succeeded. Server rebuilt from the pinned worktree; unchanged Core/native inputs restored through matching cache keys. Both running UI instances loaded candidate source; tracked files remained clean.
  • Required CI: Check, react-doctor, preview, preview: all SUCCESS before review and acceptance.

Independent live Web + Desktop proof

Separate isolated application/agent state, sample Projects and owned browser/Electron profiles were used. Each surface passed Doctor; Desktop used its pinned real Electron renderer and isolated token daemon (anonymous ticket denied; authenticated ticket successful).

Both surfaces:

  • Clicked blank toolbar space in the stacked draft composer: Message became the active contenteditable, the form matched :focus-within, and the ring appeared.
  • Opened the actual draft model picker: search kept focus instead of the form handler stealing it.
  • Filled text and clicked near its start: native caret stayed at offset 0, not the controller's end position.
  • Used the real submit control to create a Session and navigate to it.
  • Clicked confirmed noninteractive toolbar padding in the inline Session composer: Message focused and the form ring appeared.

Web additionally: the Session model picker retained search focus; a native click in the nonempty Session editor placed the caret near the start (offset 1 of 27), not the end.

A foreign Web verification run appeared during the final optional Desktop Session-menu recheck. The shim refused ambiguous surface selection before dispatch. Further driving stopped immediately and only this task's Desktop run was cleaned up; the foreign run was untouched. The required stacked/inline focus paths and Desktop draft control/caret checks above had already completed, with screenshots and video. No claim is made for that optional repeated Desktop Session-menu check.

Both owned surfaces were cleaned up; evidence remains attached. Before/after images show the candidate immediately before/after the click, not a simulated baseline. Images focus on the composer; recordings exclude the unrelated upper diagnostic region to keep local paths/identifiers out of public evidence.

Scope: isolated agent directories intentionally had no model credentials. Session creation was real, followed by the expected model-request error; no model/tool execution is claimed or needed for this focus-only change. No mocked RPC or hand-edited product state was used.

Final head/base, scope, unresolved-review, readiness and required-CI checks remain mandatory immediately before squash merge. A changed head/base invalidates this acceptance.

web-draft-before

web-draft-after

web-session-before

web-session-after

web-composer-drive.webm

desktop-draft-before

desktop-draft-after

desktop-session-before

desktop-session-after

desktop-composer-drive.webm

@oxwen11
oxwen11 merged commit a9709fc into main Sep 30, 2026
6 checks passed
@oxwen11
oxwen11 deleted the pie/3770c8de branch September 30, 2026 18:24
@oxwen11

oxwen11 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

GitHub confirmed squash merge of reviewed/verified head 2af458329d7e2e588484ab02a370540d02553dc6 as a9709fcc6d513f6786dd6c6ce44b13ba8a8e71c3. Exact head/base, scope, review threads, strict current-base protection and all required checks were revalidated immediately before merge. Independent acceptance with Web/Desktop screenshots and recordings: #417 (comment)

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.

2 participants