feat(flow-chat): add quote-select — copy or quote selected message text into composer - #2321
Open
buddha68 wants to merge 1 commit into
Open
feat(flow-chat): add quote-select — copy or quote selected message text into composer#2321buddha68 wants to merge 1 commit into
buddha68 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a "select-to-quote" workflow to the chat composer, mirroring the interaction
popularized by qoderwork and dsh's
@deepseek-ai/dsh-quote-select:Copy text and Add to conversation.
【引用自对话第 N 条消息(你的原话/AI 的回答)】「原文」into the composer(quote first, existing draft below) and renders a removable quote chip above
the input.
sending clears both; clicking ✕ removes the marker from the draft.
Design
src/web-ui/src/flow_chat/components/QuoteSelect/:QuoteSelect.tsx— selection detection + floating menu (portal togetAppearanceOverlayHost()), copy & add handlers.quoteSelectPick.ts— pure selection extraction (separate file to satisfyreact-refresh/only-export-components).quoteSelectStore.ts— zustand store; composer read/write via the existingpublic event-bus contracts.
QuoteDock.tsx— removable quote chips rendered through the newcomposerDockextension point.QuoteSelect.scss,QuoteSelect.test.tsx(12 tests).ChatInput.tsx: new optional render-prop propcomposerDock?: (draft: string) => React.ReactNode,rendered above the composer inside
bitfun-chat-input__container.ChatPane.tsx: mounts<QuoteSelect />and passes<QuoteDock draft={...} />to
ChatInput.data-bf-component="user-message-item"(+data-turn-id) anddata-bf-component="model-round-item".globalEventBus.emit('fill-chat-input', { content, mode }).globalEventBus.emit('chat-input:get-state', { getValue }).@testing-library/react,@testing-library/dom(test-only).Verification
vitest run QuoteSelect→ 12/12 passed.eslinton changed files → 0 errors, 0 warnings.ChatInput*test suites → 83/83 passed (no regressions).vitedev-server compile check on all touched modules → 200 OK.Notes / follow-ups
could compute global ordinals via
absoluteSessionTurnIndexForIdand adddata-turn-idtoModelRoundItemfor consistency.