Commit Graph
1106 Commits
Author SHA1 Message Date
Tom Moor fb7b024489 chore: Move link actions to their own module and inline link checks 2026-11-11 21:18:44 -05:00
Tom Moor 080a9e59c8 chore: Simplify sidebar link code 2026-11-11 21:04:54 -05:00
Tom Moor 55bd1f36c1 Merge remote-tracking branch 'origin/main' into tommoor/external-sidebar-links-add
# Conflicts:
#	app/components/Sidebar/components/DocumentRow.tsx
2026-11-11 19:41:58 -05:00
Tom Moor 291ec67243 fix: Record document title on documents.delete audit event (#14530) 2026-11-11 15:48:02 -05:00
Tom Moor 394ac42d17 feat: Add link actions to the document menu 2026-11-11 11:05:49 -05:00
Tom Moor d75c243763 feat: Allow sidebar links to be dragged to reorder 2026-11-10 07:24:43 -05:00
Tom Moor fcf3f41a58 feat: Add external links to the sidebar 2026-11-10 07:20:35 -05:00
Tom Moor a40198a97d feat: Add expiry dates for public share links (#14513)
* wip

* fix: Treat null expiresAt as no expiry when creating a share

* fix: Add bottom padding to share notices
2026-11-09 22:29:49 -05:00
Tom MoorandClaude f680d5dec9 feat: Display links, documents and collections as preview cards (#14511)
* 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>
2026-11-08 08:11:31 -05:00
Tom Moor 9168ec31ab perf: Use fast-deep-equal in DocumentHelper.isContentEqual (#14501) 2026-11-06 18:28:04 -05:00
Tom Moor fe50488c97 feat: Allow selecting a destination when importing (#14486)
* feat: allow selecting import destination

* fix: address import destination review findings

* feat: multi-step import dialog with workspace root location

- Import dialog is now upload then location, the same height as the move dialog
- Document explorer lists the workspace as the root and marks the selected row
- A document export with a sibling folder merges into one document, or becomes
  the collection overview when creating new collections
- Destination document checks now rely on the createChildDocument policy

* fix: delete archived imported documents and read legacy task inputs

- Deleting an import now removes the children of archived imported documents
- Tasks queued before the rename to rootExternalId are still assigned correctly
2026-11-06 08:05:31 -05:00
Tom Moor d8667e4b19 fix: Record passkey, OAuth client and invite events in the audit log (#14485)
* 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.
2026-11-06 08:05:18 -05:00
Tom Moor e21d1ed8d4 fix: Linear time whitespace and bracket handling in markdown serializer (#14460) 2026-11-04 20:28:57 -05:00
Tom Moor f0401f83e7 chore: Remove unnecessary URL parsing (#14454) 2026-11-02 21:14:53 -05:00
Tom Moor 6d7cd455e9 chore: Decouple core plugins (#14340)
* chore: Move plugin-specific integration code into plugins

Core no longer imports from or names the settings of individual plugins.
Plugins now register mention providers, issue status icons, instance URLs,
settings keys, settings and import schemas, and OAuth clients through hooks.

* fix: Recompute embed instance URLs after plugins load and match legacy issue icons by URL

* fix: Skip logo upload jobs queued without a settings path

* chore: Choose issue status icons from the unfurl state
2026-11-02 19:42:48 -05:00
Tom Moor 25eac11a6c perf: Render share page content without the export lock and cache it (#14284)
* perf: Render share page content without the export lock and cache it

* perf: Render share page content only for bots, detect bots with isbot

Browsers never read the server-rendered share content, so skip the render
for them. Replace the koa-useragent isBot check with the isbot package,
which also detects AI crawlers, and add a lint rule against isBot.
2026-11-01 08:05:55 -05:00
Tom Moor 8b120caccf feat: Add document unsubscribe link to comment emails (#14149)
* feat: Add document unsubscribe link to comment emails

- Comment and resolved emails now link to unsubscribe from the document, above the global unsubscribe link.
- Thread replies and resolve notifications skip users who unsubscribed from the document after their last involvement in the thread.

* refactor: Check only deleted document subscriptions for thread unsubscribe

* fix: Make the document unsubscribe link a document-only opt-out

- The email link no longer deletes the collection subscription, and records or refreshes a document opt-out on every click.
- A document opt-out takes precedence over an older collection subscription.
- Users mentioned in the thread after they opt out get thread notifications again.
2026-11-01 08:05:43 -05:00
Tom Moor 4f2d186004 fix: Tighten guest access to integration data (#14434) 2026-11-01 07:57:48 -05:00
Tom Moor bd7fc38ddb feat: Generate Pinyin slugs for Chinese document titles (#14375)
Slugs are now generated only on the server, which lazily loads pinyin-pro.
The client reads the path from the API rather than computing it.
2026-10-31 11:12:24 -04:00
Tom Moor 8852acb5f9 perf: Stop documents.viewed from joining every view of the user (#14430)
Postgres misestimates the document access filters and reads, joins and sorts
all of a user's views before applying the limit. Find the page of view ids
first with a fenced lateral lookup so the index is read in order, then load
only those views.
2026-10-31 10:10:36 -04:00
Tom Moor a374ce9b46 fix: Viewers attributed as editors when their editor repairs remote changes (#14424)
* fix: Viewers attributed as editors when their editor repairs remote changes

* fix: Rescan after remote changes and assign block ids when parsing markdown

* chore: Import uuid as generateUuid in ToggleBlock

* refactor: Add RepairPlugin to repair only on local changes, checking remote changes for pending repairs

* fix: Assign block ids on the server so patches keep existing ids, keep unchanged mention ids

* fix: Store API edits in the editor's trailing node form
2026-10-30 22:27:31 -04:00
Tom Moor 7f8231f6aa fix: Do not create revisions for comment-only changes (#14363)
* fix: Do not create revisions for comment-only changes

* fix: Ignore empty mark lists left after removing comment marks
2026-10-26 23:17:06 -04:00
Tom Moor e7795896d0 fix: Truncate generated team subdomain to the maximum length (#14359) 2026-10-26 22:43:47 -04:00
Tom Moor 809fc0d86d fix: Exports fail when the exported name is long (#14362) 2026-10-26 22:42:52 -04:00
Tom Moor 9fe0c7ba2b fix: Preserve existing values when optional update fields are omitted (#14344)
* fix: Preserve existing values when optional update fields are omitted

* chore: Rename setDefined to fill

* chore: Use fill in users.update and teamUpdater
2026-10-26 17:29:17 -04:00
Tom Moor 99a4edb2bb feat: Show a document preview in publish notification emails (#14249)
* feat: Show a preview of the document in publish notification emails

Moves email snippet and diff generation out of ProsemirrorHelper and
DocumentHelper into server/emails/snippets.

* fix: Address review feedback on publish email preview

- Skip the email when the recipient can no longer read the document
- Keep the preview within budget, counting separators and capping list items
- Make relative links in email previews absolute
- Chain :not() selectors so email CSS inlining does not outline lists
2026-10-25 23:11:58 -04:00
Tom Moor 9aad5a4bb7 feat: Add Gitea / Forgejo integration (#14336)
* feat: Add Gitea integration for issue, pull request, and repository previews

* fix: Gitea repository previews and request deadlines

Refresh the token before repository discovery, keep repository previews when
the issue tracker is disabled, and keep the request timeout active while the
response body is read.

* chore: Use the shared fetch timeout for Gitea requests

* chore: Mention Forgejo in Gitea copy and reuse the callback URL helper

* Remove service specific getters in IntegrationsStore
2026-10-25 18:04:04 -04:00
Tom Moor 1bdf026857 feat: Send share changes over WebSockets (#14161)
* feat: Send share changes over WebSockets

* fix: Include document members in share events and hydrate share policies

* refactor: Move share event query to a Share scope
2026-10-24 18:17:23 -04:00
Tom Moor 0d13c183fd chore: Add lint rules for test conventions (#14318) 2026-10-24 14:09:36 -04:00
Tom Moor f43614713e perf: Replace keyspace SCAN with single-key cache deletes after commit (#14279)
* perf: Use single-key cache deletes after commit and add afterCommit helper

* fix: Await notification event scheduling without a transaction
2026-10-24 09:07:19 -04:00
Tom Moor 4e4c51c772 perf: Bulk insert sourced memberships and load the moved subtree once (#14286) 2026-10-24 08:24:30 -04:00
Tom Moor 201038c36d perf: Keep the loaded collection when the document title changes (#14283) 2026-10-24 07:55:11 -04:00
Tom Moor d035e0fdff perf: Throttle lastActiveAt writes from collaboration edits (#14281)
* perf: Throttle lastActiveAt writes from collaboration edits to once every five minutes

* Reuse User.updateActiveAt for collaboration activity
2026-10-24 07:34:38 -04:00
Tom Moor e471d95b40 perf: Delete comment replies in one statement and index parentCommentId (#14277)
* perf: Delete comment replies in one statement and index parentCommentId

* fix: Reject replies to a reply so thread deletion removes every reply
2026-10-24 07:29:02 -04:00
Tom Moor c84b9f10a0 fix: Make membership grants for the same subject atomic (#14274)
* fix: Serialize membership grants for the same subject

* fix: Normalize ID case in membership lock names
2026-10-24 07:24:16 -04:00
Tom Moor e76f0dcf8e perf: Load only ids when resolving membership user ids (#14275) 2026-10-24 07:24:06 -04:00
Tom Moor 3967edc5d9 feat: Paginate views.list with a default limit of 100 (#14278) 2026-10-24 07:23:49 -04:00
Tom Moor b3a91da1c5 perf: Throttle attachment lastAccessedAt writes to once every five minutes (#14276) 2026-10-24 07:22:53 -04:00
Tom Moor eb290040a1 fix: Make email matching across sign-in providers opt-in (#14270) 2026-10-23 22:21:12 -04:00
Tom Moor a63a6351f1 fix: Load templates through the Template model (#14269) 2026-10-23 21:48:14 -04:00
79989f4660 Fix attribution of Markdown document mentions (#14123)
Co-authored-by: Tom Moor <380914+tommoor@users.noreply.github.com>
Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
2026-10-22 21:39:27 -04: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 d2ad848cfb perf: Batch comment view lookups and memoize email diff clipping (#14251)
Load the views of all comment notification recipients in one query
instead of one query for each recipient, and check each element for diff
classes with one combined selector, once.
2026-10-22 19:52:51 -04:00
Tom Moor 5752b4983d perf: Load attachments in one query when signing urls in text (#14247) 2026-10-22 19:19:09 -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 0454badbf6 fix: Scope linked account settings in integration presenter to the owner (#14233) 2026-10-22 08:02:23 -04:00
Tom Moor 2ec2e2025e chore: Scope mention label lookup in emails to the team (#14229) 2026-10-22 07:56:59 -04:00
Tom Moor c963528941 feat: List all contributors in document update emails (#14157)
* feat: List all contributors in document update emails

* fix: Stable collaborator order, plural wording, and legacy email jobs
2026-10-20 08:32:16 -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 d249b34e8e fix: Tighten checks when publishing drafts (#14155)
* fix: Tighten checks when publishing drafts

Detaching a document on unpublish now also clears its parent.

* fix: Publish at the root when the parent is in another collection

* test: Load detached drafts without the default scope
2026-10-19 23:23:11 -04:00