Repository navigation
feat(prompts): let a person show, hide and order the Tracked Prompts columns, and share them with the brand (PROMPT-015, part 1) - #1655
Merged
Conversation
…columns, and share them with the brand (PROMPT-015, part 1) PROMPT-015a. A Columns panel beside the table's search: - show or hide every column but Prompt, and reorder them by dragging or with the arrows; - saved per person and brand (00363 prompt_table_views, RLS); - an admin or manager can share their columns with everyone on the brand, who see them until they change their own; - Reset goes back to the brand's view, or the default. Nobody who never opens Columns sees a change: the default is today's columns in today's order. The table builds its header and cells by column id, unchanged inside. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… brand (PROMPT-015, part 1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…their own view with the brand (PROMPT-015, part 1) Someone looking at the brand's shared view without one of their own changed it with every click: a member got "Only admins and managers can share" errors, and a manager hiding one column changed it for everyone. Changes now update the brand's view only after an admin or manager shared their own, which sharing now also saves as theirs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…able (PROMPT-015, part 1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
9 of 12 tasks
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
…le-columns # Conflicts: # supabase/schema.sql
# Conflicts: # supabase/schema.sql
Collaborator
Author
|
Merged main forward (8356ba3) through the stack; supabase/schema.sql rebuilt. Typecheck and lint pass on the chain tip. |
gkhngyk
approved these changes
Oct 28, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with follow-ups.
Nothing blocks the merge. Apply 00363 before this merges; the web goes out on merge.
What I checked
- Own diff.
3f6a4d4b..293a00b2: 00363 withschema.sqlandsupabase.ts,prompt-table-views.tsandprompt-table-columns.tswith their tests, the Columns panel, the page's column rendering,en.jsonand the guide. The branch starts from an older main. On 8356ba3 onlysupabase/schema.sqlconflicts; rebuild it.page.tsx,en.json,supabase.tsand the guide auto-merge. - 00363.
- The number is free: nothing on main or in another open PR uses 00363.
- RLS is on.
anonhas no grant;authenticatedgets select/insert/update/delete, all filtered by the two policies. - Read: your own row and the brand's row (
user_idnull), only for a brand in your organization. - Write: your own row in your organization's brands; the brand's row only as an admin or manager. The
with checkrepeats theusing, so a row can't be moved to another person, another brand or another organization by an update. - Idempotent:
create table if not exists,drop policy if existsbefore each policy. A new, empty table, so no locks on anything big and no backfill. unique nulls not distinct (brand_id, user_id)gives one brand row per brand, serves the reads, and is whatupsert(..., { onConflict: 'brand_id,user_id' })lands on.- The
columnscheck (object, at most 8 KB) bounds what a client can store. bash supabase/build-schema.shreproduces the committedschema.sql.
- Server actions. Every read and write goes through the caller's own client, so RLS decides. The brand id is checked as a UUID, and the view is checked against the known column ids with a length cap. A write RLS filters to nothing comes back as
forbidden, not as a silent success. - Behaviour. Someone without a view of their own sees the brand's view, and changing it saves only theirs (d6b7e93). The brand's view changes only while an admin's or manager's own view matches it. With no rows, the columns and their order are today's. Unknown ids in a stored view are dropped, and a column added later goes back to its default place.
- Tests and checks. The PR's tests pass (
_columns-panel,prompt-table-columns,prompt-table-views, and the rest of the prompts folder: 10 files, 66 tests). Webtscis clean. eslint and prettier are clean on the touched files.
Follow-ups
- "Shared" is inferred, not stored.
_columns-panel.tsx:65treats an admin's or manager's view as linked to the brand's whenever the two are equal. A second manager whose own view happens to match the brand's (for example after undoing a change) then updates the brand's view on every later click, without having ticked Share. Store who shared it (updated_byon the brand row is there) and link only that person, or keep an explicit flag. updated_byis client-supplied. The policies don't check it, so a member can write any user id there on their own row. Nothing reads it today; if it's ever shown ("Shared by …"), set it in a trigger fromauth.uid().- Two saves, no rollback. A change while shared saves your row and the brand's separately. If one fails, the toast shows, but the two silently diverge and the link drops. Low impact; a single RPC would keep them together.
Rollout
Apply 00363 before merging. Without the table, the page shows today's columns (the read is caught), but every change in Columns shows "Couldn't save your columns."
9 of 12 tasks
9 of 12 tasks
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
PROMPT-015, part 1 of 6: a Columns panel for Tracked Prompts. People can show, hide and order the table's columns, and share their columns with the brand.
prompt_table_views(migration 00363, with RLS):user_idnull);Where people see it: Prompts › Tracked Prompts, the Columns button above the table.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd web && npx vitest run src/app/[locale]/(dashboard)/dashboard/prompts/_columns-panel.test.tsx src/lib/prompt-table-columns.test.tsBrowser check: local, 1024 px, light and dark.
Related issue
PROMPT-015 (location matrix and custom columns), spec and mockup in Drive › Prompt. No GitHub issue.
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Full checks at the top of the stack (part 6, 29f649d):
npm test: 248 files, 3,364 tests passed;vitest(453 files, 4,403 tests) and build: all pass;schema.sqlmatchesbuild-schema.sh.A pre-push review found 9 issues; all are fixed in this stack (the
fix(...)commits). Migrations 00363 and 00364 are applied on the dev database.Follow-ups, not in this stack:
writeUrlParamsfor the layout switch (keeps the hash);removePromptTableViewshould say when nothing was removed;en.json;processTrackingJobtest for country skips.🤖 Generated with Claude Code