Commit Graph
10329 Commits
Author SHA1 Message Date
Tom Moor 14f612fbcf Merge remote-tracking branch 'origin/main' into tommoor/draft-document-ordering
# Conflicts:
#	server/models/Collection.ts
2026-08-27 17:29:34 -04:00
Tom Moor 9dc74f4459 fix: Insert files dropped around the document at the nearest editor position (#13575)
Dropping a file in the margins around a document previously did nothing.
react-dnd's window level dragover handler forced dropEffect to "none" for
any target outside of .ProseMirror, so the browser never dispatched a drop
event there.
2026-08-27 17:11:56 -04:00
Tom Moor ace35aaa7d fix: Sidebar context lost when navigating from action menus (#13566)
Resolve the sidebar context from location state when no provider supplies
one, and preserve it when leaving or deleting a revision from history.
2026-08-27 16:10:13 -04:00
Tom Moor 46cfa0c8d0 fix: Keep OIDC provider identifier in sync with configured domain (#13574) 2026-08-27 16:09:55 -04:00
Tom MoorandClaude Opus 5 d2697d354e fix: Respect heading number preference in HTML export (#13563)
Heading numbers are drawn by a ProseMirror decoration, and the server
strips all plugin decorations before it serializes, so exported HTML
always came out unnumbered.

Compute the same labels during export and write them to the rendered
headings as a data attribute, which the exported editor styles already
render. A revision takes the preference from the document it belongs to.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 15:27:02 -04:00
Tom Moor 4cb691c658 chore: Reduce cardinality of datadog metrics (#13565)
* chore: Reduce cardinality of datadog metrics

* address feedback
2026-08-27 15:07:50 -04:00
Tom Moor aab83e8378 fix: Reliability of count-based limit checks (#13542)
* fix: Make count-based limit checks reliable under concurrency

Limits enforced by counting rows before an insert could be exceeded by
requests that ran at the same time, as each one read the same count
before any of them had written. Add a LockHelper that takes a Postgres
advisory lock for the remainder of the transaction, and use it to
serialize the check for webhook subscriptions, team domains, share
subscriptions and pins. The counts now also run on the transaction so
they include rows written earlier in the same request.

* Remove excessive tests

* Also guard simultaneous row removal
2026-08-24 19:14:55 -04:00
Tom Moor ccbe2fa99b fix: Enforce import restrictions shadowed by nested oxlint configs (#13558)
Nested .oxlintrc.json files replace the root config per-rule rather than
merging, so the root's shared/** override for no-restricted-imports was
dead config and the sonner restriction was not enforced anywhere.

Move the restrictions into shared/.oxlintrc.json, add the
prosemirror-tables entry to app/.oxlintrc.json where the same shadowing
applies to .tsx files, and drop the dead root override.
2026-08-24 23:02:31 +00:00
Tom Moor f1ebc1edb0 fix: Refactor useCollectionTrees hook (#13555)
* fix: Refactor useCollectionTrees hook

* Avoid unneccessary work
2026-08-24 18:31:34 -04:00
dependabot[bot] 10ee32db40 chore(deps): bump the aws group with 5 updates (#13543)
Bumps the aws group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-s3) | `3.1111.0` | `3.1115.0` |
| [@aws-sdk/lib-storage](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/lib/lib-storage) | `3.1111.0` | `3.1115.0` |
| [@aws-sdk/s3-presigned-post](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages/s3-presigned-post) | `3.1111.0` | `3.1115.0` |
| [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages/s3-request-presigner) | `3.1111.0` | `3.1115.0` |
| [@aws-sdk/signature-v4-crt](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages/signature-v4-crt) | `3.1111.0` | `3.1115.0` |


Updates `@aws-sdk/client-s3` from 3.1111.0 to 3.1115.0
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.1115.0/clients/client-s3)

Updates `@aws-sdk/lib-storage` from 3.1111.0 to 3.1115.0
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/lib/lib-storage/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.1115.0/lib/lib-storage)

Updates `@aws-sdk/s3-presigned-post` from 3.1111.0 to 3.1115.0
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/s3-presigned-post/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.1115.0/packages/s3-presigned-post)

Updates `@aws-sdk/s3-request-presigner` from 3.1111.0 to 3.1115.0
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/s3-request-presigner/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.1115.0/packages/s3-request-presigner)

Updates `@aws-sdk/signature-v4-crt` from 3.1111.0 to 3.1115.0
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/signature-v4-crt/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.1115.0/packages/signature-v4-crt)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-s3"
  dependency-version: 3.1115.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: aws
- dependency-name: "@aws-sdk/lib-storage"
  dependency-version: 3.1115.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: aws
- dependency-name: "@aws-sdk/s3-presigned-post"
  dependency-version: 3.1115.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: aws
- dependency-name: "@aws-sdk/s3-request-presigner"
  dependency-version: 3.1115.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: aws
- dependency-name: "@aws-sdk/signature-v4-crt"
  dependency-version: 3.1115.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: aws
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-24 17:46:54 -04:00
dependabot[bot] c8f091b83e chore(deps): bump prosemirror-dropcursor from 1.8.2 to 1.8.3 (#13544)
Bumps [prosemirror-dropcursor](https://github.com/prosemirror/prosemirror-dropcursor) from 1.8.2 to 1.8.3.
- [Changelog](https://github.com/ProseMirror/prosemirror-dropcursor/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prosemirror/prosemirror-dropcursor/commits)

---
updated-dependencies:
- dependency-name: prosemirror-dropcursor
  dependency-version: 1.8.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-24 17:24:25 -04:00
dependabot[bot] dd2c224963 chore(deps): bump react-hook-form from 7.76.0 to 7.85.0 (#13545)
Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.76.0 to 7.85.0.
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.76.0...v7.85.0)

---
updated-dependencies:
- dependency-name: react-hook-form
  dependency-version: 7.85.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-24 17:23:41 -04:00
dependabot[bot] 2a5571adbc chore(deps): bump dd-trace from 5.117.0 to 5.123.0 (#13546)
Bumps [dd-trace](https://github.com/DataDog/dd-trace-js) from 5.117.0 to 5.123.0.
- [Release notes](https://github.com/DataDog/dd-trace-js/releases)
- [Commits](https://github.com/DataDog/dd-trace-js/compare/v5.117.0...v5.123.0)

---
updated-dependencies:
- dependency-name: dd-trace
  dependency-version: 5.123.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-24 17:23:30 -04:00
dependabot[bot] 0132f0dcb8 chore(deps): bump @octokit/auth-app from 8.2.0 to 8.3.0 (#13547)
Bumps [@octokit/auth-app](https://github.com/octokit/auth-app.js) from 8.2.0 to 8.3.0.
- [Release notes](https://github.com/octokit/auth-app.js/releases)
- [Commits](https://github.com/octokit/auth-app.js/compare/v8.2.0...v8.3.0)

---
updated-dependencies:
- dependency-name: "@octokit/auth-app"
  dependency-version: 8.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-24 17:23:20 -04:00
Tom MoorandClaude Opus 5 e141280d41 fix: Stop reporting expected IndexedDB connection closures (#13552)
The browser closes IndexedDB connections at times the page does not
control – a frozen or discarded tab, a navigation away, or another tab
deleting the database at logout. Persisted store data is a cache that
API traffic always overrides, so these failures have no effect for the
user, but each one was reported to Sentry as a warning.

- Log connection closed failures at debug level instead of reporting them
- Delete the database in clear() rather than emptying it through a
  transaction, which cannot fail against a closed connection
- Keep persistence enabled when hydration fails on a closed connection,
  rather than disabling it for the rest of the session

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 17:11:13 -04:00
Tom Moor 09b043c656 chore: Upgrade mermaid to 11.17.1 (#13553)
* chore: Upgrade mermaid to 11.17.1

Also bumps @mermaid-js/layout-elk to 0.2.3, which is the matching release,
and dedupes katex — mermaid now requires ^0.16.47 where the project pinned
^0.16.45, which would otherwise ship two copies.

Note that classDiagram now uses the unified (v2) renderer by default.

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

* fix: Hold @mermaid-js/layout-elk at 0.2.2

0.2.3 inlines its own copy of mermaid instead of importing the peer, which
duplicates every diagram chunk and adds 3.4MB to the built bundle. Pinned
exactly so the range cannot drift back onto it.
2026-08-24 17:09:25 -04:00
Tom Moor c807ae825b fix: Hash and location state lost by useConsumeQueryParam (#13551) 2026-08-24 16:59:59 -04:00
Tom Moor 5118b67b98 fix: Properly bind and unbind listeners in useHover (#13550) 2026-08-24 16:59:54 -04:00
Tom Moor 237c3c2e2d fix: Ignore small movements on useSwipe hook (#13549) 2026-08-24 16:59:50 -04:00
Tom MoorandClaude Opus 5 83dfea1953 fix: Round reading time up to the next minute (#13548)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 16:59:36 -04:00
Tom Moor 5956f20713 fix: Return 404 for unhandled paths under the MCP endpoint (#13541)
Unknown paths below /mcp, and the origin-level /sse probe, fell through to
the catch-all and rendered the application shell with a 200. Remote MCP
clients that probe for the legacy HTTP+SSE transport before falling back to
streamable HTTP read that as a successful handshake, then fail to connect.
2026-08-23 21:20:52 -04:00
Tom MoorandClaude Opus 5 72aa0f0063 fix: Remove associated notifications when access is lost (#13208)
* review

* Revoke notifications when a document is moved

Moving a document into a collection the recipient cannot read leaves a
notification holding the title and text, so schedule a revocation check
for each recipient of the moved document and its descendants.

Also adds coverage proving drafts are revoked through the document path,
and notes why the scoped query includes them.

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 21:10:44 -04:00
Tom MoorandClaude Opus 5 c34540e047 Add collection metadata line (#13538)
* feat: Metadata below collection title

Extracts the shared meta line styles from DocumentMeta into a reusable
HeaderMeta component, and adds an equivalent meta line beneath collection
titles showing visibility, public sharing, and document count.

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

* i18n

* fix: Show document count for empty collections

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 17:08:54 -04:00
Tom MoorandClaude Opus 5 84c40c8392 fix: Revision diff mismatching node closing tokens (#13537)
The changeset token encoder cached node type ids in an object created
with a null prototype, but tested for a cache miss with `=== null`. The
miss reads as undefined, so the cache was never filled and every node
end encoded to undefined — making the closing token of any node compare
equal to that of any other.

As a result revision diffs could omit a node's closing token when its
type changed, and attribute an inserted wrapper's closing token to the
node it wraps.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 16:29:21 -04:00
Tom Moor d551ead073 feat: Filter DSL for collections.list (#13442)
* feat: Filter DSL for collections.list

Adds the structured `filters` expression language to collections.list,
matching documents.list and documents.search. Supported fields are name,
createdAt, updatedAt, archivedAt, createdById and permission, each validated
against its column type at the input layer.

Deprecates the ad-hoc `query` and `statusFilter` params, which now translate
into filter leaves so that one code path serves both shapes, and returns a 400
when a caller combines them with `filters`.

Note that `query` matching is no longer accent-insensitive, as the unaccent
comparison is replaced by the shared iLike conversion.

* fix: Make filter expressions assignable to a JSON request body

Filters are sent as a JSON body, but `FilterCondition` and `FilterGroup` were
interfaces, which TypeScript does not give an implicit index signature, and
`FilterValue` admitted a `Date` that JSON cannot carry. Both stores worked
around this by asserting the request body to JSONObject, which suppressed
checking of every other field as well.

Declare the two shapes as type aliases and drop `Date` from the value union so
a filter type-checks against the request body directly, and remove the
assertions from the collection and document stores.

* feat: Restrict filter fields to a set of accepted values

Add an optional `values` set to a filter field definition, checked against
scalar and array values at the input layer so that an unsupported value returns
a 400 rather than an empty result or, for a field backed by a Postgres enum, a
database error. A field with a fixed value set is matched exactly, so pattern
operators are rejected for it in the same way as for non-text columns.

Apply it to `permission` on collections.list.

* refactor: Build the list_collections name filter with the filter DSL

The MCP tool carried its own copy of the unaccent name comparison that
collections.list used before it moved to the DSL. Build the clause with
buildWhere instead, so both paths match names the same way, and drop the
replacements plumbing it needed.
2026-08-23 16:03:10 -04:00
Tom Moor 9a0a4eff2d fix: Mobile tap behavior (#13536) 2026-08-23 13:11:06 -04:00
Tom Moor b5118fd4f2 Refactor multiplayer facade to spec (#13534) 2026-08-23 13:07:20 -04:00
Tom MoorandClaude Opus 5 f6ad3cb6e1 Improvements to mobile formatting toolbar (#13533)
* fix: Selection toolbar not displaying on mobile

The mobile branch of FloatingToolbar rendered nothing until `position.visible`
was true, but `usePosition` only reports a visible position once the menu
element has been measured through `menuRef`. On desktop the wrapper is always
mounted (it animates in via opacity) so the ref is populated on first render,
while on mobile the toolbar is the only thing that mounts the ref — leaving it
permanently null and the bar never displayed.

Gate the mobile bar on there being toolbar content instead. Position is
irrelevant on mobile: the bar is fixed to the bottom of the viewport and its
vertical offset is owned by useKeyboardStickyOffset.

Also size the bar with border-box and center its content vertically, so the
declared 60px is the height of the bar rather than 60px of content plus
padding with the buttons pinned to the top.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GhGyxA663bMFZ1NxBhLAoF

* fix: Keep the mobile selection toolbar visible while editing

On mobile the toolbar is a bar docked above the on-screen keyboard rather than
a floating menu anchored to the selection, but it was only rendered while
something was selected — so it appeared and vanished as the selection came and
went while typing.

The formatting menu was already written for this: `canFormatBlock` shows
headings, quotes, toggles and list indent/outdent precisely when the selection
is empty on mobile, mirroring `canFormatInline` for selected text. That branch
was unreachable, as an empty selection always resolved the toolbar to nothing.

Show the menu whenever the editor is focused on mobile, so the bar carries
block formatting for a bare cursor and swaps to inline formatting on selection.
Visibility is derived at render rather than folded into `activeToolbar` so that
focus moving into the link editor's input cannot tear down a toolbar the user
opened. Focus is threaded to widgets through WidgetProps.

Tapping the bar now also prevents the default action of mousedown, keeping
focus (and the keyboard) in the editor. Without it a tap would blur the editor
and unmount the bar before the tap became a click; fields inside the bar are
excluded so the link editor still takes focus.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GhGyxA663bMFZ1NxBhLAoF

* fix: Mobile toolbar is not visible

* Update mobile toolbar styling
fix: Does not account for stored marks

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-23 11:20:30 -04:00
Tom MoorandClaude Opus 5 f62fb40604 fix: Search result context cut mid-word by earlier highlights (#13532)
* fix: Search result context cut mid-word by earlier highlights

The snippet indexes were calculated against the plain document text, then used
to slice the highlighted copy. Every highlight before the slice start adds seven
characters, so the snippet began too late and could open inside a bold tag.

Slice first and highlight the slice, so both indexes apply to the same string.

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-23 10:20:58 -04:00
Tom MoorandClaude Opus 5 c8bfd8488d fix: Only show editing stats toggle when viewing a document (#13530)
* fix: Only show editing stats toggle when viewing a document

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

* Default isViewing to false

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 13:54:35 +00:00
Tom Moor e22b423fc3 fix: Hold hover state on DocumentCard when context menu is open (#13529) 2026-08-23 09:53:42 -04:00
Tom MoorandClaude Opus 5 096cfc72c7 fix: Contents highlight lost when scrolling deep headings (#13531)
The contents lists headings up to level four, but tracked the active heading
across every heading in the document. Scrolling into a level five or six
section selected a heading with no entry in the list, so the highlight
disappeared until the next listed heading came into view.

The level filter now runs once, up front, and the active heading tracking,
indentation base, empty check and render all read the same list. Prefix labels
are still computed over every heading so the numbering keeps matching the
document.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 09:50:54 -04:00
Translate-O-Tron 3104639945 New Crowdin updates (#13322)
* fix: New German translations

* fix: New Italian translations

* fix: New Japanese translations

* fix: New Polish translations

* fix: New Swedish translations

* fix: New Turkish translations

* fix: New Ukrainian translations

* fix: New Vietnamese translations

* fix: New Dutch translations

* fix: New Dutch 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 Indonesian translations

* fix: New Persian translations

* fix: New Thai translations

* fix: New Norwegian Bokmal 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

* 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 Polish 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 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 Swedish translations

* fix: New Portuguese translations

* fix: New Ukrainian translations

* fix: New Vietnamese translations

* fix: New Persian 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 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
2026-08-22 22:35:19 -04:00
Tom Moor 46ada3c178 feat: Advertise markdown representation of shared documents (#13527)
Shared links return markdown when the client asks for it, but there was no
way to discover this short of guessing the .md suffix.

- Vary on Accept so shared caches key the two representations correctly
- Send a Link rel="alternate" header, discoverable with a HEAD request
- Emit a matching link tag alongside the canonical in the head
- Apply the same cache directives to markdown as the HTML response
2026-08-22 22:33:03 -04:00
Tom MoorandClaude Opus 5 def3a42752 feat: Record who deleted a document (#13484)
* feat: Record who deleted a document

The trash inferred the deleting user from lastModifiedById, so a nested page
kept whoever last edited it and deleting a document rewrote its edit history.
Add a dedicated deletedById column and set it from the base model.

- Migration adds the column, backfills from lastModifiedById, and validates the
  foreign key without holding an exclusive lock. The backfill runs in batches
  against a temporary index covering only the rows still to write, so it stays
  linear on a large table, and every statement is idempotent because the
  migration cannot run in a transaction.
- ParanoidModel records the acting user on destroy and clears it on restore,
  for any model that has the column. Sequelize soft deletes with the same UPDATE
  that stamps deletedAt, so the value costs no extra query.
- Deleting a document no longer touches lastModifiedById on its descendants.
- Present the deleting user, batched in presentDocuments, and use it for the
  trash notice and the document meta line rather than the last editor.

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

* fix: Do not overwrite an eager loaded deleting user when batching

The batch lookup in presentDocuments skipped documents that already carried the
association, but the assignment loop ran for all of them, so a document that
arrived with deletedBy loaded was reset to null and fell back to a per-document
query. Assign only where the association is missing, and deduplicate the ids so
a page deleted by one person asks for one row rather than one per document.

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 21:49:31 -04:00
Tom Moor 1ca8335717 fix: Recover from closed IndexedDB connections in store persistence (#13523)
* fix: Recover from closed IndexedDB connections in store persistence

StorePersistence cached a single IDBDatabase forever, so once the browser
or another tab closed the connection every subsequent hydrate, flush and
clear threw against a dead handle.

- Close and forget the connection on versionchange, so another tab is
  never blocked from deleting or upgrading the database
- Discard the cached connection on close, open error and blocked, and
  retry once against a fresh connection when one was closed underneath us
- Close open connections before deleteAllDatabases removes them, which
  also stops logout recreating the databases it just deleted

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

* fix: Cancel pending writes when store persistence is disabled

A debounced flush scheduled before disabling would still fire, reopening
and recreating the database that deleteAllDatabases had just removed.
2026-08-22 19:01:39 -04:00
Tom Moor 631c8f82fc Stricter validation of team preferences (#13507)
* fix: Stricter validation of team preferences

* Omit unknown keys in presenters
2026-08-22 18:18:01 -04:00
Tom MoorandClaude 61f8ed9f49 fix: Crash opening document menu on mobile (#13526)
* fix: Crash opening document menu on mobile

The heading numbering submenu added to the document display options is
rendered through the `append` slot of `DropdownMenu`. On desktop that slot
lands inside the menu content, but on mobile it is rendered into a drawer,
which has no menu root for the Radix submenu primitives to attach to — so
opening the document overflow menu on mobile threw "`MenuSub` must be used
within `Menu`" and took down the page.

Flatten the submenu into an inline group of options on mobile, matching the
toggles it sits alongside.

Fixes OUTLINE-CLOUD-D1X

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V5ExrfehTYgotb8d2aoMvK

* fix: Match heading prefix color to the heading anchor

The heading numbering prefix was drawn with the secondary text color while
the `#` anchor beside it uses the primary text color at 75% opacity. The
two read as the same tone in light mode, but diverge visibly in dark mode
where the primary text color is much brighter.

Draw the prefix from the same color and opacity as the anchor so the two
match in both themes.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V5ExrfehTYgotb8d2aoMvK

* fix: Heading prefix missing when printing

The print stylesheet hides the heading pseudo element to keep the H1–H6
level labels out of print. That pseudo element also carries the heading
numbering prefix, so printing or exporting a numbered document dropped its
numbers.

Qualify the print selectors the same way the level labels themselves are,
so only the labels are hidden and the prefix still prints.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V5ExrfehTYgotb8d2aoMvK

* Update Styles.ts
2026-08-22 18:17:02 -04:00
Tom Moor d77dcdf853 fix: Document update rejected when preferences are null (#13525)
The client serializes all @Field properties on save, so documents created
before the preferences column existed post `preferences: null`, which the
update and create schemas rejected.
2026-08-22 15:23:51 +00:00
Tom Moor da13eb5de2 fix: Treat unreadable request stream as a client closed request (#13524)
raw-body throws a 500 'stream is not readable' when the request stream is
already destroyed at parse time, which means the client went away. Map it to
ClientClosedRequestError so it reports 499 and is not sent to the bug tracker.
2026-08-22 15:16:23 +00:00
Tom MoorandClaude Opus 5 41616f73cc feat: Filter DSL for users.list (#13456)
* feat: Filter DSL for users.list

Add the structured filter expression language already used by documents.list
and documents.search to users.list, over an allowlist of id, name, email,
role, createdAt, updatedAt, lastActiveAt and suspendedAt.

Supersedes the ad-hoc ids, emails, role and filter parameters, which are now
deprecated and translated into the DSL so a single path builds the query. The
same translation backs the list_users MCP tool, which held a duplicate copy of
the status handling.

Field specs gain an optional value allowlist, so an unknown role is rejected
at the input layer rather than reaching the enum column. Suspended users
remain invisible to non-admins and excluded by default, unless the expression
references suspendedAt.

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

* refactor: Collapse the duplicate suspended user predicate

The non-admin invariant and the default exclusion pushed the same clause for
non-admins in the default case. Both rules are now one predicate: suspended
users are visible to admins only, and then only on request.

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

* refactor: Drop the legacy parameters from the list_users MCP tool

The MCP surface has no backwards compatibility burden, so it takes the filter
DSL directly instead of the deprecated role and status parameters. This gives
the model date ranges, OR groups and name matching, which the old enum pair
could not express.

The field allowlist moves next to the other user filter helpers so the REST
schema and the tool share one definition rather than the tools directory
reaching into the routes.

Drops the unreachable Date member of FilterValue. Dates cross the wire as ISO
8601 strings, a Date instance fails every field kind, and zod cannot represent
it in the JSON Schema the MCP tool list is built from.

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

* revert: Retain legacy role/filter params in the list_users MCP tool for now

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

* Revert MCP changes

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 10:47:32 -04:00
Tom MoorandClaude Fable 5 662bad7108 Add heading numbering display preference for documents (#13522)
* Add heading numbering display preference for documents

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

* Fix isRemoteTransaction call for new signature on main

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

* Fix inTable detection for headings after a nested table

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

* Move from deco to pseudoclass

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-22 09:44:42 -04:00
Tom Moor fa1b529bef Allow reordering sidebar sections by dragging their headers (#13505)
* wip

* Center reorder cursors between sections, detect empty sections with CSS

* Deduplicate persisted sidebar section order

* fix: Stricter zod type

* Remove DraggableSection unit tests
2026-08-21 21:09:13 -04:00
Tom MoorandClaude Opus 5 7652d26d07 fix: Consistent rate limiter keys across path variants (#13504)
* fix: Normalize path when keying rate limiters

The router matches paths case-insensitively and with an optional trailing
slash, so those variants each received their own quota. Collapse them onto
a single key at both registration and consumption.

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-22 00:59:21 +00:00
Tom MoorandClaude Opus 5 2beacf9d56 fix: Rate limit response headers and first-request accounting (#13506)
* fix: Rate limit response headers and first-request accounting

Retry-After and RateLimit-Reset are both defined as a whole number of
seconds. Retry-After was sent as a fraction and RateLimit-Reset as a full
date string, neither of which a client can act on.

A route limiter is registered by middleware that runs after the point where
quota is consumed, so the first request to reach a path in each process was
never charged against it. Charge it at registration time instead.

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

* test: Cover rate limit headers and first request accounting

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 20:54:57 -04:00
Tom MoorandClaude Fable 5 67b53220ce perf: Limit PWA precache and skip service worker on share views (#13519)
* perf: Cache JS chunks on first use instead of precaching entire build

The service worker precached every JS chunk (~590 files) in the
background for every visitor. Chunks are content-hashed and immutable,
so a CacheFirst runtime route provides the same repeat-visit behavior
while only fetching chunks that are actually used.

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

* perf: Do not register service worker on public share views

Anonymous share visitors gain nothing from the worker or the PWA
cache, shares always require the API. The server now exposes an
isShare flag in window.env and the client skips registration when
it is set.

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 20:54:30 -04:00
Tom Moor 5ee3f1a5d9 perf: Refactor y-prosemirror loading (#13521)
* wip

* perf: Refactor y-prosemirror loading
2026-08-21 20:49:29 -04:00
Tom Moor e88b6ad28c Exclude archived documents from MCP document search by default (#13518) 2026-08-21 19:36:23 -04:00
Tom Moor e60dec32c2 Superellipse corners for menus, dialogs, and floating surfaces (#13520)
* Superellipse corner-shape utility for elevated surfaces

* Rename squircle helper to borderRadius, use block comment in CSS string
2026-08-21 19:36:11 -04:00
Tom MoorandClaude Opus 5 0f8f69de42 Unpin and context menu controls on pinned documents (#13498)
* feat: Unpin and context menu controls on pinned documents

- Adds an unpin control to document chips in the collapsed pinned view
- Adds the collapse toggle to collections, matching home
- Makes the Pin menu items toggles with a selected state
- Adds a document context menu to pinned cards and chips
- Stops the drag sensor swallowing clicks on the card unpin button

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

* fix: Hide the collection pin toggle for a mixed selection

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-19 23:38:09 -04:00