Skip to content

feat(write,sheets): scroll to the page bottom, fix pasting line breaks, Pageless by default, mobile layouts (T-1) - #24

Merged
vlidholt merged 3 commits into
serverpod:mainfrom
vlidholt:feat/editor-improvements-t1
Oct 20, 2026
Merged

vlidholt merged 3 commits into
serverpod:mainfrom
vlidholt:feat/editor-improvements-t1

Conversation

@vlidholt

Copy link
Copy Markdown
Contributor

Wonky-Task: T-1
Wonky-Claim: 6PSV-32KZ

Various editor improvements in Write and Sheets (reports #1, #16, #17, #21, #22).

Acceptance criteria

  • Write: scroll to the very bottom of the page, also when it isn't full (fix(rich-editor): No caret in a field without focus (T-2) #1). The page cards are painted under the document, so the scroll extent used to end at the last line. PaginationStylePhase now gives the last block the rest of its page plus the 48 px bottom canvas padding (PaginationController.tailPadding); it is component padding, so it never feeds back into the measure. Widget tests: one-line document and a partly full last page (wonky_editor_pagination_test.dart).
  • Write: pasting text with consecutive line breaks works, the breaks can be deleted, undo/redo (feat(board): merge tasks, rewrite prompts when issues change, call posts issues #21). Root cause: when a block with spelling errors was removed (Backspace merging the pasted empty paragraphs), WriteSpellcheck cleared its underlines from the document listener, before super_editor's layout had seen the removal. The dirty style phase made the layout restyle its stale cached view model, which still had the removed block → "No such position in document" (null node in SingleColumnLayoutSelectionStyler), and the editor stopped updating, so the breaks stayed visible. The underlines are now cleared in a microtask. Reproduced in the browser before the fix and checked after it. Tests: the spellcheck regression (write_spellcheck_test.dart) and paste → delete → undo all → redo all for plain text, HTML paragraphs and <br> soft breaks (editor_clipboard_test.dart).
  • New documents open Pageless (feat(board): claim limits, similar-issue details, admin toolbar with prompt comments, issues as Markdown (T-10) #22). The server creates blank documents, built-in templates, the New here? document and Markdown documents with the locale default page setup in the user's default layout (DriveService.newDocumentPageSetup, UserService.defaultPageless): Pageless unless Settings › Write › Page & export › Default layout is Pages, which now shows Pageless when unset. Copies, imports and user templates keep their own page setup; existing documents are unchanged. Tests: server (drive_endpoint_test.dart, welcome document in user_endpoint_test.dart), Write screen and settings.
  • Write on mobile (chore(super_editor): fix the 300 analyzer issues and check them in CI #16): always Pageless (layout only, the page setup is unchanged; widening restores it), 16 px beside, above and below the text, a 1 px border line under the title row (write.mobile.separator), and no text selection (selectionGuard collapses the selections the user makes, which a read-only document doesn't show; refusing them would crash super_editor's touch interactors). Widget tests in write_document_screen_test.dart.
  • Sheets on mobile: no cell selection, swiping pans (feat(board): have the user verify a task by hand before the pull request #17). In the read-only layout every pointer goes to the touch tracker as a pan (with fling), taps and long presses do nothing, and the selection isn't painted. The desktop is unchanged. Widget tests in sheet_editor_screen_test.dart (touch, long press then move, mouse). Checked in tests only, not on a phone.
  • Sheets on mobile: taller tabs, hidden controls (feat(board): have the user verify a task by hand before the pull request #17). The tab bar is 48 px with 42 px tabs in 15 px text; only the all-sheets menu and the tabs show: no add button, tab menu (▾ or right-click), < / > arrows, Explore or selection stats. Widget tests for mobile and an unchanged desktop bar.
  • Light and dark: the Write line uses the theme border color, the Sheets bar its existing tokens; tested in both (screenshots below).

Specs updated: Write 04 §28–29, 05 §13.3/§16/§17, suite 02 §6.1, Sheets 03 §5, 04 §6 and STATUS; TODO.

Screenshots (390 px wide)

Light Dark
Write
Sheets

Checks

dart analyze and dart format clean in wonky_write, wonky_sheets and wonky_server. flutter test -x golden,slow,e2e passes in wonky_write and wonky_sheets (two unrelated Sheets tests, presence typing hints and a pivot filter, failed only while both suites ran at once and pass on their own). dart test in wonky_server passes; three tests that failed in setUpAll during the full run pass on a rerun, and the MCP page-setup revert test now starts from Pageless. Verified by hand by the user.

🤖 Generated with Claude Code

vlidholt and others added 3 commits October 20, 2026 09:54
…s, Pageless by default, mobile layouts (T-1)

- Write, Pages: the last block gets the rest of its page plus the 48 px
  canvas padding as bottom padding (PaginationStylePhase.tailPadding), so
  the scroll extent reaches the last page's bottom edge also when the page
  isn't full (serverpod#1).
- Write, paste (serverpod#21): removing a block with spelling errors cleared its
  underlines from the document listener, before super_editor's layout saw
  the removal; the layout restyled its stale view model, threw "No such
  position in document" and stopped updating, so pasted line breaks stayed
  visible. The spellcheck now clears them in a microtask.
- New documents (blank, built-in templates, the welcome document, Markdown)
  are Pageless unless the user's default layout is Pages
  (DriveService.newDocumentPageSetup, UserService.defaultPageless); the
  setting shows Pageless when unset (serverpod#22).
- Write on mobile: always Pageless (layout only, the page setup is
  unchanged), 16 px around the text, a 1 px border line under the title
  row, and no text selection (selectionGuard collapses user selections,
  which a read-only document doesn't show) (serverpod#16).
- Sheets on mobile: no cell selection (every pointer pans the grid, the
  selection isn't painted), taller sheet tabs, and only the all-sheets menu
  and the tabs in the tab bar (serverpod#17).
- Specs: Write 04 §28-29, 05 §13.3/§16/§17, suite 02 §6.1, Sheets 03 §5,
  04 §6, STATUS; TODO.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wonky-work-bot

Copy link
Copy Markdown

Wonky task review: T-1: Various editor improvements

Screenshot: the description has an image of the changed UI.

The pull request successfully fulfills all acceptance criteria related to Write and Sheets updates, both mobile layouts and functional bugs. It properly fixes the multiple line breaks crash by deferring the spellcheck state update into a microtask, resolves the empty page scroll bug via padding computation, and aligns default views securely. The codebase is well-tested around the new interactions.

Acceptance criterion Verdict Evidence Note
In Write, users can scroll to the very bottom of the document page, even when the page is not completely full. Met wonky_write/lib/features/editor/pagination/pagination.dart (27-319), wonky_write/test/features/editor/ui/wonky_editor_pagination_test.dart (244-296) PaginationController now computes a tail padding for the last block so the scroll extent reaches the bottom.
In Write, pasting text with multiple consecutive line breaks works correctly, does not crash the editor, the pasted line breaks can be successfully deleted, and these actions are fully undoable and redoable. Met wonky_write/lib/features/spellcheck/write_spellcheck.dart (180-201), wonky_write/test/features/editor/paste/editor_clipboard_test.dart (185-257), wonky_write/test/features/spellcheck/write_spellcheck_test.dart (225-248) Clearing errors on removed nodes is now deferred to a microtask, avoiding crashes; tests confirm paste/delete/undo/redo logic works.
New Write documents (including templates and the default "New here?" document) open in pageless mode by default. Met wonky_server/lib/src/platform/drive/drive_service.dart (271-360), wonky_server/lib/src/platform/users/user_service.dart (454-464), wonky_server/test/integration/platform/drive_endpoint_test.dart (106-166), wonky_server/test/integration/platform/user_endpoint_test.dart (38-47) DriveService uses defaultPageless (true unless chosen otherwise) when creating documents and templates.
In Write on mobile, the editor strictly uses pageless mode, top and bottom padding are reduced, text selection is disabled, and a divider line separates the top menu from the page content. Met wonky_write/lib/features/screen/write_document_controller.dart (612-628), wonky_write/lib/features/screen/write_document_screen.dart (225-243), wonky_write/lib/features/editor/setup/editor_factory.dart (47-67), wonky_write/lib/features/editor/ui/wonky_editor.dart (675-853) Text selection is guarded, padding is adjusted via compact padding applied top and bottom, view set to pageless, and a 1px border is added.
In Sheets on mobile, cell selection is disabled and swiping pans the document view. Met wonky_sheets/lib/features/grid/grid_area.dart (559-641), wonky_sheets/lib/features/grid/grid_touch.dart (30-114), wonky_sheets/lib/features/grid/paint/layers/overlay_layers.dart (116-388) Touch inputs and overlay rendering are bypassed for selections and treated as pan gestures in the read-only mobile layout.
In Sheets on mobile, the sheet tabs are taller, the tab dropdown menu is hidden, and the add sheet button, &lt; / &gt; arrows, and Explore button are hidden. Met wonky_sheets/lib/features/tab_bar/sheet_tab_bar.dart (19-559) The layout renders mobile height dimensions, hides unused actions and limits buttons shown.
Light and dark modes correctly render the new Write divider line and the updated Sheets mobile UI elements. Met wonky_write/test/features/screen/write_document_screen_test.dart (583-605), wonky_sheets/test/features/sheet_editor/sheet_editor_screen_test.dart (283-305) The widget tests run in both dark and light variants and verify visual constraints are correct.
The pull request description includes a screenshot of the changed UI (light and dark where both change). Met <pr_data> (33-40) The description includes screenshots of the requested changes for both light and dark themes.

Scope:
No unrelated changes found.

Tests: Added. Extensive tests were added asserting the new pasting interactions, scroll layouts, and read-only mobile features.

Specs: Updated. Specs 02, 04, 05 and STATUS were updated with mobile layout notes and behavior changes.

Risks:

  • Security in wonky_server/lib/src/platform/users/user_service.dart: The change queries database preferences in UserService which looks sound and scoped to the provided user ID.
Facts
  • Changed files: 31 (+980 −139)
  • Tests changed: yes
  • specs/ changed: yes
  • pubspec.yaml changed: no
  • Migrations added: none
  • Workflow or tooling changes: none
  • Security-sensitive paths: wonky_server/lib/src/platform/users/user_service.dart

Reviewed commit 69032abfb98b. This review is advisory; CI and the maintainers decide.

@vlidholt
vlidholt merged commit 2240e84 into serverpod:main Oct 20, 2026
42 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant