docs(plans): add editor asset library plan (NES-1614)#9155
Conversation
Land the Editor Asset Library plan on main as the durable source of truth, independent of the throwaway prototype PR (#9102) where it currently lives. Covers: - 2026-04-28 approach pivot (per-tab history backed by CloudflareImage / MuxVideo, dropping the Block-table and standalone Library tab approaches). - 2026-05-01 v1 ship state and v1.1 team-shared visibility plan, including the persisted teamId design (asset's home team is derived from journey.teamId at upload time). - mediaLibrary LaunchDarkly flag gating for production rollout. - Quick-start (Template Customization) flow scoped out per Lyuba's feedback. - Historical pre-pivot Relay / imageBlocksConnection material retained as a decision trail and clearly marked as superseded.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a comprehensive Editor Asset Library plan documenting a pivot (2026-04-28) from Block-centered history to per-tab history backed by CloudflareImage and MuxVideo rows. Defines v1 (personal per-tab grids, nullable ChangesEditor Asset Library Plan
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit 1387dd4
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md`:
- Line 556: Add a language tag to the fenced code block in the markdown so
markdownlint MD040 is satisfied; update the opening fence from ``` to something
like ```text (e.g., ```text) for the block that lists the
Editor/Slider/ImageBlockEditor paths so the code fence has an explicit language
specifier.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 73059e16-306e-4e22-ab97-7d7dade3957d
📒 Files selected for processing (1)
docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md
There was a problem hiding this comment.
♻️ Duplicate comments (1)
docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md (1)
571-571:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd a language tag to the fenced code block.
At Line 571, the fence opens without a language identifier, which triggers markdownlint MD040. Please change it to something like
```text.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md` at line 571, The markdown fenced code block currently opens with an unlabeled backtick fence ("```"), which triggers markdownlint MD040; update that opening fence to include a language tag (for example change "```" to "```text") so the block is explicitly labeled and the lint rule is satisfied.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md`:
- Line 571: The markdown fenced code block currently opens with an unlabeled
backtick fence ("```"), which triggers markdownlint MD040; update that opening
fence to include a language tag (for example change "```" to "```text") so the
block is explicitly labeled and the lint rule is satisfied.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4ea0ba52-4f92-4348-95e2-df72505997c2
📒 Files selected for processing (1)
docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md
Replace the two-grid v1.1 design ("Your uploads" + "Team uploads")
with a single merged grid titled "Uploads" that surfaces both the
caller's own uploads and the active team's uploads in one
chronological feed.
Why: clearer mental model — users see everything they can re-pick
from the active team without scanning two stacked grids.
Changes:
- Resolver: when teamId arg is provided, predicate becomes
`userId = caller OR teamId = arg` (a row matching both sides
appears once).
- Schema: add (userId, createdAt, id) index alongside the
(teamId, createdAt, id) index so Postgres can bitmap-OR
efficiently across the merged predicate.
- Frontend: a single grid mount per tab/screen instead of two;
takes activeTeam?.id ?? null. No active team → personal-only
fallback.
- Title: "Uploads".
- Behavioral table, performance, auth, tests, phasing all
updated to match.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md (1)
577-577:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd a language tag to the fenced code block.
The code fence should specify a language (e.g.,
text) to satisfy markdownlint MD040 and ensure consistent rendering.📝 Proposed fix
-``` +```text apps/journeys-admin/src/components/Editor/Slider/Settings/Drawer/ImageBlockEditor/🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md` at line 577, The fenced code block lacking a language tag should be updated to include one (e.g., "text") so it satisfies markdownlint MD040 and renders consistently; locate the fence containing the path "apps/journeys-admin/src/components/Editor/Slider/Settings/Drawer/ImageBlockEditor/" and change the opening "```" to "```text" to apply the language tag.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md`:
- Line 577: The fenced code block lacking a language tag should be updated to
include one (e.g., "text") so it satisfies markdownlint MD040 and renders
consistently; locate the fence containing the path
"apps/journeys-admin/src/components/Editor/Slider/Settings/Drawer/ImageBlockEditor/"
and change the opening "```" to "```text" to apply the language tag.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 3bf25ec5-6990-43f0-819e-c12aed307007
📒 Files selected for processing (1)
docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md
There was a problem hiding this comment.
♻️ Duplicate comments (1)
docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md (1)
577-577:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd language tag to fenced code block.
This issue was previously flagged but remains unresolved. The fence at line 577 needs a language identifier to satisfy markdownlint MD040.
📝 Proposed fix
-``` +```text apps/journeys-admin/src/components/Editor/Slider/Settings/Drawer/ImageBlockEditor/🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md` at line 577, The fenced code block containing the path "apps/journeys-admin/src/components/Editor/Slider/Settings/Drawer/ImageBlockEditor/" needs a language tag to satisfy markdownlint MD040; update the fence at that location to include a language identifier (e.g., change ``` to ```text) so the block becomes a labeled fenced code block and rerun linting.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md`:
- Line 577: The fenced code block containing the path
"apps/journeys-admin/src/components/Editor/Slider/Settings/Drawer/ImageBlockEditor/"
needs a language tag to satisfy markdownlint MD040; update the fence at that
location to include a language identifier (e.g., change ``` to ```text) so the
block becomes a labeled fenced code block and rerun linting.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 9fe7beee-3cca-46f9-b84b-5c6f53513248
📒 Files selected for processing (1)
docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md
NES-1627 ships orderBy: { createdAt: 'desc' } (no id tiebreaker) and
indexes without the id column. Update the plan's v1 references and the
v1.1 composite-index design to match.
Microsecond-precision createdAt + single-row inserts make the id
tiebreaker unnecessary in practice. Smaller index footprint, simpler
resolver. If a future bulk-insert path lands, the tiebreaker can be
added back at that point.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md`:
- Around line 143-144: The index definitions still include the id tiebreaker;
remove the id(sort: Desc) entry from the @@index declarations (e.g. change
@@index([userId, createdAt(sort: Desc), id(sort: Desc)]) and @@index([teamId,
createdAt(sort: Desc), id(sort: Desc)]) to @@index([userId, createdAt(sort:
Desc)]) and @@index([teamId, createdAt(sort: Desc)]) respectively), and repeat
the same removal for the other occurrences noted (lines referenced as 150–151 in
the comment).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 69ebf3b7-e85e-4675-86f5-0acc27334f2d
📒 Files selected for processing (1)
docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md
| @@index([userId, createdAt(sort: Desc), id(sort: Desc)]) | ||
| @@index([teamId, createdAt(sort: Desc), id(sort: Desc)]) |
There was a problem hiding this comment.
Remove id column from index definitions to match the design decision.
The PR objectives state that NES-1627 removed the id tiebreaker from the orderBy/index design, with the rationale that "microsecond-precision createdAt plus single-row inserts make the id tiebreaker unnecessary." However, the index definitions here still include id(sort: Desc).
📝 Proposed fix to align with the shipped design
model CloudflareImage {
// ... existing fields
teamId String?
- @@index([userId, createdAt(sort: Desc), id(sort: Desc)])
- @@index([teamId, createdAt(sort: Desc), id(sort: Desc)])
+ @@index([userId, createdAt(sort: Desc)])
+ @@index([teamId, createdAt(sort: Desc)])
}
model MuxVideo {
// ... existing fields
teamId String?
- @@index([userId, createdAt(sort: Desc), id(sort: Desc)])
- @@index([teamId, createdAt(sort: Desc), id(sort: Desc)])
+ @@index([userId, createdAt(sort: Desc)])
+ @@index([teamId, createdAt(sort: Desc)])
}Also applies to: 150-151
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md` around lines 143
- 144, The index definitions still include the id tiebreaker; remove the
id(sort: Desc) entry from the @@index declarations (e.g. change @@index([userId,
createdAt(sort: Desc), id(sort: Desc)]) and @@index([teamId, createdAt(sort:
Desc), id(sort: Desc)]) to @@index([userId, createdAt(sort: Desc)]) and
@@index([teamId, createdAt(sort: Desc)]) respectively), and repeat the same
removal for the other occurrences noted (lines referenced as 150–151 in the
comment).
Summary
Lands the Editor Asset Library plan (
docs/plans/2026-04-28-001-feat-editor-asset-library-plan.md) onmainas the durable source of truth.The plan currently only exists on the prototype branch (
04-28-ES-feat-editor-asset-library-personal/ PR #9102), which is a throwaway. Production work for the Media Library Picker project will be tracked via Linear milestones cut from this plan, so the plan needs to live onmainindependently of the prototype.The plan covers:
CloudflareImageandMuxVideo, replacing the rejectedBlock-table-as-source-of-truth and standalone Library tab designs.teamIddesign where each asset's home team is derived fromjourney.teamIdat upload time, so assets stay with the team after the uploader leaves.mediaLibraryLaunchDarkly flag gating for production rollout — the three grid mount points are gated; backend additive changes (isAicolumn,orderBycorrectness) ship unflagged.imageBlocksConnectionmaterial retained as a decision trail and clearly marked as superseded.Test plan
Summary by CodeRabbit