Skip to content

fix: preview selections, excerpt actions and code block wrapping - #362

Merged
Yuqing (mydmdm) merged 2 commits into
alphafrom
fix/issue-351
Oct 29, 2026
Merged

Yuqing (mydmdm) merged 2 commits into
alphafrom
fix/issue-351

Conversation

@mydmdm

@mydmdm Yuqing (mydmdm) commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix CodeMirror active-line backgrounds covering the drawn text selection. Reuse the layering pattern already used by Milkdown code blocks, preserving the active-line affordance while painting it below selection.
  • Reuse Chat/Note's FragmentSelectionActions in readonly File Reference Preview: Copy, Add as note, Comment.
  • Copy only the current selected loaded source text with explicit retryable failure feedback. Add as note creates a Space Note with excerpt provenance pointing to the File Reference node; it never writes back to the source file. Both clear the selection after success.
  • Preserve File Comment snapshots, source metadata, existing-conversation staging, no automatic send/navigation/read-more, and existing lazy/read-only boundaries.
  • Enable CodeMirror's supported soft wrapping through the shared Milkdown factory's Crepe feature configuration. Chat and Note source code blocks, editable or readonly, reflow with their container width without inserting source line breaks or changing Copy/serialization. This includes ordinary code and latex/tex source fences; math previews remain unchanged.
  • Update device-files, Note and Preview Workspace architecture documentation.

Follow-up to merged #358; progresses #351 without closing it. The user explicitly approved the shared Chat/Note soft-wrap scope and requested it in this same PR; it is a separate cohesive commit after the File Preview fix. Ink, bootstrap, other Preview entry points, dependencies, APIs and subtrees are unchanged.

Validation

  • Repository pnpm typecheck, pnpm format, pnpm lint:fix: passed; lint has zero errors and 337 existing warnings.
  • Final affected web typecheck, focused zero-warning lint, formatting, whitespace and tracked license-header checks: passed.
  • Combined focused web unit regressions: 6 files / 54 tests passed, including raw CodeMirror, File Preview/actions, existing Chat comments, long-source round trips/drag export and existing Milkdown serialization fixtures.
  • Isolated Chromium Playwright: 18 tests passed (File mouse/touch, Note mouse/touch, Chat comments, source/math streaming and new soft-wrap/resize cases).
  • File browser cases exercise real pointer text selection on a long wrapped line and native touch selection, verify actual selected-background pixels in focused and unfocused states, assert Copy content and precisely one Add-as-note excerpt/provenance, and retain Comment source/draft/no-extra-read/no-turn/no-navigation checks.
  • File unit cases additionally cover clipboard failure/retry, expired capture and preserved multiline excerpts.
  • Milkdown browser cases exercise light/dark and mouse/readonly-touch source blocks across 640px, 320px and 520px container widths. They assert no horizontal source overflow, measured wrapped-line heights increasing/decreasing with width, unchanged indentation and source lines, and exact block/whole-message clipboard text for text/latex/tex fences. Unit cases retain long code text and stable Markdown through editable/readonly Chat/Note factory modes.

Real device filesystem reads, physical iPad/pen behavior and non-Chromium browsers were not verified. The unrelated pre-existing Ink playground-count fixture is not changed or selected by this hotfix's focused browser suite.

Yuqing (mydmdm) and others added 2 commits October 29, 2026 06:36
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mydmdm Yuqing (mydmdm) changed the title fix: visible File Preview selection and Copy / Save / Comment parity fix: preview selections, excerpt actions and code block wrapping Oct 29, 2026
@mydmdm
Yuqing (mydmdm) merged commit 463fc62 into alpha Oct 29, 2026
4 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