Skip to content

Cr/seed packets 8214 - #62

Closed
mberrys wants to merge 5 commits into
mainfrom
cr/seed-packets-8214
Closed

mberrys wants to merge 5 commits into
mainfrom
cr/seed-packets-8214

Conversation

@mberrys

@mberrys mberrys commented Aug 30, 2026

Copy link
Copy Markdown
Owner

No description provided.

cursoragent and others added 5 commits August 12, 2026 19:21
The editor on this branch was a broken mix of TipTap and markdown that
did not parse. Restore the textarea editor so documents can be read and
typed, matching the existing e2e selectors.

Co-authored-by: michael berry <mberrys@users.noreply.github.com>
Replace the hardcoded first-run seed with a SeedPacket registry. An empty
workspace offers a picker; planting sprouts docs, opens the packet's panes,
and records origin in workspace meta and .rrspace export.

Welcome is packet garden/welcome. History seminar, grant shop, and field
notes ship as distinct profession packets with extra recipes and prompt
addenda.

Co-authored-by: michael berry <mberrys@users.noreply.github.com>
Playwright's Welcome to garden name match hit sidebar, tab, and action
buttons. Wait for .rr-markdown instead.

Co-authored-by: michael berry <mberrys@users.noreply.github.com>
- Extend SeedPacket contract (version, starterBases, links, layout, requires)
- Add database doc kind with grid/kanban views and relation fields
- Ship comms/campaign proof packet with linked bases and sample rows
- Persist seedPacketVersion in workspace meta and .rrspace exports
- Complex packet preview and capability gating in picker

Refs #8 #18

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: michael berry <mberrys@users.noreply.github.com>
@mberrys

mberrys commented Sep 1, 2026

Copy link
Copy Markdown
Owner Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 564cfd9d21

ℹ️ 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".

Comment thread src/lib/ops/database.ts
Comment on lines +197 to +201
inverse.push({
op: "addField",
field: removed as unknown as { type: DatabaseField["type"] } & Record<string, unknown>,
index,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore deleted cell values when undoing a field deletion

When deleteField removes a populated column, its inverse records only an addField; the following loop permanently removes every corresponding cell value. Pressing Undo therefore recreates an empty column instead of restoring the document, silently losing user data. Capture the removed values in the inverse or introduce an operation that restores the field and its cells together.

Useful? React with 👍 / 👎.

Comment thread src/lib/docs/schema.ts
Comment on lines +478 to +482
export const RelationFieldSchema = z.object({
...fieldCommon,
type: z.literal("relation"),
targetDocId: z.string(),
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remap database references when imported document IDs collide

When a bundle containing related database documents is imported into a workspace that already has the same document IDs, importBundle assigns new envelope IDs to the imported copies but does not rewrite RelationField.targetDocId or GardenRef.documentId. The imported bases then silently point to the pre-existing documents rather than their imported counterparts, so restoring a packet into a non-empty workspace corrupts its topology. Build an old-to-new document-ID map and remap these references after parsing all imported documents.

Useful? React with 👍 / 👎.

const options =
groupField?.type === "select" ? groupField.options : groupField?.type === "multi_select" ? groupField.options : [];

const columns = options.length > 0 ? options : ["Unassigned"];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep unassigned rows visible in kanban views

For a kanban grouped by a select field with options, columns omits the Unassigned column entirely. A newly added row has no group value, so in the Campaign packet's Pipeline view it disappears from the board as soon as its inspector is closed and cannot be selected again there. Include an unassigned column even when configured options exist.

Useful? React with 👍 / 👎.

Comment on lines +222 to +225
const sprouted = sproutPacket(packet);
const state = get();
const docs = { ...state.docs };
const order = [...state.order];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Serialize concurrent packet planting

If the user double-clicks a Plant button, both asynchronous calls capture the same pre-plant workspace before either reaches set(). Each invocation sprouts different document IDs and persists them, while the final in-memory state and saved order contain only whichever invocation finishes last; after reload, the other persisted documents reappear as an extra duplicate packet. Disable planting while it is in flight or serialize the state update and persistence transaction.

Useful? React with 👍 / 👎.

Comment on lines +123 to +127
{listPackets().map((packet) => (
<MenuItem
key={packet.id}
icon={<Sprout size={14} />}
onClick={() => void plantPacket(packet.id)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Show complex packet previews from the sidebar

Planting from the sidebar calls plantPacket directly, bypassing the packetNeedsPreview flow used by SeedPacketPicker. Consequently, planting Campaign later in an existing workspace immediately adds all linked bases and artifacts without the promised preview, and requestPacketPicker cannot help because the picker is hidden whenever documents already exist. Route complex sidebar selections through the preview before applying them.

Useful? React with 👍 / 👎.

Comment thread src/lib/packets/sprout.ts
Comment on lines +41 to +43
for (const baseSeed of packet.starterBases ?? []) {
const dbDoc = databaseFromSeed(baseSeed, localToId);
localToId.set(baseSeed.localId, dbDoc.id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve database IDs before building relation fields

A relation field can target any starter base accepted by parseSeedPacket, but each database is built before its own ID and later base IDs are inserted into localToId. Thus a valid packet containing a self-relation or a relation to a base declared later throws an unresolved-target error during sprouting. Allocate IDs for all bases first, then build their fields using the complete map.

Useful? React with 👍 / 👎.

@mberrys

mberrys commented Sep 5, 2026

Copy link
Copy Markdown
Owner Author

Closing as superseded. This branch (cr/seed-packets-8214) is a stale duplicate of the seed-packets/database work that main already merged in newer form via PRs #49/#50/#57/#59/#61 — main's src/lib/packets/*, src/lib/ops/database.ts, and the database surface are all descendants of this code. Merging it as-is would pull back older versions of ~25 shared files over main's current implementation (a regression), and its only main-missing file (src/lib/text/safe-href.ts) is unreferenced dead code.

The review comments raised here were real, and I've ported the still-live ones onto main's current code in PR #67 (now merged): deleteField undo restoring cell values, kanban Unassigned column + multi_select grouping, multi_select cell editor, importBundle ref remap, sidebar complex-packet preview, concurrent planting serialize, and sprout forward-reference base ids.

@mberrys mberrys closed this Sep 5, 2026
@mberrys
mberrys deleted the cr/seed-packets-8214 branch September 5, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants