Skip to content

fix: preserve chat comment controls when transcript or composer changes - #148763

Merged
Patrick-Erichsen merged 2 commits into
mainfrom
codex/claw-827-comment-recovery
Sep 15, 2026
Merged

Patrick-Erichsen merged 2 commits into
mainfrom
codex/claw-827-comment-recovery

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Follow-up to #148649: saved comments could lose their edit/delete controls when history or the built-in transcript disappeared, and selections spanning formatted line breaks could revert to file cards after sending.

User Impact

Comments remain available through the existing composer hover preview, including with replacement composers and transcripts. Editing an offscreen comment stays open. Formatted selections retain their sent preview after reload. Plugins delegating to the built-in composer, or falling back after an error, show one set of comment controls.

Why This Change Was Made

Comment editing belongs to the chat session, so its owner survives transcript replacement while source markers remain attached to the transcript. Replacement composers display the existing comment chip; the plugin view owns its visibility so built-in delegation and failure fallback do not duplicate it. The attachment records rendered text length separately from DOM source offsets; previously sent files retain their validated legacy parsing path.

Evidence

The regression tests reproduced inaccessible retained comments, replacement-transcript actions without a handler, offscreen edits dismissing themselves, and the formatted-text parsing failure before their fixes. Browser coverage exercises edit/delete/send after clearing history with either composer, transcript replacement, offscreen editing, and formatted send/hover/reload.

Retained comments after clearing history Before After
Replacement composer Missing retained comment controls Retained comment chip

Matching 600 × 300 crops aligned to the composer, from the real Control UI with deterministic Gateway and plugin fixtures. The original feature PR retains the inspected before/after desktop/mobile comparisons and recordings of the UI flow and real Gateway delivery.

Inspected recording of formatted selection/send/hover followed by clearing history and editing/deleting the retained comment (deterministic Gateway fixture):

claw-827-proof.mp4

Validation: 14 integrated browser tests and 61 focused unit tests passed; UI source types, changed-file checks, and the production UI build passed. Independent review through P2 found no actionable defects. The task Gateway preview also verified persisted comment hover through an authenticated Tailnet browser.

The delegated and failing composer regressions each reproduced two chips before the fix. Both now verify one chip, edit/delete, preserved draft, and the sent attachment. Matching 1000×300 composer crops:

Composer Before After
Delegates to built-in Duplicate delegated comment controls Single delegated comment controls
Failure fallback Duplicate fallback comment controls Single fallback comment controls

CI note: the first run on 71c5ac1e8ab7 passed every browser job but hit the existing cron stop/restart assertion in checks-node-compact-large-3. Core source, shared helpers, scripts, workflows, and dependency inputs are unchanged from the previous head, where that job passed. All four tests in the failing file also pass locally on the current head. The single failed-job rerun and required CI gate passed on the unchanged commit; the original failure remains linked here.

Playback verification: the latest automated review found no code defects but could not play the recording on its host. Direct playback in the GitHub PR was verified in a fresh Chromium session: the 20.76-second, 1440×900 video advanced normally with no media error. The rendered player and all six loaded comparison images were inspected.

@Patrick-Erichsen Patrick-Erichsen self-assigned this Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@Patrick-Erichsen
Patrick-Erichsen marked this pull request as ready for review September 15, 2026 04:13
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Sep 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 15, 2026, 12:54 AM ET / 04:54 UTC (Revision 3).

ClawSweeper review

What this changes

Preserves saved chat comment controls across transcript and composer changes, prevents duplicate controls during plugin fallback, and retains formatted selections in sent previews.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful fix for behavior still present on inspected main. The prior duplicate-controls finding is addressed, and no new blocking correctness or security defect was found.

Priority: P2
Reviewed head: 71c5ac1e8ab756f3a90102721852b970299ecd49

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A coherent owner-level repair with useful before/after visual evidence, meaningful regression coverage, and the previous finding resolved.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots directly show retained comment controls and fallback de-duplication in the real Control UI using deterministic Gateway/plugin fixtures. Source-reviewed browser coverage exercises editing, sending, and reload; recording playback was unavailable on this reviewer host.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after screenshots directly show retained comment controls and fallback de-duplication in the real Control UI using deterministic Gateway/plugin fixtures. Source-reviewed browser coverage exercises editing, sending, and reload; recording playback was unavailable on this reviewer host.
Evidence reviewed 9 items Introduced scope and prior finding: The pinned merge-base-to-head change is confined to the supplied UI paths. The current plugin renderer suppresses companion controls while a built-in composer is mounted and uses the built-in template alone after failure, addressing the earlier duplicate-controls finding.
Current main still needs the repair: Current main still places comment mutation listeners and editor ownership inside the transcript-local pins element; disconnecting that element removes the handlers. Its relevant pins, parser, and plugin-renderer files are unchanged from the pinned merge base.
One comment mutation owner: The chat card mounts the controller outside the replaceable transcript. It reads current attachments, checks presentation and read-signal lifetime, retires editors on teardown, and releases displaced attachment payloads.
Findings None None.
Security None None.

How this fits together

The Control UI stages selected transcript passages as editable comment attachments alongside the draft. Composer controls edit those attachments before sending, while transcript markers locate their original passages and sent previews recover their text.

flowchart TD
  A[Selected transcript passage] --> B[Draft comment attachment]
  B --> C[Session comment controller]
  C --> D[Edit or delete comment]
  B --> E[Built-in or plugin composer]
  E --> F[Send attachment]
  F --> G[Sent comment preview]
  C --> H[Available transcript marker]
Loading

Before merge

  • Resolve merge risk (P1) - Reviewer tooling could not inspect the linked recording, limiting independent corroboration of its interaction sequence; the before/after screenshot evidence was inspected.
Agent review details

Security

None.

PR surface

Source +141, Tests +539. Total +680 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 9 315 174 +141
Tests 5 601 62 +539
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 916 236 +680

Review metrics

Metric Value Why it matters
Production versus regression coverage Production net +141 lines; tests net +539 lines Production growth supports persistent editor ownership and replacement-composer handling, with regression coverage for their observable lifecycle.
Attachment compatibility 1 optional metadata field added; legacy decoding retained Rendered selection length can now differ from DOM offsets without rewriting previously sent attachments.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep comment mutations owned by the chat session, source markers owned by the transcript, and old attachment formats readable through the existing parser.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep comment mutations owned by the chat session, source markers owned by the transcript, and old attachment formats readable through the existing parser.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: replacing the built-in transcript removes main's comment-action owner, and formatted selection length can differ from its recorded DOM span. The contributor supplies targeted regression evidence; this review did not run the application.

Is this the best way to solve the issue?

Yes. Moving the existing mutation responsibility outside the replaceable transcript and extending the existing attachment parser resolves the defects without competing state or a new public plugin API.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3dbc8e2ffe76.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after screenshots directly show retained comment controls and fallback de-duplication in the real Control UI using deterministic Gateway/plugin fixtures. Source-reviewed browser coverage exercises editing, sending, and reload; recording playback was unavailable on this reviewer host.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: Repairs a bounded Control UI comment-editing and preview workflow without evidence of a broader runtime outage.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after screenshots directly show retained comment controls and fallback de-duplication in the real Control UI using deterministic Gateway/plugin fixtures. Source-reviewed browser coverage exercises editing, sending, and reload; recording playback was unavailable on this reviewer host.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after screenshots directly show retained comment controls and fallback de-duplication in the real Control UI using deterministic Gateway/plugin fixtures. Source-reviewed browser coverage exercises editing, sending, and reload; recording playback was unavailable on this reviewer host.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after screenshots directly show retained comment controls and fallback de-duplication in the real Control UI using deterministic Gateway/plugin fixtures. Source-reviewed browser coverage exercises editing, sending, and reload; recording playback was unavailable on this reviewer host.

Evidence

What I checked:

  • Introduced scope and prior finding: The pinned merge-base-to-head change is confined to the supplied UI paths. The current plugin renderer suppresses companion controls while a built-in composer is mounted and uses the built-in template alone after failure, addressing the earlier duplicate-controls finding. (ui/src/plugins/control-ui-view.runtime.ts:145, 71c5ac1e8ab7)
  • Current main still needs the repair: Current main still places comment mutation listeners and editor ownership inside the transcript-local pins element; disconnecting that element removes the handlers. Its relevant pins, parser, and plugin-renderer files are unchanged from the pinned merge base. (ui/src/pages/chat/components/chat-comment-pins.ts:98, 3dbc8e2ffe76)
  • One comment mutation owner: The chat card mounts the controller outside the replaceable transcript. It reads current attachments, checks presentation and read-signal lifetime, retires editors on teardown, and releases displaced attachment payloads. (ui/src/pages/chat/components/chat-comment-controller.ts:59, 71c5ac1e8ab7)
  • Attachment compatibility: New attachments record rendered UTF-16 text length independently of DOM offsets. The parser retains the prior validated length derivation when that field is absent; focused cases cover legacy files, formatted text, literal headings, Unicode, and malformed metadata. (ui/src/pages/chat/components/chat-comment-preview.ts:24, 71c5ac1e8ab7)
  • Existing plugin contract preserved: The companion template is an internal UI renderer argument. The public mountDefault signature remains unchanged, and existing callers default to no companion; this does not introduce a parallel plugin API. (src/plugin-sdk/control-ui.ts:119, 71c5ac1e8ab7)
  • Inspected visual proof: Downloaded before/after images show the missing retained-comment chip becoming visible after history clearing. Additional GitHub-hosted screenshots were read directly; the failure-fallback pair shows duplicate controls becoming one set while preserving the draft. These depict the real Control UI with deterministic Gateway/plugin fixtures. The linked recording could not be inspected: preparation reported ffprobe ENOENT and browser retrieval returned a cache miss. (71c5ac1e8ab7)

Likely related people:

  • Patrick Erichsen: Raw commit 740b1f1 adds ui/src/pages/chat/components/chat-comment-pins.ts:21 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 740b1f14fdba; files: ui/src/pages/chat/components/chat-comment-pins.ts)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-15T04:19:39.256Z sha bf22699 :: blocked before merge. :: [P2] [P2] Render comment controls only once for delegated composers
  • reviewed 2026-09-15T04:32:44.729Z sha 71c5ac1 :: needs maintainer review before merge. :: none

@Patrick-Erichsen Patrick-Erichsen changed the title fix: saved chat comments lose editing controls after transcript changes fix: preserve chat comment controls when transcript or composer changes Sep 15, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 15, 2026
@Patrick-Erichsen
Patrick-Erichsen merged commit edc3594 into main Sep 15, 2026
257 of 261 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the codex/claw-827-comment-recovery branch September 15, 2026 05:08
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant