β¨ feat(page-share): add document share flow#15059
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Reportβ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## canary #15059 +/- ##
==========================================
- Coverage 70.80% 69.67% -1.13%
==========================================
Files 3159 3091 -68
Lines 315826 300125 -15701
Branches 28704 25888 -2816
==========================================
- Hits 223608 209114 -14494
+ Misses 92049 90842 -1207
Partials 169 169
Flags with carried forward coverage won't be shown. Click here to find out more.
π New features to boost your workflow:
|
696aefb to
224e441
Compare
2165def to
244a3c4
Compare
- Wait for shared-page probe before mounting authenticated tree to avoid PageAgentProvider stuck in Suspense. - Render guest view inline in (main)/_layout to bypass intermediate Outlet, since outlet context does not propagate across nested layouts. - Whitelist /page/ and /share/ in tRPC 401 handler so unauthenticated guests are not redirected to /signin.
- ShareButton β ActionIcon (consistent with Header siblings), drop SWR pre-fetch. - SharePopover rewritten with createStaticStyles + cssVar tokens; replace custom dropdown with @lobehub/ui/base-ui Select + labelRender/optionRender. - Drop coming-soon comment/edit options, dividers, double padding, hard-coded colors, and dead branches; AccessValue simplified to private/link. - Use copyToClipboard from @lobehub/ui and SHARED_PAGE_PROBE_KEY constant for mutate. - Clean up unused i18n keys.
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7edb742fb0
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| editorData: doc.editorData, | ||
| fileType: doc.fileType, | ||
| id: doc.id, | ||
| metadata: safeMetadata, | ||
| pages: (doc.pages as unknown[] | null) ?? null, |
There was a problem hiding this comment.
Avoid exposing editor internals on public shares
For non-owner /page/:id link shares, this public share.getSharedDocument response still includes the raw editorData (and adjacent pages) even though the guest viewer only renders document.content. When a shared page contains editor-only state such as pending diff/review nodes, comments, or other structured metadata, anyone with the link can inspect the network response and read data that is not intended to be part of the published read-only markdown; return these fields only for owners or omit them from the guest payload.
Useful? React with πΒ / π.
| "updated_at" timestamp with time zone DEFAULT now() NOT NULL | ||
| ); | ||
| --> statement-breakpoint | ||
| ALTER TABLE "document_shares" DROP CONSTRAINT IF EXISTS "document_shares_document_id_documents_id_fk";--> statement-breakpoint |
There was a problem hiding this comment.
Isn't this redundant?
This comment was translated by Claude.
Original Content
θΏζ―δΈζ―ε€δ½η
There was a problem hiding this comment.
I'll regenerate it.
This comment was translated by Claude.
π» Change Type
π Related Issue
No precise matching GitHub issue found for document/page sharing.
π Description of Change
document_sharesdatabase table, schema export, DBML update, and document share model.pageSharelocale resources and local dev proxy support for shared page routes.π§ͺ How to Test
Commands run:
Additional check:
bun run type-checkcurrently fails on pre-existing repository issues, mainly missing@lobechat/business-model-bank/model-configmodule declarations and unrelated implicitanyerrors outside this PR's touched files.πΈ Screenshots / Videos
π Additional Information
Comment and edit access are represented in the UI as coming soon; the current server mutation accepts read-only shared links.