Skip to content

feat(flow-chat): preserve composer references in message history - #1747

Merged
wsp1911 merged 2 commits into
GCWing:mainfrom
wsp1911:dev2
Jul 24, 2026
Merged

feat(flow-chat): preserve composer references in message history#1747
wsp1911 merged 2 commits into
GCWing:mainfrom
wsp1911:dev2

Conversation

@wsp1911

@wsp1911 wsp1911 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Preserve rich composer references across sent-message rendering, rollback, failed-message refill, and historical message editing.

Type and Areas

Type:

Feature / UI/UX / regression fix / test

Areas:

Web UI, Rust core

Motivation / Impact

User messages now retain structured file, session, skill, and widget references as capsules instead of exposing internal prompt tags.

Session references are represented in model-visible text as [session-ref:N]. The backend reminder table maps each marker to a bounded session name and transcript artifact while treating both as untrusted historical content.

Historical messages with references can be edited through a rich-text editor. Existing capsules remain atomic, files and sessions can be added through @, and saving rebuilds the model prompt and reference metadata.

Legacy history without presentation metadata continues to render as plain text.

Verification

  • pnpm --dir src/web-ui run test:run src/flow_chat/components/modern/UserMessageEditComposer.test.tsx src/flow_chat/components/modern/UserMessageItem.test.tsx src/flow_chat/components/RichTextInput.test.tsx src/flow_chat/utils/composerPresentation.test.ts
    • Passed: 4 files, 26 tests.
  • pnpm run type-check:web
    • Passed.
  • pnpm run theme:color-audit:all
    • Passed.
  • cargo test -p bitfun-core --lib session_reference_display_name_normalizes_escapes_and_truncates -- --nocapture
    • Passed.
  • cargo check -p bitfun-core
    • Passed.
  • cargo check --workspace
    • Blocked by an existing unrelated CLI type-recursion overflow at src/apps/cli/src/account.rs:721 (tokio::spawn, E0275).

Reviewer Notes

  • No storage migration is required; old turns fall back to their existing plain-text display.
  • Session names are whitespace-normalized, truncated to 96 characters, Markdown-escaped, and marked untrusted in the backend reminder.
  • No manual interactive verification was run.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, including the unrelated workspace-check blocker.
  • User-facing strings, docs, and locales are updated where applicable.

wsp1911 added 2 commits July 24, 2026 22:22
- persist structured composer presentation metadata for sent messages
- render file, session, skill, and widget references as historical message capsules
- restore reference capsules on rollback and failed-message refill
- use ordered [session-ref:N] markers with bounded session names in backend reminders
- support atomic reference editing and rebuild reference metadata before rerun
- keep legacy messages compatible through plain-text fallback
- add focused frontend and Rust coverage
- define the missing JSDOM scrollIntoView API before each dialog test
- prevent unhandled errors when editing a saved SSH connection
@wsp1911
wsp1911 merged commit 91a8aec into GCWing:main Jul 24, 2026
5 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