Commit Graph
10176 Commits
Author SHA1 Message Date
Tom MoorandClaude Opus 5 77fcd895c4 Replace custom tabs in IconPicker (#13358)
* Replace custom tabs in IconPicker

* Use standard click handler type for Tab in button mode

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 23:10:28 +00:00
Tom Moor 689cec6cd4 fix: Custom color picker should default to the current color (#13356) 2026-08-08 15:00:56 -04:00
Tom Moor 0f2beffa95 fix: Split view pane spacing and footer alignment (#13355)
* Add inset padding on secondary split view

* fix: Footer layout in split view
2026-08-08 14:30:54 -04:00
Tom Moor 94e8e89943 fix: Caret stuck in emoji node (#13354)
* fix: Caret positioning warning in editor

* fix: Caret stuck inside emoji node
2026-08-08 13:39:24 -04:00
Tom Moor 08838e816e chore: Fix up some warnings during yarn install (#13353) 2026-08-08 12:36:27 -04:00
Tom MoorandClaude Opus 5 6d97282045 Live document stats in the corner of the editor (#13318)
* feat: Live document stats in the corner of the editor

Moves word and character counts out of the Insights dialog into an
optional bar in the bottom corner of the document that updates as you
type, adding paragraph count and reading time.

Enabled with a new "Show editing stats" preference, or toggled with
Cmd+Shift+G. The counts switch to the selection while text is selected,
and fade out while idle.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: Stats bar should not intercept clicks in the editor

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Add toggle to document menu and command menu

* fix: Empty documents should not report a one minute read

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 12:07:55 -04:00
Tom MoorandClaude Opus 5 2eff2b2652 chore(deps): dedupe js-yaml onto 4.3.1 (#13352)
The transitive ^4.1.0 descriptor was still resolving to 4.3.0 while the
direct dependency had already moved to 4.3.1. Re-resolved so both share
a single entry.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 15:08:43 +00:00
dependabot[bot] c9f8bb7816 chore(deps): bump dompurify from 3.4.12 to 3.4.13 (#13349)
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.4.12 to 3.4.13.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/3.4.12...3.4.13)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-version: 3.4.13
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-08 10:56:23 -04:00
dependabot[bot] 649c1dbad2 chore(deps): bump hono from 4.12.31 to 4.13.0 (#13351)
Bumps [hono](https://github.com/honojs/hono) from 4.12.31 to 4.13.0.
- [Release notes](https://github.com/honojs/hono/releases)
- [Commits](https://github.com/honojs/hono/compare/v4.12.31...v4.13.0)

---
updated-dependencies:
- dependency-name: hono
  dependency-version: 4.13.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-08 10:56:14 -04:00
dependabot[bot] f30f47366f chore(deps): bump mermaid from 11.16.0 to 11.16.1 (#13346) 2026-08-08 13:12:34 +00:00
dependabot[bot] 330c49e3f4 chore(deps): bump nanoid from 3.3.16 to 3.3.17 (#13350)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.16 to 3.3.17.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.16...3.3.17)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-version: 3.3.17
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-08 13:09:00 +00:00
dependabot[bot] 5e3afaf3b0 chore(deps): bump js-yaml from 4.3.0 to 4.3.1 (#13348)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.3.0 to 4.3.1.
- [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.1/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.3.0...4.3.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.3.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-08 09:07:21 -04:00
Tom MoorandClaude Opus 5 2a77f76567 ci: Don't block merging on the dependency audit (#13347)
* ci: Make dependency audit a warning instead of a failure

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* ci: Let audit fail on its own, drop it from the aggregate check

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 13:01:29 +00:00
Tom MoorandClaude Opus 5 39fec9e7c7 fix: Crash inserting a template with no content from the block menu (#13345)
Template content is nullable, but the presenter passed it through raw so
a template without content reached the client with no data at all.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 21:09:16 -04:00
Tom MoorandClaude Opus 5 b82c57cedf fix: Build canonical redirect url from team, not request host (#13344)
* fix: Build canonical redirect url from team, not request host

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test: Cover canonical host redirects

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 19:29:29 -04:00
Tom MoorandClaude Opus 5 399cd4041d perf: Reduce database and Redis round-trips on the MCP endpoint (#13333)
* perf: Reduce database and Redis round-trips on the MCP endpoint

Profiling production traces for the /mcp endpoint showed the time is
spent in repeated permission and breadcrumb lookups rather than in the
MCP layer itself.

- Cache Document.membershipDocumentIds in Redis, mirroring the TTL and
  key pattern of User.collectionIds. The two are resolved together for
  every search and this half was uncached, measuring ~200ms.
- Resolve each collection's cached document structure once, concurrently,
  when building breadcrumbs for a batch of documents. It was awaited per
  document inside a loop, so a page of search results meant a serial
  Redis round-trip for every result.
- Walk each collection structure once into a document ID to breadcrumb
  map instead of searching the whole tree per document.
- Reuse the collection association already loaded by Document.findByPk
  when resolving a single document's breadcrumb, rather than querying it
  again under the same membership scope.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: Invalidate cached document membership IDs on permission changes

The cache added alongside membershipDocumentIds relied on its TTL alone,
so a revoked grant stayed searchable until it expired. Clear the key on
the paths that change which documents a user is a member of, keeping the
TTL as a backstop.

- UserMembership create and destroy where documentId is set.
- GroupMembership create and destroy where documentId is set, for every
  user in the group.
- GroupUser create and destroy, as joining or leaving a group changes
  which group grants reach the user.

Sourced memberships are written with hooks disabled and destroyed without
individual hooks, so the parent membership invalidates once for the group
rather than once per descendant.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 19:01:02 -04:00
Tom Moor d0ad25cd8f fix: Tighten scoping of share subscription notifications (#13343)
Resolve notification recipients through the same loader that backs the
public share endpoints, so a subscriber is only mailed about a document
the share would actually serve them.
2026-08-07 18:43:24 -04:00
Tom MoorandClaude Opus 5 df64de9b3c fix: Back off repeated confirmation emails for share subscriptions (#13342)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 18:04:40 -04:00
Tom Moor 97d74e84be fix: Missing ip on events created during account provisioning (#13334) 2026-08-07 18:03:38 -04:00
Tom MoorandClaude Opus 5 f65142989b fix: Run MCP create_document inside a transaction (#13335)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 18:03:14 -04:00
Tom MoorandClaude Opus 5 fc7f33577f fix: Sanitize user-provided name when building export storage keys (#13336)
* fix: Sanitize user-provided name when building export storage keys

Export keys interpolated a document title or collection name straight
into the storage path, so a name containing path separators could move
the archive out of the uploads bucket and into public, where files.get
serves content without authorization.

Sanitize the name down to a single path segment, dedupe the duplicated
key builder in collectionExporter, and reject traversal in LocalStorage
where resolve-path only guards the root, not movement between buckets.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore: Complete JSDoc on export key helpers

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 21:58:58 +00:00
Tom Moor 9d7b7da625 fix: Improve BadGatewayError reporting (#13341)
Error names were mangled by the production build and 502 responses often
have an empty body, so these were reported without a usable title. Errors
now carry an explicit name, the message includes the endpoint, and 502s are
grouped per endpoint.
2026-08-07 17:53:56 -04:00
Tom Moor a00b64a4e6 fix: Avoid issuing collab token to API clients (#13332)
* fix: Avoid issuing collab token to API clients

* Address feedback
2026-08-07 08:44:20 -04:00
Tom Moor eb07bfebec fix: documents.import writes into an unauthorized collection when nested (#13331)
* fix: documents.import writes into an unauthorized collection when a parentDocumentId is also given

* test: assert imported child resolves to the parent's collection
2026-08-07 12:30:34 +00:00
Tom MoorandClaude Opus 5 046526839c fix: Guests can enumerate users and groups through mention suggestions (#13330)
suggestions.mention queried User and Group scoped only by team, while
users.list and groups.list both authorize against listUsers/listGroups,
which exclude guests. presentUser withheld the email, but membership in
the result set was unconditional and the query matched on email, so a
guest could enumerate the workspace and probe for addresses.

Gate both reads on the same policies. Documents and collections already
scope to the actor, so guests keep those suggestions.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 08:08:15 -04:00
Tom MoorandClaude Opus 5 34383b1690 fix: Duplicate team subdomain surfaced as a 500 error (#13329)
* fix: Friendly error and retry for duplicate team subdomains

Picking a subdomain already in use in settings surfaced the raw unique
constraint violation as a 500, and concurrent signups could race between
the availability check and the insert.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test: Use setCloudHosted helper rather than spying on env

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: Move retryOnUniqueConstraintError to storage/database

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 08:03:56 -04:00
Tom Moor 10aa8e1f10 fix: Unpin button displayed when user lacks permission to delete pin (#13324)
* fix: Unpin button shown when user lacks permission to delete pin

* fix: Use document policy for pins within a collection
2026-08-07 02:15:06 +00:00
Tom MoorandClaude Opus 5 59ea433420 Add Invited by and Joined columns to the users table (#13325)
* Add Invited by and Joined columns to users table

* Move responsive column hiding into column definitions

Adds a hideOnMobile flag to the table column type, handled in the Table
component, replacing per-column isMobile ternaries in the users table.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-06 22:11:41 -04:00
Tom Moor 355d15ad4f chore: Requests bearing API+OAuth tokens should not fall through to default limiter (#13328) 2026-08-06 22:10:40 -04:00
Tom MoorandClaude Opus 5 2dfda3cd8d feat: Choose which columns are visible in settings tables (#13326)
Tables that pass an id now offer column visibility options, both from a
context menu on the header row and from a button at its end, mirroring
the way Finder handles column headers. Preferences are persisted locally
per table and at least one data column must remain visible.

Also centralizes the avatar and name pairing that several tables render
for "Created by" style columns into UserLabel, which shows the profile
hover card for the name as well as the avatar.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-06 22:02:33 -04:00
Tom MoorandClaude Opus 5 171a13bea2 fix: Comments sidebar opens when a read-only document has a draft comment (#13319)
Comment mark diffing runs both from the editor change handler and from a
rescan on ref attach. The rescan passes no change event, which the focus
check treated as a local change, so a draft comment mark discovered on
load stole focus and opened the comments sidebar.

This is only reachable in read-only mode, where the initial sync of the
document content does not fire a change event at all and the mark is
first seen by the rescan. Require an actual non-remote change event
before focusing.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 21:35:17 -04:00
Tom MoorandClaude Opus 5 6f8072eb68 fix: Avoid duplicate key errors when re-creating attachments by id (#13317)
Import tasks pass a known id to attachmentCreator so a retry can resume,
relying on a caught UniqueConstraintError to skip attachments that already
landed. The file was uploaded to storage before the insert though, so every
skipped attachment was re-uploaded in full and then orphaned, as the storage
key was derived from a fresh uuid rather than the supplied id.

Return the existing attachment before touching storage when the id is already
in use, and derive the key from the supplied id so a collision overwrites the
same object instead of leaking a new one. The lookup is scoped to the team, so
an id belonging elsewhere still falls through to the insert and collides there
as before.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 21:08:24 -04:00
Tom Moor 11ef69e381 fix: Unhandled rejection when a Redlock lock release fails (#13316)
* fix: Unhandled rejection when a Redlock release fails

Releasing a lock is best-effort, a lock that has already expired or been
taken over by another process cannot be released and that is not an error
for the caller. Previously the ExecutionError thrown from release replaced
the successful return value of CacheHelper.populate.

Also catch failures when joining rooms after websocket authentication,
which was a floating promise and so crashed the process.

* fix: Coerce caught values to Error before logging
2026-08-06 00:52:26 +00:00
Tom MoorandClaude Opus 5 2bf160ec39 perf: Avoid N+1 queries when deleting a document subtree (#13311)
Deleting a document walked its subtree with one query per document and
destroyed each in a serial post-order recursion, so large subtrees could
exceed the request statement_timeout.

Resolve the subtree with the existing recursive CTE helper and load the
children in a single query instead. Documents are still destroyed one at
a time so model hooks run for each, and deepest-first ordering is kept.

The subtree lookup also dropped the options it was passed, so it ran
outside the request transaction.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 20:44:29 -04:00
Tom Moor 90b5c4aa63 perf: Take document row lock after text processing (#13315)
Attachment replacement can perform S3 uploads, which was previously done
while holding the document's row lock for the duration of the request.
2026-08-05 20:44:21 -04:00
Tom Moor 9c3bff9b7a perf: Use FOR NO KEY UPDATE for collection structure locks (#13314)
FOR UPDATE conflicts with the FOR KEY SHARE lock Postgres takes on a
parent row when checking a foreign key, so every insert referencing a
collection blocked behind unrelated document structure updates in it.
FOR NO KEY UPDATE still self-conflicts, keeping structure writers
mutually excluded, without blocking child row inserts.
2026-08-05 20:30:34 -04:00
Tom Moor 81d9bed9ba feat: Attribute revisions to the auth type they were made with (#13312)
Adds a sourceMetadata JSON column to revisions, populated with the
authentication type of the request that produced the edit, so the
document history sidebar can show "Tom edited via MCP"
2026-08-05 20:07:03 -04:00
Translate-O-Tron 61e9f74fce New Crowdin updates (#13232)
* fix: New Ukrainian translations

* fix: New Chinese Simplified translations

* fix: New Chinese Traditional translations

* fix: New Vietnamese translations

* fix: New Portuguese, Brazilian translations

* fix: New Indonesian translations

* fix: New Persian translations

* fix: New Thai translations

* fix: New English, United Kingdom translations

* fix: New Norwegian Bokmal translations

* fix: New French translations

* fix: New Spanish translations

* fix: New Catalan translations

* fix: New Czech translations

* fix: New Danish translations

* fix: New German translations

* fix: New Hebrew translations

* fix: New Hungarian translations

* fix: New Italian translations

* fix: New Japanese translations

* fix: New Korean translations

* fix: New Dutch translations

* fix: New Polish translations

* fix: New Portuguese translations

* fix: New Swedish translations

* fix: New Turkish translations

* fix: New Ukrainian translations

* fix: New Chinese Simplified translations

* fix: New Chinese Traditional translations

* fix: New Vietnamese translations

* fix: New Portuguese, Brazilian translations

* fix: New Indonesian translations

* fix: New Persian translations

* fix: New Thai translations

* fix: New Norwegian Bokmal translations

* fix: New French translations

* fix: New Spanish translations

* fix: New Catalan translations

* fix: New Czech translations

* fix: New Danish translations

* fix: New German translations

* fix: New Hebrew translations

* fix: New Hungarian translations

* fix: New Italian translations

* fix: New Japanese translations

* fix: New Korean translations

* fix: New Dutch translations

* fix: New Polish translations

* fix: New Portuguese translations

* fix: New Swedish translations

* fix: New Turkish translations

* fix: New Ukrainian translations

* fix: New Chinese Simplified translations

* fix: New Chinese Traditional translations

* fix: New Vietnamese translations

* fix: New Portuguese, Brazilian translations

* fix: New Indonesian translations

* fix: New Persian translations

* fix: New Thai translations

* fix: New English, United Kingdom translations

* fix: New Norwegian Bokmal translations

* fix: New French translations

* fix: New Spanish translations

* fix: New Catalan translations

* fix: New Czech translations

* fix: New Danish translations

* fix: New German translations

* fix: New Hebrew translations

* fix: New Hungarian translations

* fix: New Italian translations

* fix: New Japanese translations

* fix: New Korean translations

* fix: New Dutch translations

* fix: New Polish translations

* fix: New Portuguese translations

* fix: New Swedish translations

* fix: New Turkish translations

* fix: New Ukrainian translations

* fix: New Chinese Simplified translations

* fix: New Chinese Traditional translations

* fix: New Vietnamese translations

* fix: New Portuguese, Brazilian translations

* fix: New Indonesian translations

* fix: New Persian translations

* fix: New Thai translations

* fix: New English, United Kingdom translations

* fix: New Norwegian Bokmal translations

* fix: New French translations

* fix: New Spanish translations

* fix: New German translations

* fix: New Hebrew translations

* fix: New Hungarian translations

* fix: New Italian translations

* fix: New Japanese translations

* fix: New Korean translations

* fix: New Polish translations

* fix: New Portuguese translations

* fix: New Swedish translations

* fix: New Turkish translations

* fix: New Ukrainian translations

* fix: New Vietnamese translations

* fix: New Portuguese, Brazilian translations

* fix: New Thai translations

* fix: New Spanish translations

* fix: New Catalan translations

* fix: New Czech translations

* fix: New Danish translations

* fix: New German translations

* fix: New Hebrew translations

* fix: New Hungarian translations

* fix: New Italian translations

* fix: New Japanese translations

* fix: New Korean translations

* fix: New Dutch translations

* fix: New Polish translations

* fix: New Portuguese translations

* fix: New Swedish translations

* fix: New Turkish translations

* fix: New Ukrainian translations

* fix: New Chinese Simplified translations

* fix: New Chinese Traditional translations

* fix: New Vietnamese translations

* fix: New Portuguese, Brazilian translations

* fix: New Indonesian translations

* fix: New Persian translations

* fix: New Thai translations

* fix: New English, United Kingdom translations

* fix: New Norwegian Bokmal translations

* fix: New French translations

* fix: New Spanish translations

* fix: New Czech translations

* fix: New Danish translations

* fix: New German translations

* fix: New Hebrew translations

* fix: New Hungarian translations

* fix: New Italian translations

* fix: New Japanese translations

* fix: New Korean translations

* fix: New Polish translations

* fix: New Portuguese translations

* fix: New Swedish translations

* fix: New Turkish translations

* fix: New Ukrainian translations

* fix: New Vietnamese translations

* fix: New Portuguese, Brazilian translations

* fix: New Thai translations

* fix: New Korean translations

* fix: New Spanish translations

* fix: New Catalan translations

* fix: New Czech translations

* fix: New Danish translations

* fix: New German translations

* fix: New Hebrew translations

* fix: New Hungarian translations

* fix: New Italian translations

* fix: New Japanese translations

* fix: New Korean translations

* fix: New Dutch translations

* fix: New Polish translations

* fix: New Portuguese translations

* fix: New Swedish translations

* fix: New Turkish translations

* fix: New Ukrainian translations

* fix: New Chinese Simplified translations

* fix: New Chinese Traditional translations

* fix: New Vietnamese translations

* fix: New Portuguese, Brazilian translations

* fix: New Indonesian translations

* fix: New Persian translations

* fix: New Thai translations

* fix: New English, United Kingdom translations

* fix: New Norwegian Bokmal translations

* fix: New French translations

* fix: New Spanish translations

* fix: New Catalan translations

* fix: New Czech translations

* fix: New Danish translations

* fix: New German translations

* fix: New Hebrew translations

* fix: New Hungarian translations

* fix: New Italian translations

* fix: New Japanese translations

* fix: New Korean translations

* fix: New Dutch translations

* fix: New Polish translations

* fix: New Portuguese translations

* fix: New Swedish translations

* fix: New Turkish translations

* fix: New Ukrainian translations

* fix: New Chinese Simplified translations

* fix: New Chinese Traditional translations

* fix: New Vietnamese translations

* fix: New Portuguese, Brazilian translations

* fix: New Indonesian translations

* fix: New Persian translations

* fix: New Thai translations

* fix: New English, United Kingdom translations

* fix: New Norwegian Bokmal translations

* fix: New French translations

* fix: New Spanish translations

* fix: New Catalan translations

* fix: New Czech translations

* fix: New Danish translations

* fix: New German translations

* fix: New Hebrew translations

* fix: New Hungarian translations

* fix: New Italian translations

* fix: New Japanese translations

* fix: New Korean translations

* fix: New Dutch translations

* fix: New Polish translations

* fix: New Portuguese translations

* fix: New Swedish translations

* fix: New Turkish translations

* fix: New Ukrainian translations

* fix: New Chinese Simplified translations

* fix: New Chinese Traditional translations

* fix: New Vietnamese translations

* fix: New Portuguese, Brazilian translations

* fix: New Indonesian translations

* fix: New Persian translations

* fix: New Thai translations

* fix: New English, United Kingdom translations

* fix: New Norwegian Bokmal translations

* fix: New French translations

* fix: New Spanish translations

* fix: New Catalan translations

* fix: New Czech translations

* fix: New Danish translations

* fix: New German translations

* fix: New Hebrew translations

* fix: New Hungarian translations

* fix: New Italian translations

* fix: New Japanese translations

* fix: New Korean translations

* fix: New Dutch translations

* fix: New Polish translations

* fix: New Portuguese translations

* fix: New Swedish translations

* fix: New Turkish translations

* fix: New Ukrainian translations

* fix: New Chinese Simplified translations

* fix: New Chinese Traditional translations

* fix: New Vietnamese translations

* fix: New Portuguese, Brazilian translations

* fix: New Indonesian translations

* fix: New Persian translations

* fix: New Thai translations

* fix: New Norwegian Bokmal translations

* fix: New French translations
2026-08-05 19:08:53 -04:00
Tom Moor fed1d4c869 Speed up creating a new document (#13310)
* perf: Preload editor chunks when creating a new document

The document scene, multiplayer editor, and editor itself each sit behind
a separate lazy boundary, so their chunks were downloaded one after the
other and only once the create request had resolved. Start them in
parallel on intent instead.

* perf: Don't wait for collaborative sync to edit an empty document

A newly created document has no cached content, so the read-only cache
editor shown while syncing renders identically to the live one – yet the
editable document stayed hidden until the websocket had connected,
authenticated and loaded. Only show the cache when there is content.

* fix: Right sidebar flashing open when a document loads

A history panel left in the persisted UI state is cleared in an effect,
by which point the sidebar has already rendered open for a frame and has
to animate away again. Derive the open state from the panel that will
actually be displayed instead.
2026-08-05 19:08:21 -04:00
Tom Moor a30aef7129 perf: Avoid fetching relationships for newly created documents (#13308)
* perf: Avoid fetching relationships for documents we literally just created

* fix: Editor remount on title change
2026-08-05 19:08:06 -04:00
Tom MoorandClaude Opus 5 5a6182c0dc fix: Table cell background pasted as a text highlight (#13307)
* fix: Table cell background pasted as text highlight

A background color styled on a table cell by an external application was
dropped, while the matching background on the span inside the cell became a
highlight on the text – rendered yellow, as the color did not match a preset.

Cell backgrounds are now read from pasted HTML onto the cell, and only a
background that matches a highlight preset creates a highlight mark.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: Skip unpainted ancestors when comparing backgrounds

An ancestor with a transparent or unparseable background ended the search, so
shading painted higher up – such as on a table cell – was missed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 19:03:45 -04:00
Tom Moor 7faaf55cc7 perf: keep Policy.flattenedAbilities alive (#13309)
Most callers of policies.abilities() are non-reactive (drag-and-drop
canDrop callbacks, action visible() predicates), so the computed had no
observers and recomputed on every read. keepAlive restores caching and
referential stability, and silences the computedRequiresReaction warning.
2026-08-05 19:03:40 -04:00
Tom MoorandClaude Opus 5 b032f1f819 feat: PDF import support (#13302)
* feat: Import PDF documents

Adds a PdfConverter that parses PDF files to markdown with pdf-inspector,
recovering headings, lists and tables from the layout of the text on the
page. A PDF with no embedded text is rejected, as reading it would need OCR.

Markdown has no syntax for underline, so the parser writes underlined text
as an HTML <u> element. Inline HTML is not enabled when the markdown is read
back, so the tags are rewritten to the underline syntax the editor knows.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Accept PDF files in the import dialog, and give it a two column layout

The supported formats move alongside the drop target rather than below it,
so the dialog reads in one glance. Their badge icons are dropped with the
grid they were laid out in, leaving FileFormatIcon unused.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* feedback

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 18:36:40 -04:00
okxint f3d3eda388 fix(editor): re-measure code block toolbar when block resizes (#13299) 2026-08-05 12:37:29 -04:00
Tom MoorandClaude Fable 5 0c2374dec1 perf: Index-friendly popularity score scan, spread runs over an hour (#13306)
* perf: Index-friendly candidate scan in popularity score task

The chunked scan that populates the working table combined "has a non-zero
score" and "has recent insights" into a single OR, which forced a scan of
every document in the partition with a correlated subquery per row. In
production this reached a p95 of 16.9s per chunk on the read replica, which
also serves user reads.

Query each source separately so both can use an index, then union. Limiting
each branch and then the union still yields the globally lowest ids, so keyset
pagination is unchanged. Validity is now a join rather than a predicate, with
the cursor tracked over candidates so filtered rows can't end the walk early.

Adds a partial index on documents(id) where the score is non-zero; the full
index on popularityScore was dropped as unused in 20251217161051 and would not
help this access pattern.

* perf: Drop per-batch COUNT(*) from popularity score task

Every batch issued a COUNT(*) over the working table purely to decide whether
to continue, doubling the round-trips for a loop that already runs thousands of
iterations. processBatch already reports how many rows it handled, so a short
batch is sufficient to detect a drained table.

setupWorkingTable now returns the row count it inserted, which removes the
remaining call site.

* perf: Spread popularity scoring across teams over six hours

The task partitioned by document id over a 30 minute window, which the cron
route expands to one partition per minute. Thirty partitions each took minutes
to run, so they piled up and saturated the database for the whole window.

Partition by team over six hours instead: 360 slices, one starting each minute,
each covering a fraction of the team space. Peak concurrency is bounded by how
long a slice takes rather than by the number of partitions.

Spreading past the hour breaks the interval gate, which read the wall clock at
execution time and so would skip every partition that ran in a later hour --
and worse, would let the next hour's cron schedule a second full run. Cron now
records when a run was scheduled and the gate reads that instead.

The partial index added for the score walk leads with teamId to match the new
access pattern; it is not deployed yet, so it is amended in place.

* perf: Re-key popularity partitions to document id, reduce spread to one hour

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: Compute scheduledAt once per cron run

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-05 07:12:11 -04:00
Tom Moor bc2c9ffd65 Tighten header, remove keyboard shortcuts floating button (#13304)
* Tighten header, remove keyboard shortcuts floating button

* fix: Standardize heading height const
2026-08-04 23:12:39 -04:00
Tom Moor d18783c43f feat: Remember last viewed tab on home (#13303) 2026-08-04 21:44:38 -04:00
Tom MoorandClaude Opus 5 58e62c9a42 fix: Statement timeouts reported as 404 (#13300)
* fix: Statement timeouts reported as 404

A Postgres statement_timeout was set to exactly REQUEST_TIMEOUT, so the
socket was destroyed by the server timeout at the same moment the query
was canceled. The error handler could no longer write a response, leaving
Koa's placeholder 404 status for logging and tracing to report, while the
client saw a reset connection.

The statement timeout is now set below the request timeout so the response
can be delivered, canceled queries return a 503, and the status code is
corrected even when the response can no longer be written.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: Statement timeout floor could exceed the request timeout

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 21:43:27 -04:00
Tom MoorandClaude 50a92db4b8 fix: Reduce peak memory duplicating large document trees, stabilize useActionContext identity (#13298)
* fix: Reduce peak memory when duplicating large document trees, stabilize useActionContext identity

Two regressions found via automated review of PRs merged in the last 24
hours:

- documentDuplicator (#13270) now assigns ids across a whole document tree
  before writing any duplicates, but the planning pass eagerly loaded every
  descendant's full content, holding the entire tree's content in memory at
  once for large trees. Content is now fetched lazily, immediately before
  each document is written, bounding peak memory to roughly one document at
  a time. Fixes #13296.

- useActionContext returned a freshly spread object on every render when
  overrides were passed, which DropdownMenu's new isEmpty check (#13292)
  depends on — this broke memoization and caused every action's visible()
  callback to be re-resolved on every render of every DropdownMenu on the
  page, even while closed. The hook now returns a referentially stable
  object as long as its shallow contents haven't changed. Fixes #13297.

* fix: Correct shallowEqual false positive for differing key sets

shallowEqual only iterated a's keys and never checked they existed on b,
so objects with entirely different keys (e.g. {a: undefined} vs
{b: undefined}) could compare equal whenever the mismatched key
happened to read back the same value on both sides. Also adds the
suggested a === b fast path.

Addresses Copilot review comments on #13298.

* refactor: Simplify content-loaded check, use es-toolkit's isEqualWith for shallowEqual

- Drop the hasContent field/plumbing through DuplicateItem and buildItem;
  check dataValues.content directly instead (direct property access throws
  under sequelize-strict-attributes when the column was excluded from the
  query, so the check has to read dataValues, which bypasses the guard).
- Replace the hand-rolled shallowEqual with a one-level-deep comparison
  built on es-toolkit/compat's isEqualWith, already used elsewhere in the
  app, instead of maintaining bespoke key-set comparison logic.
- Trim comments per review feedback.

Addresses review comments from tommoor on #13298.

* refactor: Inline isEqualWith directly in useStableValue

Drop the standalone shallowEqual wrapper and its dedicated test file;
useStableValue now calls es-toolkit/compat's isEqualWith directly.

Addresses review feedback from tommoor on #13298.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-04 08:58:20 -04:00
Tom Moor a895abc916 Multi-select in the users, groups and group members settings tables (#13295)
* feat: Multi-select in the users settings table

Adds multi-selection to the base settings table — a table opts in by
supplying `isRowSelectable` and a `selectionToolbar`, reusing the model
selection and toolbar infrastructure built for document lists.

User actions are updated to the context based format so the same
definitions drive the row menu and the bulk toolbar.

* feat: Multi-select in the groups settings table

Group deletion now operates on every active group so it can be performed
from the bulk selection toolbar as well as the row menu.

* feat: Multi-select in the group members settings table

Group member removal and permission changes now operate on every active
user, so they can be performed from the bulk selection toolbar as well as
the row menu.

* fix: Table selection styling feedback

Lighten the selected row tint and drop the opaque background from the
sticky actions cell so the row shows through. The selection checkbox is
positioned absolutely so it centers in the row without influencing the
cell's inline layout.

* fix: Bleed the selected table row highlight past the table edges

The highlight is drawn on a pseudo element behind the cells so it can
extend 8px either side of the table and be rounded.

* fix: Join the highlight of adjacent selected table rows

Square off the corners between neighbouring selected rows so a run of
them reads as one rounded block.

* tweaks

* Add new icons, styling tweaks

* fix: Make the base key of new count strings singular

i18next resolves the base key for count=1, which happens on a partial
batch success, so the singular form belongs there and the plural in the
_plural value.
2026-08-04 08:24:23 -04:00