Skip to content

Fix reading position and composer caret on channel return - #411

Merged
wesbillman merged 1 commit into
mainfrom
carl/channel-switching
Sep 29, 2026
Merged

wesbillman merged 1 commit into
mainfrom
carl/channel-switching

Conversation

@wesbillman

Copy link
Copy Markdown
Collaborator

Opened by Brain on Wes's behalf; implementation and commit by Carl.

Summary

  • Retire a conversation's old send/reveal instruction on departure so it cannot override the saved reading position on return. Preserve fresh-send and New-message → existing-DM handoff.
  • Focus the composer before selecting the draft end, then retain the successful focus handoff across development StrictMode replay. Explicit dialog focus and deliberate selections on updates still win.
  • Production diff: two files, +12/−1. No cache, virtualizer, editor-adapter, timer, or persistence changes.

Draft gate

An existing WebKit no-send cold-reload check failed on this tree: tests/browser/scroll.spec.mjs:155, same message ID but 650px Y displacement (contract: <4px). It passed in the one unchanged-production baseline comparison, so this is not established as unrelated or pre-existing. No retry-to-green, relaxed assertion, or out-of-scope reflow repair. Resolve this evidence gap before ready/merge; CI and required human/code-owner approval also remain gates.

Review and validation

Checked base 14a2e7ed585b130315629ded39d1b83b05eb2a53; head ddd51669d11b65412a9025f75a60cb69e68da9b7.

  • Brain independently reviewed the production/test diff against ownership, reading-position and focus contracts; no source-level blocker found. This does not waive the failing browser contract above.
  • Wes confirmed correct cursor behavior in the trial worktree. Browser checks use ephemeral identities and modeled relay I/O, not live sends or packaged-native acceptance.
  • Mandatory pre-commit passed. Mandatory pre-push at the committed head passed TypeScript, 405 tests / 29 files, design types and guards. Managed hooks preserved; no bypass.
  • Complete composer/scroll browser files: 11/12 passed across Chromium/WebKit; failure above. The unanchored selection also ran 14 image-scroll cases, all passing.
  • Complete strengthened new-message file: 4/4 passed, including a genuinely scrolled existing DM → New message → confirmed-send reveal.
  • Both new regressions fail before / pass after in both engines: successful send → read older messages → leave/return preserves message/Y; returning after a successful two-agent send appends immediate keyboard input after retained mentions and preserves exact signed recipient tags.
  • Behavior checks ran before commit on the reviewed diff; all seven committed file hashes match that snapshot (new-message ran before formatting-only changes). No postcommit browser rerun is claimed. Broad validation is left to existing CI.

Coverage and reproduction

Two browser cases added, none removed. Existing DM case strengthened; component coverage adds StrictMode end selection and deliberate-selection preservation, and enables StrictMode in the explicit focus-handoff guard. Browser-only justification: native DOM selection/keyboard insertion and real wheel/Virtua geometry cannot be proved by jsdom. Existing developmentReact fixture option is reused, with one opt-in agent-peer roster/profile fixture input.

# Exact affected browser files, both configured engines, without measurement dependencies:
bin/pnpm exec playwright test --config tests/browser/playwright.config.mjs \
  '(^|/)(composer-focus|scroll|new-message)\.spec\.mjs$' --no-deps --workers=1

Local macOS arm64, Chromium 153.0.8010.12 / WebKit 26.6; new scroll cases 4.8s/4.9s, caret cases 2.0s/2.4s. No CI performance claim.

Originating conversation: buzz://message?channel=2174385b-ca3b-4b31-8ad6-846f10fae18f&id=81c4995799ba210c745a999187c547e4fc87a1cbe544b10ef0f6df5206f5de03

Signed-off-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz>
@wesbillman
wesbillman marked this pull request as ready for review September 29, 2026 16:07
@wesbillman
wesbillman requested review from a team and comp615 as code owners September 29, 2026 16:07

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 No new actionable defects found, but I am not recommending approval yet. The reported WebKit cold-reload result displaced the saved reading anchor by 650px against the <4px contract (tests/browser/scroll.spec.mjs:155). A subsequent exact-head Chromium/WebKit run passed 16/16 tests, but does not explain that failure. Please isolate the cause or explicitly accept the residual risk before merging; a causal production regression has not been established.

@wesbillman
wesbillman merged commit 1f9092a into main Sep 29, 2026
35 of 37 checks passed
@wesbillman
wesbillman deleted the carl/channel-switching branch September 29, 2026 16:28
johnmatthewtennant pushed a commit that referenced this pull request Sep 29, 2026
…t-update-drafts

* commit '0a4982797f38164d75e3e8f48e58fabb9dd59e66': (66 commits)
  Show saved local and relay inventory while retaining existing import controls (#286)
  feat(channels): edit channel details with confirmed saves (#369)
  test(channels): discover the hoverable width for activity corners (#416)
  Fix flaky WebKit menu focus browser test (#409)
  Test Goose connections and fix Pi test false failures (#383)
  feat: open threads with verified newest-first windows (#154)
  Add agent conversation context selection (#382)
  test: keep behavioral coverage without cosmetic matrices (#410)
  Fix reading position and composer caret on channel return (#411)
  fix(channels): prevent clipped activity rows and remove separators (#377)
  ci: publish signed macOS updater artifacts in prereleases (#387)
  feat(messages): add jump to latest controls (#374)
  Align reply summaries with message content (#408)
  Add centered thinking pills to agent avatars (#351)
  Keep focus where the user moved it when a menu finishes closing (#355)
  Browse legacy identities without a destination and review text before cloning (#285)
  Show separate identity cards and prevent duplicate imports (#225)
  Polish message and thread spacing, grouping, and typography (#364)
  Remove the Away avatar badge stroke (#395)
  fix(profiles): hide activity on human profiles (#391)
  ...

Signed-off-by: Sol <49aa1f65411fd096d2e2ec144f1e7aa36fdc76d1b907cfdf7be000c66f9d3b8e@buzz.block.builderlab.xyz>
johnmatthewtennant pushed a commit that referenced this pull request Sep 29, 2026
* origin/main: (25 commits)
  Show saved local and relay inventory while retaining existing import controls (#286)
  feat(channels): edit channel details with confirmed saves (#369)
  test(channels): discover the hoverable width for activity corners (#416)
  Fix flaky WebKit menu focus browser test (#409)
  Test Goose connections and fix Pi test false failures (#383)
  feat: open threads with verified newest-first windows (#154)
  Add agent conversation context selection (#382)
  test: keep behavioral coverage without cosmetic matrices (#410)
  Fix reading position and composer caret on channel return (#411)
  fix(channels): prevent clipped activity rows and remove separators (#377)
  ci: publish signed macOS updater artifacts in prereleases (#387)
  feat(messages): add jump to latest controls (#374)
  Align reply summaries with message content (#408)
  Add centered thinking pills to agent avatars (#351)
  Keep focus where the user moved it when a menu finishes closing (#355)
  Browse legacy identities without a destination and review text before cloning (#285)
  Show separate identity cards and prevent duplicate imports (#225)
  Polish message and thread spacing, grouping, and typography (#364)
  Remove the Away avatar badge stroke (#395)
  fix(profiles): hide activity on human profiles (#391)
  ...

Signed-off-by: Sol <49aa1f65411fd096d2e2ec144f1e7aa36fdc76d1b907cfdf7be000c66f9d3b8e@buzz.block.builderlab.xyz>

# Conflicts:
#	src/bundled/agents/AgentsPage.test.tsx
#	src/bundled/agents/AgentsPage.tsx
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