* feat: Display links as preview cards
Adds a display attribute to mentions so a link can render either inline
or as a card with image, title and description from its unfurl. Pasting
a URL offers a "Card" option, and selecting a link mention shows a
toolbar to switch between the two displays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MJXFgeTUqKhSTriUHfG3z
* feat: Arrow key selection, full width and Return for link cards
Cards fill the document width, hide the blank line below them, are selected
by the up and down arrow keys like images, and Return on a selected card
adds a paragraph below it.
* feat: Display document and collection mentions as cards
Document and collection mentions can be switched to a card from the
selection toolbar. Document cards show the summary, collection and the
first image larger than 100x100. Collection cards show the first line of
the description. On public shares the preview image is signed, as the
share page already signs the attachments of that document. Card images
are hidden until they load and removed if they fail.
* feat: Keep mention cards through Markdown
The card display is written as the link title, so URLs are not changed.
Document and collection cards are written as @ links to their id and
parsed back into mentions.
* refactor: Move mention cards to their own file
Document cards show the collection after the title instead of below it.
* fix: Address review feedback on mention cards
- Include the share id in the document card unfurl URL for root shares.
- Return on a card in a heading adds a paragraph.
- URL cards keep their URL in Markdown, and the server does not narrow
their type.
- Unfurl results apply to the current node, not the node at first render.
- Collection card descriptions stop at the first line break.
* refactor: Reuse existing helpers for mention cards
- Sign the preview image with TextHelper.attachmentsToSignedUrls.
- Check document and collection ids with isUUID.
- Return lines from getFirstText without changing an input array.
* fix: Preserve JSON output for inline mentions
* refactor: Centralize mention selection classes
---------
Co-authored-by: Claude <noreply@anthropic.com>
* chore: Remove emoji-mart runtime dependency
* fix: Exclude unavailable emoji from the search haystack
* fix: Use an Emoji 2.0 sequence for the version 2 probe
* fix: Correct CSV escaping and URL host matching in shared utils
- Check for CSV formula triggers after removing hidden characters, so that a
removed character cannot hide a trigger.
- Quote CSV fields that contain a carriage return.
- End the authority in parseDomain at "?", "#" and "\" as well as "/", so that
a host is not read from a query or fragment.
- Require a boundary after the origin in urlRegex, so that a look-alike host
does not match.
* fix: Match a stated default port in urlRegex
URL.host omits a default port, so a url that states :443 or :80 did not match its own origin after the boundary check was added.
* fix: Record passkey, OAuth client and invite events in the audit log
- Add passkeys.*, oauthClients.*, documents.unpublish,
webhookSubscriptions.update and users.invite_accepted to AUDIT_EVENTS.
- users.invite_accepted was never emitted: the invited check ran after
sign-in had set lastActiveAt, and email sign-in did not emit it at all.
It also had no actor or team. Invited users signing in with SSO receive
their welcome email again, and webhooks for this event start firing.
- passkeys.create had no actor or team as auth routes have no API context.
- Record the name on update and delete events where it is otherwise lost,
the title on documents.unpublish, and mark OAuth client secret rotations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: Attribute invite_accepted to the invitee, not the browser session
Auth routes parse an optional cookie session, and createFromContext prefers
that user over the provided defaults, so accepting an invite in a browser
with another session recorded the wrong actor and team.
* feat: Add server-driven rows to useTableRequest and date range helpers
- useTableRequest: `data` is now optional, when omitted the hook displays the
rows returned by the server for the current params. Needed when server-side
filtering cannot be reproduced against a client store.
- Add `dateToTimestamp` and `dateRangeToReadable` localized date formatters.
- Calendar: style the days between the start and end of a range.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Delete app/hooks/useTableRequest.test.tsx
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Fix stale workspace entries in sessions cookie
* Use authenticated token expiry for workspace session entries
* Remember logged-out workspaces for three months after last use
* Remove excessive tests
* Fix auth info test to send a real sessions cookie
* 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>