Repository navigation
feat: per-column pin-to-front toggle - #59
Merged
Merged
Conversation
Adds an optional `pinned` boolean to every column. When set, the column renders before every unpinned column in the deck regardless of its stored DnD position and regardless of the active tab group, so a few priority columns (main token, primary repo, primary feed) stay at the left edge across reloads, tab switches, and reorders. Pairs with tab groups (PR #53) and column collapse (PR #55) on the deck-density axis: tabs = "which columns am I looking at" pin = "always visible regardless of active tab" collapse = "how prominent within the visible set" Migration 0007 adds the boolean column with DEFAULT false NOT NULL — existing rows backfill to false so the feature is opt-in. Server action, store action, configure-dialog field, deck-board sort (stable so DnD order within each group is preserved), and column-header Pin icon badge (plus a brand-coloured Pin icon in the collapsed strip so a pinned column quietly accumulating alerts isn't visually demoted when folded). DnD across the pin/unpin boundary is intentionally a no-op: the Pin checkbox in Configure is the explicit affordance for crossing the boundary. Reordering within each group still works. Round-trips through deck export / import / share-link fragments and through version-history snapshots (captureDeckSnapshot routes through exportDeck, and the Zod schema accepts the new field with a plain boolean coerce so a hand-edited payload can't smuggle a truthy non- boolean past the DB cast). DeckTemplateColumn carries the field too so a starter template can ship with priority columns already pinned. Could not run Next 16 build / typecheck (offline sandbox — same constraint as PRs #49/#50/#51/#52/#53/#55/#56/#58). Manual review only. Repo-actions idea 2026-06-02 #4. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The tab filter ran before the pin partition, so a column that was both
pinned and tab-tagged was dropped when viewing a different tab — breaking
the feature's own promise and the Configure dialog / header-tooltip copy
("stays visible on every tab"). Let pinned bypass the tab filter.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
aaronjmars
added a commit
that referenced
this pull request
Jun 4, 2026
…tings (#60) * feat(columns): per-column duplicate — clone a column with all its settings Adds a "Duplicate" entry to every column's More-menu dropdown. Click → the source column's persisted settings (typeId, config, alertKeywords, notifyWebhookUrl, refreshIntervalSeconds, filterKeywords, excludeKeywords, tabGroup) clone into a new column titled "<source> (copy)" inserted immediately after the source in the same deck. What it pairs with ================== 6th rung on the per-column UX axis: May-29 tab groups (#53) — "which group am I looking at" May-30 collapse (#55) — "how prominent within the group" May-31 JSON export (#56) — "get the data out" Jun-02 quick-search (#58) — "find an item in this column" Jun-03 pin-to-front (#59) — "always visible regardless of tab" Jun-04 **duplicate (this PR)** — "fork this column to view it twice" The common operator move: maintain two CoinGecko columns for BTC and ETH, two GitHub repo columns for two different repos, two RSS columns with different include filters. Before this PR the operator had to add a brand-new column and re-enter every config field. After this PR: 1 click, optionally tweak in Configure, done. The Configure dialog is exactly where the operator drifts to next — the existing config form needed no changes to support this flow. Implementation ============== **Server (`app/actions.ts`, +77).** New `duplicateColumn(sourceId, newId, newTitle)` server action: - captureDeckSnapshot before the structural mutation — same reversibility contract as createColumn / deleteColumn / reorderColumnsInDeck. Version history catches an accidental duplicate - Shifts every column with `position > src.position` right by 1 (`UPDATE columns SET position = position + 1`) so the duplicate can land at `src.position + 1` without renumbering the whole deck - Inserts the new row inheriting every persisted setting. Inherits `notifyWebhookUrl` (this is an in-install copy not an export, so the secret stays inside the trust boundary it was already configured within). Pinned is deliberately NOT inherited - Title `.trim().slice(0, 256)` — same 256-char cap as renameColumn so a long-source title can't silently expand on copy - Returns `ImportedDeckColumn | null` — the shape importDeck already emits, so the store layer can rehydrate optimistic state from the same type that round-trips through every other column-create path **Store (`lib/store/use-deck-store.ts`, +69).** New `duplicateColumn` zustand action: - Reads source from state, locates the owning deck by scanning `decks[*].columnIds` (columns are a flat map across decks — no parent-deck field on the column itself) - Generates a new id via nanoid and a title of `"<source> (copy)"` identical to the server cap - Optimistic state: inserts the new column right after the source in `decks[deckId].columnIds[]` so the visual order matches where it will land server-side after the position shift + insert - Fires the server action via the same `fireAndLog` pattern as every other mutation; the returned `ready` promise lets autoFetchColumn wait for the FK to exist before persisting feed_items (same race guard addColumn already needs) - Returns `{ id, ready } | null` so callers can decide whether to surface the new column on creation (consistent with addColumn's return shape) **UI (`components/column/column-card.tsx`, +14).** "Duplicate" entry in the More dropdown, between Rename and Download (item) — natural ordering: rename in place, then a structural action that creates a new column with the existing config, then the read-only export. Uses the lucide-react `Copy` icon (newly imported alongside the existing pin / download / settings glyphs). Toast on success names the new column so the operator can spot which row appeared mid-deck. Decisions ========= 1. **Insert after source, not at end.** Inserting at end forces the operator to drag-scroll to find their copy in a 15-column deck — the opposite of what a duplicate action is for. The position-shift is one extra UPDATE; the UX cost of "where did my copy go" dwarfs the SQL cost. 2. **Inherit notifyWebhookUrl, drop pinned.** Pinning is a deliberate "this is a primary column" decision; mirroring PR #59's "DnD across pin/unpin no-op — Pin checkbox is the explicit boundary affordance" rule, crossing the pinned boundary always requires the operator's explicit say-so. notifyWebhookUrl is install-private and we're staying inside the same install — duplicate is not an export, the secret never leaves the trust boundary. 3. **Title `"(copy)"` not `"Copy of X"`.** Same as finders + most cloud doc apps — postfix reads better mid-deck because the column header shows the original title first and the disambiguator second. Operator can rename via the existing Rename action. 4. **No DB schema change.** Reuses the existing columns table — same pattern as PR #58 (quick-search, view-state only) but persistent instead of ephemeral. No migration. No version-bump. No round-trip risk: a duplicated column is just a new column row, exported and imported identically to any other. Could NOT run Next 16 build/typecheck (offline sandbox — same constraint as PRs #49/#50/#51/#52/#53/#55/#56/#58/#59). Manual review against the existing column-card / use-deck-store / actions patterns only. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(columns): wrap duplicate shift+insert in a transaction; copy config The position-shift UPDATE and the INSERT were two separate awaited statements — a crash between them left later columns shifted right with no duplicate filling the gap. Wrap both in db.transaction(), mirroring importDeck. Also shallow-copy config in the optimistic store insert so the clone never shares the source's config object reference. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: aeonframework <aeonframework@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
aaronjmars
added a commit
that referenced
this pull request
Jun 5, 2026
* feat: per-column color labels 7th rung on the per-column UX axis after tab groups (PR #53) → collapse (PR #55) → JSON export (PR #56) → quick-search (PR #58) → pin (PR #59) → duplicate (PR #60) → **color labels (this PR)**. Per-column 6-hex color label (e.g. #f97316). When set, the column renders a small color dot beside its title in the expanded header and replaces the brand accent gradient at the top of the collapsed strip with the operator's chosen color. Lets operators apply a group-level color code at a glance (DeFi orange, GitHub repos blue, social purple, news yellow) for instant deck scanning at 10–15 columns per deck. Independent of tab groups (hide/show) and pin (reorder): color is the "what kind of column is this" marker layered on top of both. A pinned collapsed orange column stays pinned + collapsed + orange. 10 files +205: - drizzle/0008_column_color.sql + meta/0008_snapshot.json + journal (additive nullable text column; existing rows backfill to NULL = no color = default brand accent — no churn on existing decks) - lib/db/schema.ts: text("color") field - lib/columns/types.ts: Column.color?: string with full doc on the visual semantics + server-side hex normalization rule - lib/deck-templates.ts: DeckTemplateColumn.color?: string so starter decks can ship pre-colored lanes - app/actions.ts: COLOR_HEX_RE + normalizeColumnColor() canonical server-side validator (lowercased, 6-hex only — 3-hex shorthand and named colors deliberately rejected so the stored form is canonical); updateColumnColor() server action; importedColumnSchema Zod regex + importDeck re-validates through the normalizer (drop invalid like notifyWebhookUrl's SSRF guard, never abort the import); exportDeck emits when set; duplicateColumn inherits color (unlike pinned which doesn't — color is a labeling decision, pin is a routing decision); loadSnapshot maps the field through to the wire shape - lib/store/use-deck-store.ts: updateColor() optimistic action mirroring server normalization; importedDeckPatch + duplicateColumn optimistic mirror; serverUpdateColor + normalizeColumnColor imports - components/column/configure-column-dialog.tsx: new "Color label" field with 8 preset swatches (orange/green/blue/purple/pink/yellow/ cyan/slate) + Clear button + freeform hex input with live validation; invalid hex shows inline error and disables save until cleared or fixed - components/column/column-card.tsx: (a) expanded header — 10px circular color dot next to the title when set; (b) expanded header accent gradient at top uses column.color when set, falls back to type.accent; (c) collapsed strip accent gradient same fallback — a collapsed column with color set is instantly identifiable as "that orange one" without reading the rotated title Three key design decisions: 1. **Color IS inherited on duplicate; pinned is NOT.** Color = visual labeling ("what kind of column?"); pin = routing ("is this a primary column?"). Duplicating a DeFi-orange column should give you another DeFi-orange column. Mirrors the cleaner version of PR #59/#60's pin/lane distinction. 2. **Server-authoritative hex regex.** /^#[0-9a-f]{6}$/i applied at both updateColumnColor and importDeck normalization, lowercased, 6-hex only. A tampered or hand-edited export can never smuggle a non-canonical color (named CSS colors, 3-hex shorthand, non-hex input, JS expressions in style) into the DB. 3. **Round-trips through export / import / share links + snapshots.** Same shape as PR #59's pinned (DB-backed, not view-state) because color is a persistence decision about the deck's identity — view- state would re-create the problem the feature exists to solve. Deck snapshots already serialize via exportDeck so version history restores colors with no migration on existing snapshot rows. Could NOT run Next 16 build/typecheck (offline sandbox — same constraint as PRs #49/#50/#51/#52/#53/#55/#56/#58/#59/#60). Manual review only. * fix(import): don't abort deck import on a malformed column color importedColumnSchema validated `color` with .regex(COLOR_HEX_RE), so a single bad color in a hand-edited or shared payload failed safeParse and threw, aborting the entire deck import — the opposite of the documented "dropped, not fatal" contract, and inconsistent with how notifyWebhookUrl is handled. Relax the Zod field to a loose .max(64) bound (mirroring notifyWebhookUrl) and let the imperative normalizeColumnColor(c.color) in importDeck drop invalid values to null. Behavior now matches the inline comments and the graceful degradation the PR describes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: aeonframework <aeon@aeonframework.dev> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 6, 2026
aaronjmars
added a commit
that referenced
this pull request
Jun 7, 2026
…-column UX axis (#63) Per-column three-step width override: narrow (240px), normal (360px, historical default), wide (480px). Selectable from each column's More-menu dropdown — three entries between Download items and Delete, each showing a Check icon next to the active width. Width is view-state only, NOT persisted (same lifetime as collapsedColumnIds and searchByColumn) — reload returns every column to 360px, deck export / import / share-links carry no width data. A crypto price column is densest narrow (~180px content fits at 240); a news feed reads best wide (headline text wraps badly at 360). Three discrete sizes cover the real spread without a drag-resize handle that would compound poorly with collapse (PR #55) and pin (PR #59). 8th rung on the per-column UX axis (tab groups May-29 PR #53 → collapse May-30 PR #55 → JSON export May-31 PR #56 → quick-search Jun-02 PR #58 → pin Jun-03 PR #59 → duplicate Jun-04 PR #60 → color Jun-05 PR #61 → width). Key design decisions: 1. View-state, not DB-backed — matches the rule used for collapse / search / selected tab. Going DB-backed would mean a migration, server action, DECK_EXPORT_VERSION bump, round-trip through every export/import/share-link/snapshot path — none of that pays for itself for an ergonomic-only knob. 2. Three steps, not a drag-resize handle — continuous resize compounds poorly with collapse (where does collapse expand restore to?), pin, and color label affordances. 3. Default unchanged — null branch is character-identical to the prior single class. Every existing column renders pixel-identical until the operator opts in. 4. Mobile clamps regardless of width override — a 480px wide column would overflow a phone viewport; mobile keeps the min(360, vw-1rem) clamp on narrow + wide too. 5. Collapse owns its 48px strip — width re-applies on expand from the in-memory map. 6. Same-width re-click is a no-op (returns prior state object) so React skips re-render on a hot menu path. 2 files +109/-2. NO DB schema, NO migration, NO server round-trip, NO plugin contract touched, NO version bump on DECK_EXPORT_VERSION. Could NOT run Next 16 build/typecheck (offline sandbox — same constraint as PRs #49/#50/#51/#52/#53/#55/#56/#58/#59/#60/#61/#62). Co-authored-by: Aeon <aeon@aeonframework.dev>
8 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.
What
Adds an optional
pinnedboolean to every column. When set:UI:
Why
Operators running 10–15 column decks frequently have 2–3 "always visible" priority columns (their main token, primary GitHub repo, primary news feed) that they need at the left edge regardless of topic. The existing DnD reorder fixes position only for that session — a page reload restores the DB-saved order. Pinning makes priority columns sticky.
Pairs with tab groups (PR #53) and column collapse (PR #55) on the deck-density axis:
Changes — 11 files, +528/-9
DB schema
drizzle/0007_column_pinned.sql: additivepinnedboolean column oncolumns(DEFAULT false NOT NULL — existing rows backfill safely; no nullable churn).drizzle/meta/_journal.json: new entry idx 7.drizzle/meta/0007_snapshot.json: snapshot for the migration.lib/db/schema.ts:booleanimport +pinnedfield.Types
lib/columns/types.ts:Column.pinned?: booleanwith inline doc explaining the sort-order interaction.lib/deck-templates.ts:DeckTemplateColumn.pinned?: booleanso a starter template can ship with priority columns already pinned.Server actions
app/actions.ts: newupdateColumnPinned(id, pinned)server action.loadSnapshotmapping reads the field. ZodimportedColumnSchemaacceptspinned: z.boolean().optional()andimportDeckcoerces to a hard=== truebefore persisting so a hand-edited payload can't smuggle a truthy non-boolean past the DB cast.exportDeckemits the field for pinned columns only (omitted when false to keep the payload tight — same pattern astabGroup/alertKeywords).Store
lib/store/use-deck-store.ts:updatePinned(columnId, pinned)action mirroring the server normalization; new field round-trips throughimportedDeckPatchfor import + restore-from-snapshot.UI
components/column/configure-column-dialog.tsx: new Pin to front checkbox in a labeled card under the Tab group section. Save flow only persists when the value changed.components/deck/deck-board.tsx:visibleColumnIdsnow sortspinnedfirst via a stable two-pass partition (preserves DnD order within each group). DnD across the pin/unpin boundary is intentionally a no-op — the Pin checkbox in Configure is the explicit affordance for crossing the boundary; auto-flipping the pinned flag on a drag would be surprising.components/column/column-card.tsx: Pin badge in the expanded header (brand colour, between the refresh-interval badge and the Search icon) + a small Pin icon in the collapsed-strip indicator stack so a pinned column folded mid-session keeps its visual marker.Key design decisions
collapsedColumnIds/searchByColumn/selectedTabByDeck(which clear on reload), pin survives reloads — it's a persistence choice about which columns are primary. View-state would re-create the problem the feature exists to solve.Array.prototype.sortwould also work, but a two-pass partition is more obviously O(n) and reads exactly as intended ("pinned first, then everything else, both in their existing relative order").captureDeckSnapshotroutes throughexportDeck; restore routes throughimportDeck. Both ends emit and accept the field, so version history survives the change.Test plan
"pinned": trueonly for pinned columns; import → pinning round-trips.Repo-actions context
2026-06-02 idea #4. Sandbox can't run Next 16 build/typecheck (established constraint from PRs #49/#50/#51/#52/#53/#55/#56/#58) — manual review only.
Built autonomously by Aeon.