[ENG-1890] Add Publish tab to Roam query-results share dialog#1133
[ENG-1890] Add Publish tab to Roam query-results share dialog#1133sid597 wants to merge 4 commits into
Conversation
Adds a "Publish" tab to the Roam Share Data / query-results dialog (Export.tsx), gated on isSyncEnabled(), that grants a sharing group access to the selected query-result discourse nodes via the existing SpaceAccess/ResourceAccess group-targeted model. - Promote getMyGroups/getAvailableGroupIds/MyGroup from Obsidian's importNodes util to shared @repo/database/lib/groups; Obsidian's file becomes a behaviour-preserving re-export shim. - New apps/roam/src/utils/publishNodesToGroups.ts: grants access only to nodes already synced (present in my_concepts) and reports the rest as not-yet-synced; upserts SpaceAccess (partial) + ResourceAccess for each node and its schema concept. - PublishPanel with multi-group picker, non-discourse-result filter, and a success/skipped/failed count toast.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75ec5a3916
ℹ️ 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".
PR size/scope checkThis PR is over our review-size guideline.
Please split this into smaller PRs unless there is a clear reason the changes need to land together. If keeping it as one PR, please add a brief justification covering:
|
| @@ -0,0 +1,49 @@ | |||
| import type { DGSupabaseClient } from "./client"; | |||
There was a problem hiding this comment.
This is a shared-home move for existing Obsidian group helpers, not new group behavior. Roam now needs the same getMyGroups / getAvailableGroupIds logic for publishing, and importing from apps/obsidian would create an app-
to-app dependency.
| ); | ||
| }; | ||
|
|
||
| const getResultPublishNodes = (result: Result): PublishNode[] => { |
There was a problem hiding this comment.
Roam query results can return wrapper pages whose UID is not itself a discourse node. In that case, the visible row points at the real DG page through :block/refs, so publish resolves referenced user-backed DG nodes before granting access.
There was a problem hiding this comment.
@sid597 Can you show an example of this where we wouldn't be expecting to export the uid of the queried row?
|
|
||
| const getResultPublishNodes = (result: Result): PublishNode[] => { | ||
| const directNode = findDiscourseNode({ uid: result.uid }); | ||
| if (directNode && directNode.backedBy === "user") |
There was a problem hiding this comment.
We still require backedBy === "user" here because sync only uploads user-backed discourse node types; default Page/Block matches should not become publishable.
|
|
||
| const { publishableNodes, nonDiscourseCount } = useMemo(() => { | ||
| if (!syncEnabled) | ||
| return { publishableNodes: [] as PublishNode[], nonDiscourseCount: 0 }; |
There was a problem hiding this comment.
Avoid asserting when possible. If not possible, make a comment explaining why we must resort to asserting.
| ); | ||
| }; | ||
|
|
||
| const getResultPublishNodes = (result: Result): PublishNode[] => { |
There was a problem hiding this comment.
@sid597 Can you show an example of this where we wouldn't be expecting to export the uid of the queried row?
maparent
left a comment
There was a problem hiding this comment.
Approved, but then saw missing functionality: When a node is already shared to a group, the button for that group should be already checked.
https://www.loom.com/share/d7cd9e76c02f46c6ad13fcda24088b90
Adds a "Publish" tab to the Roam Share Data / query-results dialog (Export.tsx), gated on isSyncEnabled(), that grants a sharing group access to the selected query-result discourse nodes via the existing SpaceAccess/ResourceAccess group-targeted model.