* fix: Command bar options changing as the menu animates away
Freeze the rendered results while the command bar is animating out, so
that navigation triggered by the selected action cannot reorder or
resize the list that is still on screen.
Also order sections by their declared priority in all cases – a section
that declares no priority was falling back to the fuzzy match score of
its first result, and recent searches shared a heading with recently
viewed documents, so both groups moved around unpredictably.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: Record the last command bar matches after render, not during
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Also bumps @tanstack/react-virtual to ^3.14.9 to dedupe the copy kbar now
depends on, replacing the unmaintained react-virtual v2.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: Consistently sanitize urls in editor components
Node attributes are authored content and cannot be assumed safe, but a few
render sinks were reading href and src straight from them. Applies the
existing sanitize helpers at the point of use in the attachment, PDF and
image components.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feedback
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Single-letter shortcuts such as "m" to move a document were still active
while a menu or dialog held focus, competing with the control's own key
handling. Generalizes the existing text input check to cover any element
inside a widget that handles its own keyboard input.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The staled-issues-prs output is a JSON blob that was interpolated
directly into the shell script, where its quotes and parentheses
were parsed as syntax. Pass it through the environment instead.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds a `badge` property to actions, rendered at the end of the item in
the command bar, and uses it to mark archived documents in search
results.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Several block menu items had no keywords at all, and others were missing
obvious synonyms, so searches like /formula, /callout, /grid or /numbered
returned nothing.
Adds the missing terms and drops keywords that only repeated the item
title, which is already matched.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Revoking a share link now operates on every active share, so it can be
performed from the bulk selection toolbar as well as the row menu. The
copy link and go to source actions read their share from the action
context too, and hide when a multi-selection is active.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Template publishing, duplication and deletion now operate on every active
template, so they can be performed from the bulk selection toolbar as well
as the row menu. Actions that only make sense for one template hide when a
multi-selection is active.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: Warn before discarding unsaved template changes
Template content is only persisted when the form is explicitly submitted,
so navigating away or closing the tab silently lost everything typed.
Adds a navigation Prompt and a beforeunload handler to both template
scenes, and reverts the model on unmount so abandoned edits no longer
leak into other views rendering the same record.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: Persist templates from the first keystroke
New templates were held only in browser memory until Save was pressed, so
a refresh, crash, or stray navigation lost everything written.
Templates are now created up front as an unpublished draft and autosaved,
mirroring how documents behave. Drafts are visible only to their author
until published, and are cleaned up if abandoned while empty.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: Preserve icon edits made during an in-flight template save
applyEdits only restored title and content, so an icon or color changed
while a save was in flight was overwritten by the response and never
re-saved.
Pending edits are now tracked as a single record covering every field the
form can change, rather than one ref per field.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feedback
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Replace custom tabs in IconPicker
* Use standard click handler type for Tab in button mode
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat: Live document stats in the corner of the editor
Moves word and character counts out of the Insights dialog into an
optional bar in the bottom corner of the document that updates as you
type, adding paragraph count and reading time.
Enabled with a new "Show editing stats" preference, or toggled with
Cmd+Shift+G. The counts switch to the selection while text is selected,
and fade out while idle.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: Stats bar should not intercept clicks in the editor
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Add toggle to document menu and command menu
* fix: Empty documents should not report a one minute read
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The transitive ^4.1.0 descriptor was still resolving to 4.3.0 while the
direct dependency had already moved to 4.3.1. Re-resolved so both share
a single entry.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* ci: Make dependency audit a warning instead of a failure
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* ci: Let audit fail on its own, drop it from the aggregate check
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* docs
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Template content is nullable, but the presenter passed it through raw so
a template without content reached the client with no data at all.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: Build canonical redirect url from team, not request host
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* test: Cover canonical host redirects
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* perf: Reduce database and Redis round-trips on the MCP endpoint
Profiling production traces for the /mcp endpoint showed the time is
spent in repeated permission and breadcrumb lookups rather than in the
MCP layer itself.
- Cache Document.membershipDocumentIds in Redis, mirroring the TTL and
key pattern of User.collectionIds. The two are resolved together for
every search and this half was uncached, measuring ~200ms.
- Resolve each collection's cached document structure once, concurrently,
when building breadcrumbs for a batch of documents. It was awaited per
document inside a loop, so a page of search results meant a serial
Redis round-trip for every result.
- Walk each collection structure once into a document ID to breadcrumb
map instead of searching the whole tree per document.
- Reuse the collection association already loaded by Document.findByPk
when resolving a single document's breadcrumb, rather than querying it
again under the same membership scope.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: Invalidate cached document membership IDs on permission changes
The cache added alongside membershipDocumentIds relied on its TTL alone,
so a revoked grant stayed searchable until it expired. Clear the key on
the paths that change which documents a user is a member of, keeping the
TTL as a backstop.
- UserMembership create and destroy where documentId is set.
- GroupMembership create and destroy where documentId is set, for every
user in the group.
- GroupUser create and destroy, as joining or leaving a group changes
which group grants reach the user.
Sourced memberships are written with hooks disabled and destroyed without
individual hooks, so the parent membership invalidates once for the group
rather than once per descendant.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Resolve notification recipients through the same loader that backs the
public share endpoints, so a subscriber is only mailed about a document
the share would actually serve them.
* fix: Sanitize user-provided name when building export storage keys
Export keys interpolated a document title or collection name straight
into the storage path, so a name containing path separators could move
the archive out of the uploads bucket and into public, where files.get
serves content without authorization.
Sanitize the name down to a single path segment, dedupe the duplicated
key builder in collectionExporter, and reject traversal in LocalStorage
where resolve-path only guards the root, not movement between buckets.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore: Complete JSDoc on export key helpers
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Error names were mangled by the production build and 502 responses often
have an empty body, so these were reported without a usable title. Errors
now carry an explicit name, the message includes the endpoint, and 502s are
grouped per endpoint.
* fix: documents.import writes into an unauthorized collection when a parentDocumentId is also given
* test: assert imported child resolves to the parent's collection
suggestions.mention queried User and Group scoped only by team, while
users.list and groups.list both authorize against listUsers/listGroups,
which exclude guests. presentUser withheld the email, but membership in
the result set was unconditional and the query matched on email, so a
guest could enumerate the workspace and probe for addresses.
Gate both reads on the same policies. Documents and collections already
scope to the actor, so guests keep those suggestions.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: Friendly error and retry for duplicate team subdomains
Picking a subdomain already in use in settings surfaced the raw unique
constraint violation as a 500, and concurrent signups could race between
the availability check and the insert.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* test: Use setCloudHosted helper rather than spying on env
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* refactor: Move retryOnUniqueConstraintError to storage/database
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>