Commit Graph
339 Commits
Author SHA1 Message Date
Tom Moor 0d13c183fd chore: Add lint rules for test conventions (#14318) 2026-10-24 14:09:36 -04:00
Tom Moor 114036bdbf feat: Warn about low contrast theme colors (#14258)
* feat: Warn about low contrast theme colors

* fix: Show contrast warning as visible text linked to the input

* fix: Align color input swatch and enlarge it on mobile
2026-10-23 02:09:50 +00:00
Tom Moor cfa9e09f17 feat: Add MCP tool to show what changed in a document (#14192)
* feat: Add get_document_changes MCP tool to diff document history

* fix: Bound document changes to the loaded snapshot and diff raw markdown

* perf: Replace structuredPatch with an integer ID line diff (#14246)

* fix: Update get_document_changes for MCP SDK v2
2026-10-22 20:43:57 -04:00
Tom Moor 4e807ca6fc perf: Copy only the patched path when recreating transforms (#14250)
* perf: Copy only the patched path when recreating transforms

recreateTransform deep copied the whole document for each patch
operation, and diffArrays compared elements with a generic isEqual. Copy
only the containers on the operation path and compare with a JSON-only
equality check. Revision changesets are about 6x faster.

* Use fast-deep-equal in place of a custom JSON equality check

* Restore isJSONEqual, fast-deep-equal throws on null-prototype attrs
2026-10-22 20:33:22 -04:00
Tom Moor 0995a8e36b perf: Reduce traversals and skip unneeded work in ProsemirrorHelper (#14243)
* perf: Reduce traversals and skip unneeded work in ProsemirrorHelper

* fix: Coerce leaf text to a string when checking for text
2026-10-22 18:33:16 -04:00
Tom Moor a471da36f2 feat: Name desktop app passkeys by platform with matching icon (#14242)
* feat: Name desktop app passkeys by platform with matching icon

* fix: Only apply desktop passkey name to platform authenticators
2026-10-22 18:31:55 -04:00
Tom Moor 6ecdc4a4f4 chore: Vendorize is-printable-key-event and styled-normalize (#14194)
* chore: Vendorize is-printable-key-event and styled-normalize

* chore: Retain MIT notices for vendored normalize CSS
2026-10-21 08:09:56 -04:00
Tom Moor e0db189e53 feat: Run passkey login inside the desktop app (#14180)
* Run passkey login inside the desktop app when supported

Desktop apps that configure a platform authenticator expose
isPasskeySupported on the bridge. When available, the WebAuthn ceremony
runs in the app instead of the system browser. If it fails, the user can
still use a passkey from their browser.

* Name passkeys registered in the desktop app

The Chromium Touch ID authenticator reports the same AAGUID as any
Chromium browser, so passkeys from the desktop app were named
"Chromium Browser".

* Allow more than one passkey from the Chromium authenticator

The Chromium Touch ID authenticator reports the same AAGUID on every
device, so users could not register the desktop app on a second Mac.

* Disable adding passkeys in desktop apps without passkey support
2026-10-20 22:57:37 -04:00
Tom Moor 695e973e6b feat: Allow tables inside notices (#14175)
* feat: Allow tables inside notices

Blend table, rule and code colors onto the notice background, keep table
scroll shadows inside the notice, hide full width for tables in notices,
and fit new table columns to the available width.

* fix: Leave room for table row controls in notices

* fix: Blend table grips onto the notice background

* fix: Derive notice content colors from the softer notice styles
2026-10-20 19:05:10 -04:00
Tom Moor 94276a743c fix: Prevent duplicate heading anchor IDs (#14162)
A heading whose text ends in a number could get the same slug as a
numbered duplicate. Heading slugs now come from one HeadingSlugger that
skips taken IDs, and the server section lookup counts nested headings
like the editor does.
2026-10-20 08:28:54 -04:00
Tom Moor 9d4304a332 chore: Remove unused code (#14133)
* chore: Remove unused code

* Restore DiscordClient
2026-10-18 18:27:05 -04:00
Tom MoorandClaude Opus 5.5 5647621224 chore: Prune redundant comments and type suppressions (#14124)
* chore: Prune redundant comments and normalize lint directives

Removes comments that restate the following line and stale TODOs, drops
the passive event listener feature check now that all supported browsers
support it, and renames eslint directives to oxlint.

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

* fix: Evaluate restricted team domains at validation time

The restricted email provider list was captured when the model loaded, so
it could not follow the hosting environment and the tests that covered it
never reached the model.

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

* chore: Replace type suppressions with accurate types

Adds a Concrete helper type for registries of abstract classes, declares
missing Sequelize and refractor typings, uses public ProseMirror APIs, a
typed mock context helper in middleware tests, and a StaticLink component
for sidebar rows being edited.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 17:07:39 -04:00
Tom Moor be75e8e0a8 fix: Resolve Slab cross-links and import Slab-hosted attachments (#14109)
* fix: Resolve Slab cross-links and import Slab-hosted attachments

Slab exports links between posts as absolute URLs and file attachments as
signed links, so both stayed pointing at Slab after import. Post links are
now matched to imported documents by slug (or by label for id-only mention
links) and Slab-hosted file links become attachments that are re-hosted.

Also fixes concurrent mention transforms assigning different ids to the
same not-yet-imported document.

* fix: Address review feedback on Slab link and file conversion

Prefer exact slug matches and leave ambiguous slugs unresolved, convert
file links in headings, and keep a toggle's leading text block so its
attachments are still converted.
2026-10-16 17:23:13 -04:00
Tom MoorandClaude Opus 5.5 9e2565184e chore: Prune stale comments, TODOs, and type suppressions (#14092)
* chore: Remove unused lint disable directives

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

* chore: Replace TODO type suppressions with typed code

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

* chore: Remove obsolete workaround comments in tests and MediaDimension

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

* chore: Remove Tippy compatibility props from Tooltip

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

* chore: Decouple DropdownMenu props from Tooltip and clarify sharing styles

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

* chore: Remove stale retention TODOs from cleanup tasks

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

* chore: Register relations synchronously and clarify workaround comments

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

* chore: Replace Notion import TODOs with descriptive comments

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-15 08:54:37 -04:00
Tom Moor b4601a61ff feat: Support OAuth Client ID Metadata Documents for MCP clients (#14015)
* feat: Support OAuth Client ID Metadata Documents for MCP clients

MCP clients can send an https URL as their client_id. The server fetches
the metadata document at that URL and caches one team-less client row per
URL, so MCP works on the root domain without dynamic registration.

Closes #14010

* fix: Address review findings for client ID metadata documents

- Only count unexpired tokens when cleaning up metadata document clients
- Reject backslashes, whitespace and trailing host dots in client_id URLs
- Strip trailing dots before installation host comparisons
- Type clientSecret as nullable

* fix: Keep OAuth clients with pending authorization codes during cleanup

* refactor: Simplify client ID metadata document handling

- Gate metadata document fetches on the MCP preference inside the helper
- Add isMCPClient getter and a shared client ID prefix constant
- Enforce the team/metadata document CHECK in both directions
- Index oauthClientId on OAuth token and code tables
- Reuse parseDomain, clamp and time helpers

* revert: Remove pending authorization code check from OAuth client cleanup

* fix: Block all special-use addresses when fetching client metadata documents

ALLOWED_PRIVATE_IP_ADDRESSES no longer applies to client ID metadata
document requests (draft -02 section 8.6). The fetch wrapper takes an
allowIPAddressList option to override the environment list.

* fix: Reject empty userinfo in client metadata document URLs

https://@host and https://:@host have a userinfo component that the URL
parser drops, so check the raw authority (draft -02 section 3).

* fix: Accept a root path in client metadata document URLs

Draft -02 section 3 marks a root path as NOT RECOMMENDED, not invalid, so
https://example.com/ is a valid client_id. A URL with no path is still
rejected.

* fix: Reject client metadata documents with private key material

A jwks key with private or symmetric members (d, p, q, dp, dq, qi, oth,
k) makes the document invalid, so it is not cached (draft -02 section 4.1).
Public keys are still ignored.

* fix: Respect no-cache, no-store and Age for client metadata documents

no-store and no-cache now expire the cached document at once, so it is
fetched again before the next authorization. Freshness from max-age or
Expires (measured from Date) is reduced by Age before clamping (draft -02
section 5.2).

* feat: Copy DCR and CIMD client logos to file storage in the background

logo_uri was rendered directly on the consent screen, which lets the logo
host track users and change the image at any time (draft -02 sections 8.8
and 9.2). A background task now fetches the logo with the strict fetch
rules, accepts only PNG, JPEG, GIF and WebP by their leading bytes, and
stores it content addressed in the public bucket. Requests never wait for
the upload.

* fix: Match loopback redirect URIs on any port

Native apps such as Claude Code register http://localhost/callback and
then listen on a free port, so an exact match rejected them. Loopback
redirect URIs now match on any port (RFC 8252 section 7.3); the scheme,
host and path must still match, and other URIs still match exactly.

* fix: Only break the redirect URL mid-word on the consent screen

break-all on the whole notice split words such as "continue" in the
loopback warning. It now applies only to the redirect URL.

* chore: Shorten the loopback warning on the consent screen

* fix: Show the punycode host of client metadata documents on the consent screen

A lookalike Unicode host was shown as written. Hostnames now come from a
shared getHostname helper that returns the punycode form.

* refactor: Move image type detection to ImageHelper and use it for avatars

Avatars and integration logos copied from a URL are now stored only if
they are PNG, JPEG, GIF or WebP, with the content type detected from the
file data rather than the remote host.

* fix: Address review findings for OAuth client logos and metadata caching

- Count the time since the Date header as age when caching metadata
  documents, so a document is not cached past its Expires time
- Log logo scheduling failures instead of failing registration requests
- Run dynamic client registration in a transaction
- Delete copied logos from storage when no client uses them

* fix: Store one logo per OAuth client and return a distinct metadata document error

- Logos are stored per client, so a file is only deleted when its own
  client stops using it. This removes the reference count and its race.
- A metadata document that cannot be fetched or is invalid now returns
  invalid_client_metadata with the reason, not a 404. Network errors
  are only logged.
- Move scheduleOptional to BaseTask so that any task can use it.
2026-10-12 11:01:55 -04:00
Tom Moor a2ab9ef731 chore: Replace socket.io-redis and crypto-js with maintained packages (#14045) 2026-10-11 19:15:11 -04:00
Tom Moor a004b24e83 chore: Upgrade slug from 5 to 11 (#14038)
* chore: Upgrade slug from 5 to 11

* Require Node 22.12+ for require(esm), test θ transliteration

* Polyfill String isWellFormed and toWellFormed for older browsers
2026-10-11 16:13:48 -04:00
Tom Moor ef6e51401b perf: Reduce main-thread cost of opening a document from the sidebar (#14033)
* perf: Read active models lazily in ActionContextProvider

The root provider read the active document and models during render, so
every navigation rebuilt the context and re-rendered all consumers. These
values are now getters, and overrides are merged without evaluating them.

* perf: Skip urlId scan in Store.get for UUIDs

When an id was not loaded, get() searched every item by urlId, so each
sidebar row observed the whole store. A UUID cannot end with a urlId, so
the search is skipped for UUIDs.

* perf: Stop sidebar rows re-rendering on navigation

- Track expanded nodes in an observable map, as ObservableSet.has tracks
  the whole set.
- Do not rebuild the document tree rows when the active document changes.
- Auto-expand the active path in a reaction instead of reading the active
  document during render.
- Compute active state per row, and keep row props stable.

* perf: Add useLocationSelector for persistent components

useLocation re-renders on every navigation. The new hook re-renders only
when the selected value changes, and is used where components stay mounted
across navigation. AuthenticatedLayout now keeps its portal element in
state, as it no longer re-renders after mount.

* chore: Send Document-Policy js-profiling header in development

* docs: Add render performance guidance to AGENTS.md

* fix: Check document or collection star exclusively for active state

* fix: Read location from each action context provider's own history

Nested providers inherited the root location getter, so menus inside a
split view pane read the browser route instead of the pane's route.

* fix: Expand starred collection when the active document changes
2026-10-11 15:17:01 -04:00
Tom Moor 11a010d66e fix: Remove group sync from legacy plan (#14023) 2026-10-11 13:29:05 +00:00
Tom Moor bc24a28182 fix: Preserve author names in template variables
Preserve literal author names when expanding document templates.
2026-10-11 09:17:56 -04:00
Tom Moor b1c17d8822 fix: Keep negative sign after currency symbol when sorting tables (#14018)
* fix: Keep negative sign after currency symbol when parsing

* test: Cover trailing minus in currency parsing
2026-10-11 09:09:33 -04:00
Tom Moor e571208871 fix: Spelling, grammar, punctuation, and translation string errors (#14017)
* fix: Spelling, grammar, punctuation, and translation string errors

* fix: Remove duplicate period and comma splice from review feedback
2026-10-11 09:07:07 -04:00
Tom Moor c36a0525f4 feat: Add icon and color to user groups (#14011)
* feat: Add icon and color to user groups

* refactor: useContrastColor hook

* refactor: Share icon contrast check via useContrastColor hook, named GroupIcon export
2026-10-10 13:24:03 -04:00
Tom Moor d6e555bb19 perf: Virtualize sidebar document trees (#13993)
* perf: Virtualize sidebar document trees

* fix: Hide empty state while adding a doc and scroll the active row on tree mount

* fix: Track scroll margin for sidebar trees that start empty
2026-10-08 20:42:57 -04:00
Tahsin Ahmed RefatandClaude Opus 5.5 62ef10d629 fix: Allow private-use URI schemes for OAuth redirect URIs (#13945)
* fix: Allow private-use URI schemes for OAuth redirect URIs

Native apps receive OAuth redirects on a private-use URI scheme
(RFC 8252 section 7.1), e.g. com.example.app:/oauth2redirect or
myapp://callback. These were rejected when registering a client
because IsUrlList only accepted http, https and ftp, and the
recommended com.example.app:/path form was also rejected at authorize
time because it has no host.

Add isPrivateUseSchemeUrl, which accepts private-use schemes while
excluding web schemes and schemes that can execute or embed content,
and use it in both places.

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

* fix: Require a protocol for OAuth redirect URIs

isURL treats a bare word such as "callback" as a hostname, so a client
could be saved with a redirect URI that validateRedirectUri would always
reject at authorize time. Require a protocol when validating the list.

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

* fix: Accept one-character private-use URI destinations

The destination check compared the pathname length, so a valid opaque URI
such as myapp:a was rejected along with the empty myapp: and myapp:/.
Reject only those empty forms.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 17:59:34 -04:00
Tom Moor c4d0d9f71c Format date mentions per locale (#13969)
* fix: Format date mentions with Intl so word order and clock follow the locale

* test: Normalize no-break spaces in every locale comparison
2026-10-06 17:35:16 -04:00
Tom Moor 49817d0676 fix: Document and collection mentions on public shares navigate outside the share (#13920)
On a public share, MentionDocument and MentionCollection rendered a Link to
the bare /doc/... or /collection/... path. That route is not part of the
share, so the router fell through to the authenticated app and showed the
login screen. Regular text links to the same documents were unaffected
because they go through the editor's onClickLink handler, which already
prefixes the share route.

Scope mention paths with sharedModelPath when a shareId is in context.
Moves the helper into shared/utils so the editor can use it; the app
wrapper keeps the same signature and reads ROOT_SHARE_ID from env.
2026-10-05 22:23:11 -04:00
Tom Moor 42f29a1a55 feat: Add plan-based feature entitlements (#13896)
* feat: Add plan-based feature entitlements

* feat: Gate audit log behind AuditLog entitlement

* Guard guests

* features
2026-09-27 09:40:50 -04:00
Tom Moor d5bc88f893 perf: Memoize Prosemirror parsing in DocumentHelper (#13892)
Nodes are cached against the content or state they were parsed from, so
repeated helper calls on the same document parse it once. JSON transform
helpers now replace attrs instead of mutating them, as Node.toJSON shares
attrs with the cached node.
2026-09-25 20:57:58 -04:00
Tom Moor ad6d39ac55 perf: Render simple read-only comments without an editor view (#13871)
* perf: Render simple read-only comments without an editor view

Read-only editor content made of paragraphs, basic marks, hard breaks,
emoji and lists is rendered from the schema DOMSerializer instead of
mounting a ProseMirror view per comment. Anything needing a node view or
plugin falls back to the full editor. Notification comment previews now
use the same read-only path.

* fix: Forward className on the static editor path
2026-09-23 21:54:33 -04:00
Tom Moor b72fd33e9c fix(editor): Use lazyWithRetry for shared editor lazy components (#13868)
Moves lazyWithRetry to shared/utils so the editor's ColorSwatch and
Mentions components can use it instead of React.lazy, avoiding the
Suspense reveal throttle once the chunk is loaded.
2026-09-23 20:50:37 -04:00
Tlntin 488bbb7461 feat: Line-height adjustments for Chinese, Japanese and Korean documents (#13822) 2026-09-22 03:18:17 +00:00
Tom Moor 70ea374543 fix: Language detection stores nothing for Chinese, Arabic, Persian and other macrolanguages (#13833) 2026-09-21 20:35:45 -04:00
Tom Moor b57d02c4fc fix: Enforce maxLength for all input paths in ContentEditable (#13793)
* fix: Enforce maxLength on paste, drop and IME input in ContentEditable

* fix: Count code points and hold over-limit change during IME composition
2026-09-18 18:28:26 -04:00
Tom MoorandClaude Fable 5.1 7bd59ba1b3 fix: History "Current version" entry never finishes loading (#13669)
* fix: Current version history entry loads forever

Assigning the primary key on a built Revision is a silent no-op in
Sequelize, so revisions.info returned a random UUID instead of the
synthetic latest id the client waits for.

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

* fix: Apply policies from fetchLatest response

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

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 18:40:27 -04:00
Tom Moor cd082e7e3b fix: Allow document mentions to wrap (#13639)
* fix: Allow document mentions to wrap

* fix: Prevent mention icons from shrinking

* fix: Preserve mention icon and text styles

* fix: Prevent Font Awesome icons from shrinking
2026-09-05 03:08:31 +00:00
Tom Moor d40bfc6f09 fix: Cannot sort observable array 2026-09-05 09:13:46 +09:00
964e709817 fix(editor): preserve toggle fold state across remote and local document edits (#13425)
* fix(editor): preserve toggle fold state across remote and local document edits

Fold state was re-derived from localStorage on every remote collaborative
transaction (and partially on local doc-changing ones), so a silently
failed Storage.set (quota exceeded, blocked storage) left a stale
{fold:true} and the next edit re-folded blocks the user had expanded —
the plugin seed from previous state was ineffective because
toggleFoldPluginKey.getState(newState) is always undefined during the
plugin's own apply.

Track a knownIds set alongside foldedIds and reconcile from the previous
plugin state (the second apply argument, which is reliable): existing
fold decisions are preserved verbatim and storage is only consulted for
toggle blocks seen for the first time.

Fixes #13424

* fix(editor): bound and harden toggle fold state persistence

Fold state was stored under a localStorage key per toggle block id with
no bound on how many keys accumulate, and a write that failed silently
(quota exceeded, storage unavailable) left a stale value that the next
edit would re-fold from. Two complementary changes:

- Storage falls back to session storage when a write to the primary
  interface fails at runtime, so values at least survive the browsing
  session; reads prefer the fallback copy while it is the most recent
  successful write, and successful writes drop it again.
- Toggle fold state now lives in an LRUCache mirrored to local storage,
  capping the number of stored keys and evicting the least recently used
  fold states first. The persisted key format is unchanged so fold state
  continues to sync across tabs via storage events.

Follow-up to #13425, addressing the underlying feedback in #13424.

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

* docs: add development workflow best practices to CLAUDE.md

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

* fix(editor): rename persistTo option to storage in LRUCache

Rename the `persistTo` cache option to `storage` with a union type of
`"memory" | "localStorage" | "sessionStorage"` per review feedback.
The option is now required instead of optional; callers that only need
an in-memory cache pass `storage: "memory"`.

The private Storage instance field is renamed from `storage` to `store`
to avoid colliding with the new option name, and the mapping from
user-facing values to Storage constructor arguments is handled in
`hydrate()`.

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

* fix(editor): eliminate redundant findBlockNodes scan in reconcileFoldState

The hot path for every local document change previously called
findBlockNodes twice on the same document — once in reconcileFoldState
and again in createDecorations.  Now reconcileFoldState collects the
blocks once and passes them directly to the decoration builder.

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

* fix(editor): fix createDecorations signature to accept optional blocks parameter

The init and ACTION branches pass a NodeWithPos[] as the second argument,
which previously landed in the foldedIds parameter — a type error missed
due to missing tsc validation.

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

* fix(editor): correct createDecorations argument order and NodeWithPos import

The createDecorations signature is (doc, foldedIds, blocks?) but both the
init and ACTION branches passed arguments in the old order (doc, blocks,
foldedIds). Because the Set is always truthy, the ?? fallback never fired
and buildDecorationsFromBlocks iterated over strings, crashing on
block.node.attrs. NodeWithPos is also not exported from findChildren.

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

* fix(editor): address review feedback and fix CI

- Document the default-folded fallback for evicted blocks in the
  fold-state cache comment.
- Cast the Storage test mock through unknown so the type check passes.
- Provide in-memory web storage for the shared jsdom test project so the
  persistence tests run instead of crashing on a missing implementation.

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

* fix(editor): scope storage fallback writes and drop unrelated changes

- Track keys mirrored to the storage fallback and clear only those,
  rather than clearing all of session storage
- Restore CLAUDE.md as a symlink to AGENTS.md
- Remove the unrelated scrollToNonce changes
- Make the fallback interface private and probe with a namespaced key

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2026-09-04 08:33:10 -04:00
Tom MoorandClaude Fable 5.1 012188635b chore: Remove unused validation helpers and getDataTransferItems (#13632)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-03 20:29:37 -04:00
Tom MoorandClaude Fable 5 b17f2611bf chore: React 18 upgrade (#13559)
* React 18 upgrade

* fix: Force synchronous React rendering in server HTML export

React 18 can defer a legacy ReactDOM.render commit when sync work is
queued, leaving exported component nodes empty. Wrap the render in
flushSync, and flush unmount-scheduled passive effects before global
env cleanup so React never runs without a window.

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

* refactor: Move server ComponentView to createRoot

ReactDOM.render and unmountComponentAtNode are removed in React 19.
flushSync around root.render keeps the mount synchronous for the
HTML-export path, which reads the DOM immediately after.

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

* Enable CI

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-03 01:43:47 -04:00
Tom Moor 2dfc26f14b fix: Provision OIDC users with locale claim (#13601) 2026-09-01 02:36:21 -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 2a9ac3b456 Tighten how editor node and mark attributes are rendered (#13486)
* fix: Sanitize the embed toolbar link and anchor embed url matchers

The "Open" link in an embed's bottom bar wrote the node's href attribute
into the DOM without passing it through sanitizeUrl, so a javascript: url
in that attribute ran on click.

Two embed matchers, and the regex built from a team's embed integration
settings, were not anchored, so a javascript: url that contained a
supported url further along still matched an embed and reached that link.

* fix: Only emit a list style the editor renders

The listStyle attribute is written into a list-style-type declaration.
Its validator returned a boolean rather than throwing, which Prosemirror
ignores, so any string reached the style attribute and a crafted value
appended further CSS declarations to the element.

* fix: Sanitize the image urls carried in a mention's unfurl attribute

The unfurl attribute holds a cached copy of the unfurl response on the
node, and is used whenever the store has no live entry for the url. Its
favicon and avatar urls were written to an img src unchanged, so a
crafted mention made every reader's browser request a chosen host.

* fix: Render a heading level and highlight color that cannot be used

Both attributes are used unchecked when the node is rendered. rgba()
throws for a color it cannot parse, and a level outside of 1-6 produces
an invalid tag name, so either one stopped the whole document rendering
in the browser and on the server. The heading level also reached a
repeat() in the Markdown serializer, unbounded.

Fall back when rendering rather than when reading, so that a value
written through collaborative editing, which does not run the attribute
validators, is covered too.
2026-08-19 08:06:48 -04:00
Tom MoorandClaude Opus 5 fb4ad4d046 perf: Keep FontAwesome icon packs out of the eagerly loaded bundle (#13463)
IconLibrary named-imported icons from the package barrels, which the Mermaid
extension also loads as whole icon packs. Sharing one copy of the barrel meant
every icon was retained and shipped on nearly every route. Importing each icon
from its own module leaves the barrels behind Mermaid's lazy icon pack loaders.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 17:37:19 -04:00
Tom MoorandClaude Opus 5 9f30b033f3 fix: Match base domain on a label boundary when parsing hosts (#13419)
* fix: Match the base domain on a label boundary

Domain parsing looked for the base domain anywhere in the host, so a host
that merely contained it was classified as a subdomain of the install
rather than as a custom domain. Compare against the end of the host
instead, and reuse the same helper for the custom domain CNAME check.

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

* fix: Normalize host case and trailing root label

Hostnames are case-insensitive and may be given in fully qualified form
with a trailing dot, so normalize both before comparing against the base
domain. Without this a host such as MyTeam.Example.Com is classified as a
custom domain and a valid CNAME target is rejected.

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 13:25:42 -04:00
Tom Moor fc4fe65155 feat: Filter DSL (#12176)
* feat: Normalized filter DSL for documents.list and search

Add a structured filter expression language (field/operator/value leaves
composed with AND/OR groups) shared by documents.list, documents.search and
documents.searchTitles. Values are validated against each field's column type
and per-field operator allowlists at the input layer, and translated to
Sequelize where-clauses server-side.

Supersedes the ad-hoc statusFilter/dateFilter/collectionId/userId parameters,
adds ISO 8601 duration matching for date fields, documentId subtree expansion
for search, and preserves draft visibility and collection authorization.

* chore: Fix flaky Encrypted "different key" test

AES-256-CBC is unauthenticated, so decrypting with the wrong key only
raises "bad decrypt" when the garbage plaintext has invalid PKCS#7 padding
(~255/256 of the time). Roughly 1 in 245 runs it decrypts to a non-matching
value instead of throwing, failing the strict toThrow assertion. Accept
either outcome, mirroring the adjacent tampered-data test.

* Hardening
2026-08-15 13:25:10 -04:00
Tom Moor 9bfb1b9930 fix: Preserve custom port in client-side redirects (#13401)
Proxies commonly forward a Host header without the port the installation is
publicly reachable on, so redirects derived from the incoming request pointed at
the wrong address – most visibly breaking the email magic sign-in link.
2026-08-12 21:49:49 -04:00
Tom Moor 65603756d6 fix: isNode detection 2026-08-10 18:58:54 -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 MoorandClaude Opus 5 b2b41dd3ca fix: Remap internal links when duplicating a document tree (#13270)
* fix: Remap internal links when duplicating a document tree

Duplicating a document tree now assigns the identifiers of every duplicate
before any content is written, so links and mentions between the documents
being duplicated point at the copies rather than the originals.

* fix: Remap fully qualified links when duplicating a document tree

Links written as a full url to this installation are now remapped alongside
relative ones, and stay fully qualified. Where a link is displayed as its own
url the text is updated to match.

Also trims surrounding whitespace in sanitizeUrl, which otherwise failed
validation and prepended a second scheme to an already qualified url.

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

* fix: Remap links across trees when duplicating a collection

The collection duplication task duplicated each root document separately, so
only links within a single tree were remapped. It now duplicates the whole
collection as one unit, with identifiers assigned across every tree before any
content is written.

* fix: Match document links by identifier rather than host when duplicating

An installation can be reached through more than one host, so comparing a
link's host against the configured url left fully qualified links to a
document in the duplicated set unmapped. The document a link identifies now
decides whether it is replaced, and the host it was written with is kept.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-02 22:44:06 -04:00