Skip to content

feat(columns): per-column quick-search input — ephemeral substring filter on top of include/exclude - #58

Merged
aaronjmars merged 1 commit into
mainfrom
feat/column-quick-search
Jun 2, 2026
Merged

aaronjmars merged 1 commit into
mainfrom
feat/column-quick-search

Conversation

@aaronjmars

Copy link
Copy Markdown
Collaborator

What

Adds a per-column quick-search input to every column. Click the new search icon in the column header (between the alert/filter/refresh-interval badges and the Refresh button) and a thin input row drops beneath the header. Type to narrow the visible items live; Esc clears + closes the input; the small × button clears without closing.

Substring match is case-insensitive and scans the same haystack the alert-keyword highlighter uses (item content + author name + author handle + URL), so search semantics are identical to the rules operators already know.

Why

Minitor now ships 47+ column types and operators frequently keep deep-scrolling columns open (Hacker News, github-issues, github-discussions, npm/pypi/crates, polymarket, etc.). The existing include / exclude keyword filters are persistent column config — they survive reloads, travel with deck exports, fire webhooks on new matches. They're the right answer for "always keep this column tuned to X."

But they're the wrong shape for "I have 200 items in this column and I'm looking for the one that mentions postgres." That's an ephemeral, view-only narrowing — the operator doesn't want to reconfigure the column, they just want to find something in the current items. Quick-search is that view.

Search is layered: it never widens past include/exclude, it just narrows what's already visible. So an operator who configured exclude: spam still won't see spam when they search — the include/exclude rules decide what the column contains; search decides what they're looking at right now inside that subset.

Changes

  • lib/store/use-deck-store.ts (+34/-3) — new searchByColumn: Record<columnId, string> view-state map (NOT persisted, same lifetime as autoFetchingIds / selectedTabByDeck / collapsedColumnIds), setColumnSearch(columnId, query) action with trim + 256-char cap + empty-string-deletes, cleanup keys on deleteColumn and deleteDeck so a long session can't accumulate stale entries.
  • lib/columns/keyword-match.ts (+24/-0) — new itemMatchesSearchQuery(item, query) helper. Single literal substring (no comma/semicolon split — search is one query, not a keyword list), scans the same content + author + url haystack as itemMatchesAlertKeywords so the match rules stay consistent.
  • components/column/column-card.tsx (+170/-7):
    • Renamed visibleItems flow to two stages: filteredItems (after include/exclude) → visibleItems (after search). Filter tooltip now reflects filteredItems / column.items; new green search tooltip reflects visibleItems / filteredItems.
    • Alert-match highlighting (matchedItemIds) derives from visibleItems so alerts only highlight what the operator can currently see.
    • Search button in the header toggles the input row. aria-pressed + emerald accent when a query is active.
    • Input row sits between the header and the items list, Esc clears + closes, × button clears in place.
    • useEffect auto-opens the search row when a column re-renders with a non-empty searchQuery already in store (e.g. operator collapses then expands a column mid-search — the query persists in-session).
    • New SearchEmptyState rendered when search active + zero matches, with a one-click clear-search button.
    • Collapsed strip: small emerald Search icon when search is active, so an operator who collapsed a column mid-search still sees that the in-session filter is on (otherwise the match-count badge would silently undercount and look like a refresh problem).

Design decisions

  • View-state only, never persisted. Searches don't survive a reload, don't export with the deck, don't fire webhooks. That's the line that separates this from include/exclude — the same line collapsedColumnIds and selectedTabByDeck already sit on.
  • Search narrows; never widens. Search runs on top of include/exclude, never against the raw column.items. An operator who set exclude: spam and then searches for discount won't be shown spam-with-the-word-discount — the persisted filter wins.
  • Single literal substring, not a parsed keyword list. Reusing parseAlertKeywords would split rust foo into ["rust", "foo"] OR-combined; the operator typing rust foo almost certainly means the phrase. Search and keyword config are intentionally different shapes.
  • Same haystack as alert keywords. Operators already know what the alert highlighter scans — using the same fields keeps the mental model consistent.
  • 256-char cap on the query. Defensive — no operator types a 200-char query, but a runaway paste shouldn't make the substring scan slow.
  • Auto-open on render when a query exists. Covers the cross-tab / cross-collapse case: an operator searching one column then switching to another tab should see the search bar reappear when they come back, because the state survived.
  • Collapsed search indicator. A column collapsed mid-search would otherwise hide the active filter. The small emerald icon on the strip is the cheapest possible "hey, this column has a search on it" signal — no count, no text, just presence.
  • No DB schema, no migration, no server round-trip, no plugin contract touched. Pure view-state work — drizzle isn't involved.

Test plan

  • Open any column, click the search icon, type a substring — items narrow live; the green search badge in the header shows matches/filtered.
  • Press Esc inside the input — clears the query and closes the row.
  • Click the × button — clears in place, input stays open and focused.
  • Search + include/exclude combined: column with exclude: foo set; search for bar. Items containing foo never appear even if they mention bar.
  • Search + alert keywords: alert-keyword highlighting only fires on items still visible after the search; matchCount badge shrinks as search narrows.
  • Collapse a column with active search — the strip shows a small emerald Search icon. Expand — search bar reappears with the same query.
  • Delete a column with active search — no orphaned key remains in searchByColumn (no functional bug; just internal hygiene check).
  • Deck export / import — the exported JSON does NOT contain search state, and importing a deck does NOT restore search state.
  • Type-check could NOT run locally (Next 16 offline sandbox) — manual review against the structurally-similar collapsedColumnIds / autoFetchingIds flows.

Built autonomously by Aeon.

@aaronjmars
aaronjmars merged commit 353d3a1 into main Jun 2, 2026
1 check passed
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 aaronjmars mentioned this pull request Jun 5, 2026
7 tasks
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>
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>
@aaronjmars
aaronjmars deleted the feat/column-quick-search branch June 17, 2026 14:00
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.

1 participant