feat: mention database row page#403
Draft
appflowy wants to merge 18 commits into
Draft
Conversation
Reviewer's GuideImplements server-backed mention search throughout the editor by wiring a new WorkspaceService.searchMentions API into editor, document, modal, and database contexts; introduces richer Mention types and search models (including databases and database rows); updates the Mention panel UI/keyboard handling to render server results with caching and fallback to legacy recent-pages behavior; adds database mention rendering, improved mention text extraction, and extensive integration/unit/Playwright coverage. Sequence diagram for mention panel server search with cache and legacy fallbacksequenceDiagram
actor User
participant MentionPanel
participant EditorContext
participant WorkspaceService
participant Cache as MentionSearchCache
User->>MentionPanel: type "@query"
MentionPanel->>MentionPanel: buildMentionSearchRequests
MentionPanel->>Cache: get(cacheKey)
alt cache hit
Cache-->>MentionPanel: sections
MentionPanel->>MentionPanel: flattenMentionSearchSections
MentionPanel-->>User: render server results
else cache miss
alt searchMentions available
MentionPanel->>EditorContext: searchMentions(requests)
EditorContext->>WorkspaceService: searchMentions
WorkspaceService-->>EditorContext: MentionSearchResponse[]
EditorContext-->>MentionPanel: responses
MentionPanel->>MentionPanel: mergeMentionSearchResponses
MentionPanel->>Cache: set(cacheKey, sections)
MentionPanel-->>User: render server results
else searchMentions unavailable or failed
MentionPanel->>MentionPanel: useLegacyMentionSearch = true
MentionPanel->>EditorContext: loadViews
EditorContext-->>MentionPanel: recent pages
MentionPanel-->>User: render legacy recent-pages UI
end
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
# Conflicts: # src/application/database-yjs/context.ts # src/components/database/Database.tsx
- Re-read cache after joining an in-flight mention search refresh so reopened panels pick up refreshed sections instead of stale ones - Enforce mention search cache size limit on all insert paths and make eviction LRU instead of FIFO - Subscribe the mention panel keydown listener once per open via a handler ref instead of re-attaching on every keystroke - Guard MentionPerson user fetch against out-of-order responses - Derive MentionDatabase resolved view id during render (keyed by databaseId) instead of mirroring props into state via an effect - Pass primitive props to MentionDatabase so MentionLeaf's content memo no longer depends on unstable leaf object identity - Replace arrow-key option array allocation with index arithmetic and drop a useMemo over module constants - Memoize local fallback view tree walk separately from query filtering Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Port the desktop row-page features to web, API/collab-driven (no local store): - Soft-delete tombstones: RowOrder.is_deleted support with filtering in all rendering paths; row-lifecycle dispatches to soft-delete, restore, and permanently remove rows across every database view - Delete row: rows with document content (or a materialized row document) are tombstoned and their row-document view moves to trash; empty rows hard-delete with no trash entry - Favorite a row page: header star on ?r= pages targets the row document (materializing the orphan view lazily); favorites entries navigate back to the row page; dedicated favoriteFailed toast - Trash page: restore clears the tombstone across views, permanent delete removes the row for good; restore-all/delete-all handle row-document entries - Title sync: primary-cell edits propagate to the row-document view name (debounced) so favorites/trash labels stay current - Mention parity: database rows render inline in the Pages section with a grid icon (no separate heading); row mentions resolve through the row-document view when database_view_id is missing; open failures show a toast - BDD: port cloud_row_page_trash_restore.feature to Playwright (row-page-lifecycle), scoped to the visible grid to handle multi-view testid duplicates; update mention-search steps to the new section contract Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🥷 Ninja i18n – 🛎️ Translations need to be updatedProject
|
| lint rule | new reports | level | link |
|---|---|---|---|
| Missing translation | 28 | warning | contribute (via Fink 🐦) |
Resolved conflicts in share access files by combining both sides: - access-api.ts: kept main's getShareDetail (v2 endpoint with legacy fallback, retry, and workspace-scoped caching), which subsumes this branch's direct v2 rewrite - useShareAccessDetails.ts / callers: restored the ancestorViewIds argument required by the legacy fallback - PersonItem.tsx: canModifyThisPerson now requires both !isInheritedWorkspaceAccess (this branch) and main's full-access / not-you / not-owner gating - PeopleWithAccess.tsx / SharePanel.tsx: pass both sectionType and canGrantFullAccess - tests: kept both sides' new cases; added the required isInheritedWorkspaceAccess prop to main's new PersonItem test Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A user whose access was revoked could keep reading a page indefinitely:
local-first rendering serves view metadata from the outline/disk cache and
content from IndexedDB without consulting the server, and the only server
probe (routeViewExists) is skipped while the view is still in the cached
outline and treats only 404 as an error.
- Add AccessService.getObjectPermission wrapping
GET /api/workspace/{w}/collab/{id}/permission
- AppBusinessLayer: background permission probe on navigation (10s TTL,
in-flight dedup); on can_read=false or a definitive 403 show the
no-access page and purge the view's IndexedDB collab + view-meta cache.
Denied state is keyed by view id and derived during render so
navigation never flashes the no-access screen on the next page.
- useWorkspaceData: on a SHARE_VIEWS_CHANGED notification naming the
current user (case-insensitive), probe the server and, when access is
gone, evict local caches and emit VIEW_ACCESS_REVOKED so an open page
swaps to the no-access screen immediately.
- MainLayout renders the Forbidden/RequestAccess screen for viewNoAccess.
- access-api: drop the stacked withRetry around the share-details v2 GET;
the axios interceptor already retries transient GET failures, and the
double ladder kept the share panel blocked before the legacy fallback.
Known gap: rows of a revoked database page keep their per-row collab
caches; only the database view's own doc is evicted.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds server-backed mention search to the editor mention panel, including support for people, pages, databases, database rows, dates, and external links.
Details
Impact
Users can search richer mention targets from the editor, including embedded database rows, while existing page/date/create mention flows remain available.
Validation
git diff --checkpnpm run type-checkpnpm jest src/components/editor/components/panels/mention-panel/__tests__/mentionUtils.test.ts src/application/slate-yjs/__tests__/command.test.ts --no-coverage --runInBandcodex review --uncommittedfound no actionable correctness issuesSummary by Sourcery
Integrate a server-backed mention search API into the editor mention panel while extending mention types to support databases, database rows, and external links.
New Features:
Enhancements:
Tests: