Skip to content

feat: selectable prose in the thread, and the select-text page - #39

Open
divyanshub024 wants to merge 1 commit into
mainfrom
feat/selectable-prose
Open

feat: selectable prose in the thread, and the select-text page#39
divyanshub024 wants to merge 1 commit into
mainfrom
feat/selectable-prose

Conversation

@divyanshub024

@divyanshub024 divyanshub024 commented Aug 30, 2026

Copy link
Copy Markdown
Member

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.

  • Drag-select on pointer platforms. FlowThread.selectable (on by default) wraps the conversation in a SelectionArea: 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.
  • The select-text page. showFlowTextSelection pushes 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. FlowTextSelectionPage is 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.plainText joins 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:

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

  • Throwaway widget tests (run, then deleted; test/ stays empty): the thread wraps in SelectionArea with the accent selection theme on macOS by default, selectable: false and Android opt out, the page typesets markdown and a code block inside a SelectionArea and its close disc pops the route, and plainText joins text and code with a blank line.
  • Not exercised in the playground in this pass; the thread stage drag-selects by default on desktop web.
  • flutter analyze clean at the root and in example/ and playground/; dart format . applied; the docs site builds.

Checklist

  • flutter analyze lib and flutter analyze in example/ and playground/ are clean
  • dart format . applied
  • Exercised in the playground — with a stage demo added or updated if this is a new component or variant
  • Any new entry under dependencies: in pubspec.yaml is flutter.dev-published, forces no configuration on hosts that never use the feature, and is argued in this PR
  • Nothing model-facing — no prompts, schemas, or provider/network calls
  • New public API is exported from lib/flow_ui.dart and documented in docs/ and the README table
  • CHANGELOG.md updated for user-facing changes, with breaking changes called out
  • PR title follows conventional commits (feat:, 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 plainText helper for copy actions.

FlowThread gains selectable (default true). On pointer platforms (not iOS/Android), the list is wrapped in SelectionArea inside FlowSelectionTheme so drag-select works across turns and copy uses the platform shortcut; message gestures stay underneath. Touch platforms skip the wrapper—hosts open showFlowTextSelection from their own control instead.

showFlowTextSelection pushes FlowTextSelectionPage: message text/code typeset like the thread (markdown for assistant, plain text for user, code blocks; attachments/images omitted) in a scrollable SelectionArea, with a close disc. FlowMessageData.plainText concatenates 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 from flow_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.

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