Skip to content

Write improvements: organizations, sharing, assistant redesign, undo fixes, Serverpod 4.1.1 - #44

Merged
vlidholt merged 35 commits into
mainfrom
write-improvements-4.1.1
Nov 7, 2026
Merged

vlidholt merged 35 commits into
mainfrom
write-improvements-4.1.1

Conversation

@vlidholt

@vlidholt vlidholt commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

A batch of Wonky Write improvements, several of which reach the whole suite (shared shell, sharing, AI), plus the Serverpod 4.1.1 upgrade.

Serverpod

  • Upgrades every Serverpod package to 4.1.1, regenerates the protocol and moves the MCP and GitHub webhook routes to the Relic headers.names / values API.

Organizations and sharing (all apps)

  • Organizations are users with the same verified email domain. Public mail providers (gmail.com, outlook.com, …) never form one. Config can add public domains and alias domains; there are no built-in aliases (spec 04 §6).
  • "Anyone at " is a new general-access option with a role, enforced in AccessService and inherited from folders (06 §2.3).
  • People search finds members of your organization by name or email prefix; anyone else needs their full email.
  • Signed-out viewing: with "Anyone with the link", Write documents, spreadsheets and decks open view-only without signing in, rate-limited, with no emails or presence exposed. Drive files still need sign-in (06 §2.2, 13).
  • Share emails: "Send an email" (on by default) emails existing users right away and sends people without an account a sign-up invitation that returns to the item. Invitations are capped per sender (06 §4, 07 §4).
  • Share dialog:
    • typing switches to an adding-people mode with Cancel and Send/Share;
    • recipients are real chips (avatar, name, ×) that flow inline with the input, and Backspace removes the last one;
    • Send/Share also takes a valid typed address;
    • Copy link is on the left;
    • the settings page has only Done, and Reset link is gone.

AI assistant

  • Chat errors fixed: the "Something went wrong" after the first or second message was a Gemini thought-signature replay bug.
  • Faster: quick actions make one call per section on the fast model at low effort, with the document in the request.
  • Always suggestions: Write's assistant never edits directly. The Edit/Suggest switch and the large-edit confirmation are removed.
  • Quick actions: Summarize, Proofread, Address comments and Apply style show only a working indicator, then the result. They work on the selection when there is one, otherwise on the whole document.
  • Style guides: built-ins (including a developer-docs style adapted from Serverpod's guide), personal or organization-shared guides, an organization default and a per-document choice.
  • Organization AI keys: any member can share a provider key with the organization, behind a clear warning and a confirmation. Order of use: server key > own key > organization key (10 §1).
  • UI: Tools › Assistant submenu with the panel's actions and icons; the composer is one row that grows, with no Send button.

Undo fixes

  • An undo after a redo left the deletion marks of suggestions behind: fix-ups (the server's re-stamped suggestion times) now lose conflicts to the undo stack (Write 03 §4).
  • Assistant ops that arrive through a gap fill or a reconnect keep their run, so a run stays one undo step. document_op stores onBehalfOfSessionId and groupId.

Write and shell polish

  • Icons for Paste as Markdown, Find, Find next and previous, Code block, Quote, Checklist and Special characters. View › Panels uses the sidebar's icons and order.
  • Menus: Help › What's new, Tools › Explore and Accessibility settings are removed. "Bugs & improvements" is split into Report a bug and Suggest an improvement.
  • Header and profile menu: one Settings entry; the Share button matches its neighbours; the profile menu no longer shows your name and email.
  • Dialogs never show an X when they have Cancel, Close or Done. There is an AGENTS.md rule and tool/check_dialogs.dart, run in the analyze workflow.
  • Markdown guide has a Wonky Markdown tab in Wonky Markdown documents.
  • Caret is hidden while the editor isn't focused, and focus returns to the editor after menu and toolbar commands.
  • Buttons and chips: selections in them line up with the pill and show inside buttons.
  • Text fields are white in light mode, through the theme's field fill.

Migrations

  • 20261107102052050-org-sharing-style-guides: organization grants, style guide tables, and the permission index rebuilt with orgKey. It was created with --force, but existing rows cannot collide because the new column is null.
  • 20261107115351503-op-run-group: two nullable columns on document_op.
  • 20261107153926054-ai-org-key: the ai_org_key table.

Testing

  • dart analyze is clean in all packages.
  • Targeted suites pass: server unit tests and the AI, sharing, organizations, Write, Sheets, Slides and RevLog integration tests; Flutter tests for the shell, Write, Sheets, Slides and Drive.
  • Checked in the browser: only the white text fields. The rest is covered by widget tests and test renders.
  • Not verified against real services: delivery through Resend (development only logs emails) and the assistant's speed against real Gemini.

🤖 Generated with Claude Code

vlidholt and others added 30 commits November 7, 2026 10:35
…uest

Gemini 3 sends a thought signature with every tool call. The assistant
stored it as JSON, and dartantic's Gemini mapper casts it 'as List<int>'
when the call is replayed, which throws for a decoded JSON list. The cast
ran synchronously in sendStream, outside the provider-error mapping, so
the second round of every tool-using run ended in 'Something went wrong',
and every later message of that thread failed within ~25 ms.

- DartanticAiClient: restore signatures to List<int> before sending,
  drop thinking-only parts and empty turns, map request-building errors
  to a 'request' failure with a useful message, inject the HTTP client
  for Gemini (tests), send thinkingLevel low for the low effort tier.
- AssistantHistory.repair: answer tool calls left without results by an
  interrupted run, drop orphan results.
- Run failures are logged at error level (they were verbose only).
- Tests: Gemini replay through the real dartantic mapper with a mocked
  API (unit and through the assistant loop), history repair.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… link viewing

- OrganizationService: organizations from verified email domains, a built-in
  list of public mail providers (plus reserved names) that never form one,
  `wonky: organizations:` config for extra public domains and alias groups
  (default serverpod.dev + serverpod.com). orgOf/orgKeyOf/sameOrganization.
- "Anyone at <domain>": organization grants on DriveItemPermission (orgKey),
  inherited through folders, copied with sharing, enforced in
  AccessService.rolesFor and the drive listing/search SQL; general access is
  one choice (sharing.setGeneralAccess; setLink clears org access).
  SharingInfo gains organization, orgAccess, inheritedOrgAccess,
  generalAccess; getMe returns the organization.
- People search: organization members by name-word or email prefix besides
  related users and exact emails; relatedIds/getUsers use the same sets.
- Signed-out viewers (Actor.anonymous): Viewer on link-shared documents,
  spreadsheets and presentations only; publicItem.get, the read calls and
  streams of document/sheetsDoc/slidesDoc, file.getUrl(s) and the Write
  theme reads, rate limited per address and in total; no presence identity,
  no drive state, emails blanked; expired tokens still get 401.
- Migration 20261107093834564-org-sharing (orgKey column, indexes).
- Spec 04 §6 Organizations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Server side of the Write assistant redesign (Write 09 §5.5, §5.9, suite
10 §7):

- assistant.quickAction(threadId, itemUuid, action, hints): Summarize,
  Proofread, Address comments, Apply style. One model round trip (per
  section, in parallel) on the fast model at low effort, the document in
  the request, edits applied as suggestions through the assistant tool
  path (chips, one undo group). The prompt is a hidden turn, so a later
  chat message replays a valid conversation.
- Address comments: fixes as suggestions plus one short reply per fixed
  thread; threads stay open; the rest is listed for the user.
- Style guide library: built-ins (developer docs adapted from Serverpod's
  style guide, technical, business, plain language, marketing), users'
  own guides (personal or shared with their organization), org default,
  per-document choice (new tables style_guide, style_guide_org_default,
  document_style_guide; migration 20261107094639209). Endpoint styleGuide.
- Organization lookup is a stopgap (style_guide_orgs.dart, marked
  STOPGAP(org-sharing)) until OrganizationService lands.
- Write chat edits are always suggestions; the prompt says the document
  is already included and asks for parallel edits; the style guide is
  part of the turn context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e caret without focus

super_editor patch SE-16: the caret overlay takes the editor's focus node and
is hidden while the editor doesn't have focus. Editor commands run from a
menu, the toolbar, a context menu or the palette refocus the editor after the
frame, so choosing a heading in the style picker keeps typing in the document.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WonkyDialogCloseButton renders nothing inside a ShadDialog with actions
(Cancel, Close, Done, Got it, …), so the rule holds for every dialog of every
app; always: true keeps it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuSpec.command(showIcon:) shows a toggle's icon with the check at the end.
Write: Paste as Markdown clipboard-list, Find next/previous
arrow-big-right/left-dash (also the Find panel buttons), Code block code,
Special characters languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a Wonky Markdown document Help › Markdown guide gets a second tab with the
extensions (callouts, details, cards, grids, buttons, arrow links, chips,
numbered headings, YouTube) and their syntax.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- One Settings entry (Lucide settings, shell.settings.openApp) in Tools, the
  account menu and the palette; the settings page is titled Settings. Write's
  Preferences submenu, Wonky Work settings and Accessibility settings are gone;
  shell.settings.open stays for links and MCP (palette hidden).
- Tools: no Explore (Sheets keeps its Explore panel item).
- Help: Report a bug and Suggest an improvement (shell.board.report {kind}),
  no What's new (command and dialog removed).
- View › Panels: rail order with rail icons (Write: Assistant, Outline, Find,
  History); Insert's Code block / Quote / Checklist keep their icons.
- Account menu without the name and email; header Share button is sm.
- Specs 02, 03, 04, 08, 16, Write 05, Sheets 04, Slides 04; l10n regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (06, 13, Drive 01)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Shared panel (wonky_app): no Send button (Enter sends, Shift+Enter is a
  new line); the composer is one line that grows, so the placeholder and
  typed text start at the same place; Stop sits next to the field. An
  adapter can implement AssistantPanelExtras: quick action buttons
  instead of quick prompts, no Edit / Suggest toggle, extra ⋮ items and a
  follow-up button under failed replies. Long chip lists collapse to
  '+N more'. AssistantController.runQuickAction shows no user bubble,
  only a working indicator, then the result.
- Style guide library dialog (browse, write in Markdown, share with the
  organization, org default, choose for the document) with undoable
  changes (StyleGuideUndoHandler; the document's choice on its stack).
- Write: quick actions Summarize, Proofread, Address comments, Apply
  style (commands write.ai.*); edits always suggestions (no apply-mode
  command or toggle); Tools > Assistant submenu; File > Style guide...;
  write.doc.setStyleGuide (undoable). The old proofread issue list is
  replaced by Proofread suggestions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…style guides

Suite 10: replay rules (the Gemini thought-signature failure and the
history repair), Gemini thinkingLevel for low effort, the composer, the
quickAction endpoint, style guides (§7). Write 09: always suggestions,
quick actions with the comment-reply decision and the measured speed,
style guides (§5.9), commands, tests. Write 05: Tools > Assistant
submenu, File > Style guide..., panel. TODO: follow-ups. Spec index
regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eople field

- General access offers Restricted, Anyone at <domain> (with an organization
  or an existing org grant) and Anyone with the link, each open choice with a
  role; changes go through sharing.setGeneralAccess. Hints cover signed-out
  link viewing and inherited organization access.
- The "Add people" field is one ShadDecorator (single border, focus ring)
  as tall as the role select; hint for full emails outside the organization.
- Widget tests for the new options, re-sync on failure and field geometry.
  (The l10n keys land with the next commit, which shares the ARB files.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… out

- Write, Sheets and Slides allow exactly the editor route signed out
  (WonkyAppConfig.allowsGuestViewing; Drive keeps sign-in). The item comes
  from publicItem.get; the editor is view-only whatever the link role, with
  no drive state, comments, presence or history, and a Sign in button
  (shell.account.signIn) that returns to the item. Items that are not
  link-shared show a signed-out "Sign in to open this" page.
- Commands that need an account are disabled for guests
  (guestAllowsCommand); preferences are kept on the device only.
- Write: no offline store, Viewing mode only. Sheets/Slides: a view-only
  RevLog guest installation (RevLogClient.startGuest) that never syncs
  outboxes; linked Slides charts show their snapshot.
- l10n for the share dialog and the guest UI; specs 03 and 08.
- Tests: router guest routes, scaffold guest mode, guest sessions per app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	packages/wonky_app/lib/src/editor/editor_scaffold.dart
#	wonky_server/migrations/migration_registry.txt
Style guides take the organization from OrganizationService instead of
the assistant branch's stopgap helper. The two branch migrations are
replaced by one combined migration (org grants + style guide tables),
created with the pinned Serverpod 4.1.0-rc.1 CLI; client docs
regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pins every Serverpod package at 4.1.1, regenerates the protocol and
reads request headers through the Relic `headers.names` / `values` API
in the MCP and GitHub webhook routes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Organizations are one domain each unless `wonky: organizations: aliases`
says otherwise; the serverpod.dev + serverpod.com default is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Undo after a redo left every deletion mark of a suggestion behind: the
  server's fix-up of an own op (restamped suggestion times) won attribute
  conflicts when the undo stack was rebased over it. Fix-ups now lose
  conflicts to the stack entries (Write 03 §4).
- Assistant ops that reach the client through a gap fill or a reconnect
  lost their run, so a run could undo in two steps: document_op stores
  onBehalfOfSessionId and groupId, and DocumentOpView and gap fills carry
  them.
- No destructive-change confirmation in Write: every assistant edit is a
  suggestion and a run is one undo step (Write 09 §5.8). The relayed
  confirmation test moved to Sheets.
- Quick actions work on the selection when there is one, else on the
  whole document (Write 09 §5.5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The "Ask the assistant" field is exactly one input row when empty (no
  minimum height, padding derived from the theme) and still grows with
  more lines.
- Tools › Assistant lists the panel's actions with the panel's icons
  (shared WriteAiIcons); Generate outline is left to the command palette.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The form dialogs (showWonkyFormDialog: confirm, rename and the apps'
  form dialogs) passed no closeIcon, so shad's theme drew its own X next
  to their buttons; they use WonkyDialogCloseButton now. Same for the
  table editor's discard prompt.
- The share dialog's Copy link / Done footer is its actions, and the
  close button is keyed on them (a const one kept the X of the loading
  state).
- Sheets: find & replace has no X (Done closes it); the script conflict
  dialog, whose five buttons wrap in the body, has none either.
- tool/check_dialogs.dart (CI, analyze workflow) fails on a ShadDialog
  without closeIcon, with another close icon, or with a dismiss button in
  its arguments but no actions. Rule in AGENTS.md and suite 02 §4.20.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A share with notify ("Send an email") now emails every newly added
person through the EmailSender, off the request path
(ShareEmailFutureCall):

- existing users get "<name> shared “<title>” with you" with the role,
  the optional message and a link; the shared notification is created
  as emailed so the digest never repeats it (a failed send gives it
  back to the digest). Their shares setting "off" still means nothing.
- addresses without an account get an invitation that opens sign-up in
  the item's app and returns to the item (/write/signup?next=/d/<uuid>).

Invitations are capped per sender (sharing.inviteEmailsPerHour/PerDay,
30/100; the share is refused before anything changes); emails name the
sender by display name only and never another person's address; the
message (max 1000 chars) and names are escaped. RateLimiter.check takes
a cost for batches (INCRBY in Redis).

Specs 06 §4, 07 §4, 09, 13 §1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The "Notify people" checkbox becomes "Send an email" (default on) with a
hint (people without an account get an invitation; off: no email or
notification); the message field is optional, capped at 1000 characters
and only sent with an email. Shared by Write, Sheets, Slides and Drive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The taller line box of buttons (2.3 em) and chips (1.8 em) put its extra
space mostly above the label, so the selection highlight rode above the
pill. Their leading is now split evenly. On a button the accent
highlight was invisible on the accent fill: the pill painter lightens the
selected part within the pill (Write 11 §7.2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Typing or picking someone switches the dialog to adding people: only
  the composer shows, with Cancel and Send/Share in the footer; Cancel
  (or Esc) goes back. Send/Share also takes a valid typed address that
  isn't a chip yet; Backspace in the empty field removes the last chip.
- "Send an email" has no subtitle; the search hint's line is always
  reserved so nothing jumps.
- Copy link sits on the left of the footer (full-width actions row).
- Sharing settings: Done only (no back arrow), no Reset link (the copied
  link is the item URL, which a new token doesn't change).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recipients are rounded chips with an avatar and the person's name (the
email in a tooltip) or the typed address, and an × to remove them. A
small layout flows them like words and gives the input the rest of the
line, wrapping only when less than 120 px is left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vlidholt and others added 5 commits November 7, 2026 16:30
Text fields, text areas and selects are filled with the page background
(white in light mode): vega left them transparent and their control
shadow showed through as a gray wash on the web, about the color of the
recipient chips. Dark mode keeps vega's input wash. A typed address's
chip shows its initials on blue (the info color) instead of gray.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Any member of an organization (verified email domain) can add, replace
or remove an AI provider key shared with everyone in it, in Settings ›
AI providers › Key for <domain>. The group warns that anyone who signs
in with an email at the organization's domains can use the key and that
their usage is billed to it; sharing asks for confirmation. Resolution
is server key > own key > organization key. The key is stored server-
side (ai_org_key) and never returned; clients see the provider, the last
four characters and who added it. Specs 10 §1, 04 §6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generated-code check regenerated with the 4.1.0-rc.1 CLI, whose
output differs from 4.1.1's. The workflows, CONTRIBUTING and the board's
Contribute page now name 4.1.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Any member may replace the shared key, so the update writes only the
columns it changes instead of the whole row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vlidholt
vlidholt merged commit a769426 into main Nov 7, 2026
41 checks passed
@vlidholt
vlidholt deleted the write-improvements-4.1.1 branch November 7, 2026 16:30
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 7, 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