* 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
* 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
* 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
* 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
* 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
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.
* 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>
* 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.
* 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.
* chore: Upgrade slug from 5 to 11
* Require Node 22.12+ for require(esm), test θ transliteration
* Polyfill String isWellFormed and toWellFormed for older browsers
* 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
* feat: Add icon and color to user groups
* refactor: useContrastColor hook
* refactor: Share icon contrast check via useContrastColor hook, named GroupIcon export
* 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
* 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>
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.
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.
* 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
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.
* 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>
* 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
* 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>
* 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>
* 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>
* 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.
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>
* 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>
* 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
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.
* 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>
* 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>