feat: selectable prose in the thread, and the select-text page - #39
Open
divyanshub024 wants to merge 1 commit into
Open
feat: selectable prose in the thread, and the select-text page#39divyanshub024 wants to merge 1 commit into
divyanshub024 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
The selectable prose half of #37, split out so it can land on its own; #37 keeps the message menu, the phone pass and the settle fix.
FlowThread.selectable(on by default) wraps the conversation in aSelectionArea: drag across turns, copy with the platform shortcut. The messages' own gestures sit below it and keep winning. Touch platforms are never wrapped, since there a drag scrolls and the long-press is spoken for.showFlowTextSelectionpushes a full-screen page of a message on the raised ground, typeset as it was in the thread (text as markdown, code as code blocks; attachments and pictures left out, there being nothing in them to select), where a long-press selects a word and the platform's handles take over.FlowTextSelectionPageis public for a host with its own routing. It is the phones' selection route, pushed from a control of the host's; the message menu that offers it in the design arrives with feat: message menu, selectable prose, and the phone and settle fixes #37.FlowMessageData.plainTextjoins the text and code parts in order, for a copy action beside the page.FlowSelectionTheme(internal) puts the caret, wash, handles and the Cupertino primary in the Flow accent; the thread's selection and the page's route both apply it, so selection reads in the accent wherever the thread is mounted.Two seams with #37, both deliberate:
flow_text_selection.dart,flow_selection_theme.dart,flow_message_data.dartand the barrel are byte-identical with feat: message menu, selectable prose, and the phone and settle fixes #37's branch, so its later merge frommainis clean there.touchMinSize, which belongs to feat: message menu, selectable prose, and the phone and settle fixes #37's touch-target work; the finger-sized reach comes back when that lands.Screenshots
The selection wash and the select-text page render exactly as on #37, where their screenshots are attached; nothing new is drawn beyond them.
How this was verified
test/stays empty): the thread wraps inSelectionAreawith the accent selection theme on macOS by default,selectable: falseand Android opt out, the page typesets markdown and a code block inside aSelectionAreaand its close disc pops the route, andplainTextjoins text and code with a blank line.flutter analyzeclean at the root and inexample/andplayground/;dart format .applied; the docs site builds.Checklist
flutter analyze libandflutter analyzeinexample/andplayground/are cleandart format .applieddependencies:inpubspec.yamlis flutter.dev-published, forces no configuration on hosts that never use the feature, and is argued in this PRlib/flow_ui.dartand documented indocs/and the README tableCHANGELOG.mdupdated for user-facing changes, with breaking changes called outfeat:,fix:,refactor:,docs:,chore:)Note
Low Risk
Additive UI and selection behavior with a default-on thread flag; no auth, data, or model-facing changes.
Overview
Adds conversation text selection on desktop/web and a full-screen select-text route for phones, plus a
plainTexthelper for copy actions.FlowThreadgainsselectable(default true). On pointer platforms (not iOS/Android), the list is wrapped inSelectionAreainsideFlowSelectionThemeso drag-select works across turns and copy uses the platform shortcut; message gestures stay underneath. Touch platforms skip the wrapper—hosts openshowFlowTextSelectionfrom their own control instead.showFlowTextSelectionpushesFlowTextSelectionPage: message text/code typeset like the thread (markdown for assistant, plain text for user, code blocks; attachments/images omitted) in a scrollableSelectionArea, with a close disc.FlowMessageData.plainTextconcatenates text and code parts (blank line between) for copy beside the page.FlowSelectionTheme(internal) aligns caret, selection wash, handles, and Cupertino primary with Flow’s accent. Public API is exported fromflow_ui.dart; docs and changelog updated.Reviewed by Cursor Bugbot for commit 289fbfc. Bugbot is set up for automated code reviews on this repo. Configure here.