Skip to content

feat: add message editing UI#99

Draft
jjjhenriksen wants to merge 1 commit into
openclaw:mainfrom
jjjhenriksen:codex/message-editing-ready
Draft

feat: add message editing UI#99
jjjhenriksen wants to merge 1 commit into
openclaw:mainfrom
jjjhenriksen:codex/message-editing-ready

Conversation

@jjjhenriksen

@jjjhenriksen jjjhenriksen commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add author-only message editing controls to channel messages and thread roots/replies
  • share one accessible editor with save, cancel, Escape, and Ctrl/Command+Enter behavior
  • update edited messages in the active channel and thread without a page reload
  • preserve moderator deletion without exposing edit controls for other authors
  • keep pending and failed thread replies out of the edit flow

Real behavior proof

tests/e2e/message-editing.spec.ts runs against ClickClack's locally built production web bundle served by the real Go API. In an isolated run it:

  1. creates a real ClickClack workspace and channel through the API;
  2. sends a channel message through the rendered ClickClack composer;
  3. edits it through the rendered message action and observes the (edited) state;
  4. reloads ClickClack and confirms the edited channel body persisted;
  5. creates and edits a reply through the rendered thread pane;
  6. reloads again and confirms the edited thread reply persisted;
  7. confirms only one editor mounts when the same thread root is visible in the timeline and thread pane;
  8. presses Escape in both surfaces and confirms focus returns to the initiating Edit action;
  9. types an unsaved draft, activates Edit on another message, and confirms the first draft remains mounted while the competing editor stays closed;
  10. confirms the client submits the exact draft and leaves boundary-whitespace normalization to the existing server contract;
  11. delays a save and confirms a competing editor cannot open while that write is in flight;
  12. fails the delayed save and confirms both its error and original draft remain visible for retry;
  13. confirms a normalized no-op closes without issuing a PATCH, while a normalized-empty keyboard shortcut keeps the editor open with validation feedback;
  14. covers the Unicode whitespace difference between JavaScript and Go, including U+0085 and U+FEFF;
  15. verifies the editor's border, surface, radius, and action contrast resolve through ClickClack's defined theme tokens; and
  16. waits for a thread reply to persist before editing it, while pending and failed replies keep their edit action disabled.
  17. closes a thread while its root editor owns the edit session, then opens the timeline editor and confirms the unmounted surface leaves no stale global lock.
  18. reopens that thread and confirms the discarded root draft does not remount edit mode.
  19. focuses the timeline Edit action without hover and confirms the action bar becomes visibly discoverable; coarse-pointer CSS keeps it visible on touch devices.
  20. switches to another channel while a timeline draft is active, then returns and confirms the parent edit session restores the unsaved draft after the row remounts.

The captured real-app state is committed at docs/proof/message-editing-real-app.png, with reproduction details in docs/proof/message-editing-proof.md.

Focused browser run:

pnpm exec playwright test tests/e2e/message-editing.spec.ts
3 passed (7.7s)

Validation

  • pnpm exec playwright test tests/e2e/message-editing.spec.ts — 3 passed on d95bb2e82feb9aaec1613df74fe9aaf7f1210800
  • pnpm check — passed on d95bb2e82feb9aaec1613df74fe9aaf7f1210800
  • Autoreview — all actionable findings from completed passes fixed; the final exact-head rerun was blocked by the reviewer account usage limit
  • local ClawSweeper — all actionable findings from completed passes fixed; the final exact-head attempt hit the same reviewer usage limit, so a GitHub re-review is requested below

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. 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. P2 Normal priority bug or improvement with limited blast radius. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 19, 2026, 12:01 AM ET / 04:01 UTC.

Summary
The PR adds author-only inline editing for channel messages and thread roots/replies, with shared editor state, browser coverage, proof documentation, and regenerated web assets.

Reproducibility: not applicable. as a defect reproduction: this PR proposes a new UI capability. Its body provides a concrete after-fix real-app Playwright path for validating the proposed behavior.

Review metrics: 1 noteworthy metric.

  • Patch surface: 22 files affected; 956 added, 105 removed. The feature spans shared message state, timeline and thread rendering, browser coverage, proof material, and regenerated web assets.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Obtain a maintainer decision on whether author-visible editing belongs in ClickClack’s permanent message interaction model.

Risk before merge

  • [P1] Merging would establish author-visible message editing as a permanent core interaction without recorded maintainer sponsorship; that product boundary should be explicit before landing.

Maintainer options:

  1. Decide the mitigation before merge
    If maintainers want editable authored messages, land this bounded UI over the existing update path with its author-only controls and retained end-to-end coverage; otherwise decline the new interaction rather than treating it as a bug fix.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] No mechanical repair is indicated; a maintainer must first sponsor or decline the new message-editing interaction.

Maintainer decision needed

  • Question: Should ClickClack adopt author-visible editing of already-sent channel and thread messages as a permanent core interaction?
  • Rationale: The patch is a new user-facing capability rather than repair of an established UI contract, and no supplied maintainer discussion confirms the desired long-term message-history policy.
  • Likely owner: unresolved — Current-main ownership could not be established from the supplied context, so a product owner familiar with ClickClack message semantics should decide.
  • Options:
    • Adopt bounded message editing (recommended): Accept author-only inline editing for persisted channel and thread messages and review this implementation on its normal merge merits.
    • Defer the interaction: Keep the existing immutable-message UI and close or pause this proposal until a broader message-history policy is sponsored.

Security
Cleared: The reviewed change is confined to message UI, browser tests, proof files, and regenerated web assets; the supplied diff shows no new dependency, workflow, permission, secret, or artifact-execution path.

Review details

Best possible solution:

If maintainers want editable authored messages, land this bounded UI over the existing update path with its author-only controls and retained end-to-end coverage; otherwise decline the new interaction rather than treating it as a bug fix.

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

Not applicable as a defect reproduction: this PR proposes a new UI capability. Its body provides a concrete after-fix real-app Playwright path for validating the proposed behavior.

Is this the best way to solve the issue?

Unclear pending product direction: the implementation appears to use the existing message-update path and is narrowly scoped, but whether editing sent messages should be exposed in the core UI is a maintainer policy choice.

AGENTS.md: found, but no applicable review policy affected this item.

Codex review notes: model internal, reasoning high; reviewed against 146f76255bcc.

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded user-facing feature proposal with good validation, but it needs ordinary product-direction review before merge.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR supplies a concrete after-fix run against the real Go API and locally built production web bundle, reports 3 passing focused Playwright tests, and includes a committed screenshot artifact showing the edited UI state.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies a concrete after-fix run against the real Go API and locally built production web bundle, reports 3 passing focused Playwright tests, and includes a committed screenshot artifact showing the edited UI state.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR supplies a concrete after-fix run against the real Go API and locally built production web bundle, reports 3 passing focused Playwright tests, and includes a committed screenshot artifact showing the edited UI state.
Evidence reviewed

What I checked:

  • Feature implementation: The branch introduces the parent edit-session state and editing flow for timeline and thread surfaces. (apps/web/src/ChatApp.svelte:2035, d95bb2e82feb)
  • Accessible editor behavior: The new editor implements focus, save/cancel, Escape, Ctrl/Command+Enter, validation, and server-compatible whitespace handling. (apps/web/src/components/messages/MessageEditor.svelte:1, d95bb2e82feb)
  • Real behavior coverage: The added Playwright suite exercises channel and thread edits through the rendered application and verifies persistence across reloads. (tests/e2e/message-editing.spec.ts:1, d95bb2e82feb)
  • Validation and proof context: The provided PR context reports a real Go API plus production-web-bundle run, 3 passing focused Playwright tests, passing checks across all listed CI platforms, and a committed screenshot proof artifact. (docs/proof/message-editing-proof.md:1, d95bb2e82feb)
  • Prior review continuity: The latest completed ClawSweeper review at the same head SHA found no remaining actionable patch finding and identified product acceptance as the outstanding decision. (d95bb2e82feb)

Likely related people:

  • unresolved: The supplied review context identifies the proposed branch author but does not provide current-main message UI provenance; no verified current-main history owner can be named without inventing attribution. (role: current-main feature-history owner; confidence: low; files: apps/web/src/ChatApp.svelte, apps/web/src/components/messages/MessageRow.svelte, apps/web/src/components/thread/ThreadPanel.svelte)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (3 earlier review cycles)
  • reviewed 2026-07-18T23:15:04.680Z sha 27e456a :: found issues before merge. :: [P2] Preserve the selected surface when rendering the editor
  • reviewed 2026-07-19T01:12:08.542Z sha d95bb2e :: needs maintainer review before merge. :: none
  • reviewed 2026-07-19T01:53:23.870Z sha d95bb2e :: needs maintainer review before merge. :: none

- Add inline edit mode in MessageRow.svelte with textarea
- Add edit button on own messages (pencil icon)
- Add Save/Cancel controls with keyboard shortcuts (Esc to cancel, Cmd+Enter to save)
- Wire to existing PATCH /api/messages/{id} endpoint
- Show (edited) indicator on edited messages
- Hide message actions while editing
- Add editing message state management in ChatApp.svelte
- Show edited indicator in thread panel as well
@jjjhenriksen
jjjhenriksen force-pushed the codex/message-editing-ready branch from 27e456a to d95bb2e Compare July 19, 2026 01:08
@jjjhenriksen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@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. 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. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: feat: add message editing UI This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

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

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant