Skip to content

feat: add Copy, Edit and resend and Expand actions to user messages - #2097

Merged
Douglasymlai merged 2 commits into
mainfrom
feat/user-message-actions
Oct 23, 2026
Merged

Douglasymlai merged 2 commits into
mainfrom
feat/user-message-actions

Conversation

@Douglasymlai

@Douglasymlai Douglasymlai commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Split out of #1958 so it can be reviewed on its own. #1958 stays open as a Draft reference.

Stacked on #2095 (which stacks on #2096 and #2098); merge after those.

Problem

Once a message is sent, there is little you can do with it. The Copy button sits on top of the message text and only shows on mouse hover. There is no way to see when a message was sent. To change a request and try again, you have to retype or copy-paste it into the composer. Long messages fold after four lines, but the Expand and Collapse text buttons share the same overlay as Copy.

Cause

The user message bubble had a single hover overlay inside the bubble. It held Copy and the Expand/Collapse text buttons, had no keyboard or touch path, and the sent time was not shown. Nothing connected a sent message back to the composer.

Fix

  • Actions below the bubble. The send time, Copy and the other actions now sit in a row below the message, aligned right. They appear on hover or when a control in the message has keyboard focus, and stay visible on touch devices without hover. The time uses the same horizontal inset as the icon buttons next to it, and its tooltip shows the full date and time.
  • Edit and resend. Puts the message text back in the composer so you can change it and send it as a new message. The composer shows "Editing a copy of an earlier message" until you send or clear it. If the composer already holds an unsent draft, the draft is kept and a notice explains why. If the original message had files, a notice asks you to attach them again.
  • Expand / Collapse. Messages longer than four lines get an icon button that shows the full message and folds it back. Folded messages keep their height and fade. The button reports its expanded state to assistive technology. Edit and resend stays available on long messages, next to Expand.
  • Wide tables in replies. A Markdown table wider than the chat now scrolls inside its own region instead of stretching the reply. That region can be focused from the keyboard only when it actually overflows.
  • While an approval or question is open, Edit and resend waits instead of filling the answer field.
  • Works in the default chat view and in the event-native timeline (Narrative style).
  • Known limit: messages in the default chat view do not record a send time yet, so the time label shows only in the event-native timeline. Copy, Edit and resend and Expand work in both views.
  • New strings are translated into all 11 languages.

ProjectSection.tsx only gains the new prop (+3 lines) on top of #2095.

Testing

  • npx vitest run test/unit/components/ChatBox test/unit/components/ChatBox.test.tsx test/unit/components/ChatBox.spaceModelSelection.test.tsx: 649 tests passed; after restacking on feat: show approvals and questions above the message box #2095, the same suites plus the model-divider and approval suites: 690 passed. New tests cover:
    • action placement, hover/focus/no-hover visibility, the time element, Expand/Collapse and Edit (UserMessageCard.test.tsx)
    • table scroll regions and when they take focus (MarkDown.test.tsx)
    • Edit and resend in the composer: fills the draft and shows the editing note, keeps an existing draft, asks to reattach files (ChatBox.test.tsx)
    • Edit and resend while a question is open in the default chat view: the answer field and composer stay empty and a notice explains why (ChatBox.test.tsx)
    • Edit and resend and the send time in the event-native Narrative view (TimelineModes.test.tsx)
  • npm run type-check: passed
  • ESLint and Prettier on changed files: passed
  • npm run check:i18n: passed
  • npm run check:design-tokens: passed
  • git diff --check: clean
  • Manual and visual checks: not done. Still to check in the app:
    • hover, keyboard focus and touch visibility of the action row
    • light and dark themes
    • Expand/Collapse on a long message
    • Edit and resend with and without an existing draft, and with attachments
    • a wide table in a reply
    • the default chat view and the event-native view

@Douglasymlai
Douglasymlai force-pushed the feat/user-message-actions branch from f89bab5 to cb35a5f Compare October 22, 2026 22:52
@Douglasymlai
Douglasymlai changed the base branch from main to feat/approvals-above-composer October 22, 2026 22:52
@Douglasymlai
Douglasymlai marked this pull request as ready for review October 22, 2026 23:41
@Douglasymlai
Douglasymlai force-pushed the feat/approvals-above-composer branch from 0d56b5c to b5bfe10 Compare October 22, 2026 23:59
@Douglasymlai
Douglasymlai force-pushed the feat/user-message-actions branch from cb35a5f to 6e37c49 Compare October 22, 2026 23:59
@Douglasymlai
Douglasymlai force-pushed the feat/approvals-above-composer branch from 0511644 to 4b40279 Compare October 23, 2026 00:19
@Douglasymlai
Douglasymlai force-pushed the feat/user-message-actions branch from b3e4271 to fc77b20 Compare October 23, 2026 00:19
@Douglasymlai
Douglasymlai changed the base branch from feat/approvals-above-composer to main October 23, 2026 00:21
@Douglasymlai
Douglasymlai force-pushed the feat/user-message-actions branch from fc77b20 to 14a7fbd Compare October 23, 2026 00:22
@Douglasymlai
Douglasymlai force-pushed the feat/user-message-actions branch from 14a7fbd to f9821f8 Compare October 23, 2026 00:45
@Douglasymlai
Douglasymlai merged commit 30c9315 into main Oct 23, 2026
10 checks passed
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