Marks the correctness and search-depth phases as delivered, notes what is still outstanding inside them, and records the measured cost of widening the scan. Frames the review section as the state at the time of writing, since several findings no longer describe the code. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DzALEq9gGWwFmwTdgAiFcY
20 KiB
Finder — review and expansion roadmap
Context
The Finder is a mod+F modal that searches the rundown and jumps to an entry. At the time of this
review it was four files and ~370 lines, essentially untouched since introduction, with no tests and
mounted only in the rundown editor.
This document reviews the feature and sets out a roadmap. The framing question was a business-development one: is it worth investing in, and can it beat the competition?
Scope decided for the roadmap: editor + cuesheet, navigation-only (the Finder reveals entries, it does not act on them), and results stay in rundown order — no ranking.
| File | Role |
|---|---|
apps/client/src/views/editor/finder/Finder.tsx |
Modal, input, result list, footer hints |
apps/client/src/views/editor/finder/useFinder.tsx |
Search logic |
apps/client/src/views/editor/finder/Finder.module.scss |
Styling |
apps/client/src/features/rundown/placements/FinderPlacement.tsx |
mod+F hotkey + mount |
1. Review findings
This section records the feature as it stood when reviewed, and is kept as the rationale for the roadmap below. The findings in 1.1, 1.2 and 1.6 have since been addressed — see phases 1 and 2.
1.1 It doesn't search what people search for
A bare query is title-only. The two things an operator has in their head are the cue and something written in a note or custom field.
- Typing
Q12finds nothing — you must know to typecue Q12. noteis never searched, on any entry type.customfields are never searched. This is the real indictment: Ontime invites teams to model their show in custom fields, then makes that data unfindable.- Milestones carry a
cuein the type, but only their title is matched. - Prefixes are brittle:
INDEX 4works (input is lowercased) butindex4andcue:Q12don't, and any title beginning "cue " or "title " can't be found as typed.
1.2 Two live bugs
- Stale selection.
selectedis never reset whenresultschanges — not on a new query, not on the background-refetch replay atuseFinder.tsx:228-236. If the list shrinks,results[selected]isundefinedandselect()throws on.id. - Click hits the wrong row.
onClick={submit}readsselectedfrom state, not the clicked element. It works only because amousemovenormally precedes the click — touch input navigates to the wrong entry. That's precisely the backstage-tablet case.
Two smaller ones: mod+F doesn't close the modal (Mantine's useHotkeys ignores INPUT, so the
toggle stops firing once focus is in the box), and the index <n> bound compares against the flat
entry count instead of the event count.
1.3 Nobody can find the Finder
There is no visible affordance anywhere. The only discovery path is the shortcut cheat sheet in
EventEditorEmpty.tsx — which you see only when nothing is selected. Neither RundownHeader.tsx nor
the cuesheet toolbar has a search control.
On touch there is no keyboard, so RundownHeaderMobile.tsx having no search button means the Finder
is completely unreachable on mobile and tablet — the devices where finding an event by scrolling
is hardest.
1.4 Reach
Editor-only. But apps/client/src/views/cuesheet/cuesheet-table/CuesheetTable.tsx:160 already
registers a scroll handler commented "for explicit jumps (finder/keyboard)" — the plumbing was
anticipated and built, the Finder was never mounted there. Cheapest high-value win available.
Constraint: the cuesheet is permission='operator' and can be exposed via URL presets with
per-column read permissions (cuesheet.policies.ts, getCuesheetColumnAccessPolicy().canRead(key)).
Searching notes and custom fields there must filter through that policy, or a locked-down preset
link leaks columns it was configured to hide. Data exposure, not a nicety.
1.5 Index source — a trap worth naming
useFinder re-implements the 1-based eventIndex walk that common/utils/rundownMetadata.ts
already computes. Tempting to just reuse useFlatRundownWithMetadata() — don't: its memo depends
on selectedEventId, so it recomputes on every event load during a show, and it spreads every entry.
useFlatRundown has the same class of problem (memoised on the react-query object, replaced on every
refetch). Build from raw rundown.entries + flatOrder, memoised on rundown.revision.
1.6 Tests
No unit or component tests, and useSelectAndRevealEntry is untested too. E2E coverage is a single
smoke test — Find in rundown in e2e/tests/features/209-rundown-shortcuts.spec.ts opens the modal
with mod+F and closes it with Escape. Nothing exercises searching, selecting, or navigating
results, so every behaviour described above is unguarded.
2. Business-development assessment
A command palette alone is table stakes — every modern tool has one. Shipping mod+K wins nothing.
A runtime-aware, multi-surface finder is a real wedge. Shoflo,
Rundown Studio and Cuez are cloud
rundown editors — their search is document search over a document you're authoring. Ontime knows
show state: what's loaded, what's past, the offset, what's flagged. A finder that marks the loaded
event and shows scheduled time and delay per row is a different category of tool, and that data
already exists in RundownMetadata and is currently discarded. Add that it works identically on the
FOH editor and a backstage tablet, and it's a coherence story the single-web-app competitors can't tell.
Honest counterweight: don't oversell this internally. This is a retention and credibility feature, not an acquisition one. Nobody picks Ontime over Shoflo for a search box. What it does: removes a recurring "I can't find my event" friction that bites hardest at the worst moment, makes the custom-fields investment finally pay off, and makes Ontime feel professional to the power users who become advocates.
And the biggest problems here are bugs, absent scope and invisibility — not missing sophistication. Sequence accordingly.
3. Roadmap
Estimates assume one developer familiar with the codebase.
Phases 1 and 2 are delivered; the remaining phases are proposals. Items still outstanding inside a delivered phase are called out where they sit.
Phase 1 — Correctness (done)
- Track
selectedId, notselectedIndex— derive the active row by id lookup, falling back to the first. Correct across updates, reordering and result changes; better than "reset to 0", which throws away the user's position on every refetch. - Pass the result to the click handler; delete the
data-index/dataset.indexmechanism. - Ignore pointer-move events where the cursor hasn't moved — otherwise arrow-key navigation scrolls the list under a stationary cursor, fires a move event, and yanks the selection back. The 12-result cap hides this today; a longer list won't.
- Scroll the active row into view on arrow navigation.
mod+Fopens and closes from anywhere. The hotkey hook skips input elements by default, so the shortcut was dead while editing an entry — exactly when a user reaches for it. Opting out of that lets one binding both open and close. The globalEscapehandler is gone; Base UI'sDialogalready dismisses, andpreventDefault: truedocument-wide conflicted with inline field editing.- Fix the
index <n>bound to use the event count. - Search milestones by cue. The cue search only walked events, so a milestone could never be found by the cue it displays.
Phase 2 — Search depth (done)
- Search cue + title + note + text custom fields across events, groups and milestones on a bare
query.
imagecustom fields are skipped — they hold a URL. - Filter badges. The syntax was previously discoverable only through a line of footer text.
A badge row now offers the fixed fields plus every project custom field, scoping the search while
keeping what the user already typed. Both
cue xandcue:xparse, so badges and typing agree. - Keep rundown order — no ranking. Deterministic, and it keeps results predictable during a show. The honest consequence: matching more fields while holding position order means a distant cue match can be pushed off by nearer note matches. Mitigated by raising the cap, reporting the true total, and naming the matched field per row.
- Name the matching field with an excerpt, so a hit inside a long note is legible.
- Results are a pure derivation of (data, query) — the controlled input removed the
useEffectthat replayed the last search on rundown changes, and with it the stale-index crash.
Measured cost of widening the scan — cue + title + note + 3 custom fields versus title alone:
| Rundown | Title only | All fields | All fields, prebuilt index |
|---|---|---|---|
| 200 | 0.061 ms | 0.051 ms | 0.020 ms |
| 1,000 | 0.149 ms | 0.112 ms | 0.020 ms |
| 5,000 | 0.608 ms | 0.563 ms | 0.116 ms |
All-fields measures the same as title-only at every size — both are dominated by loop overhead rather than string comparison. Performance was never the reason to search one field.
Still outstanding from this phase: flag: and group: filters; highlighting the matched
substring within the excerpt; unit tests for the query parser (covered by e2e today, but the parser
is now a pure function and worth testing directly — the highest-value case is index <n> staying
aligned with 1-based UI indices when delays, groups and milestones interleave).
Phase 3 — Visibility, UX and polish (~1 day, partly done)
This is the phase that changes how many people ever use the feature.
Visibility
- Add a search control to
RundownHeader.tsxwith themod+Fhint visible on it. Single biggest discoverability win. - Add one to
RundownHeaderMobile.tsx— mandatory, not optional: without a keyboard the feature currently does not exist on touch devices. - Add one to the cuesheet toolbar when the Finder mounts there (Phase 4).
UX
- Fix the empty state — it shows "No results" before you've typed anything. Show the filter hints, or recent searches, on open.
- Align with the app's other search box.
SettingsSearch.tsxhas a leadingIoSearchicon and a clear button; the Finder has neither. Two search boxes in one app should look like one idea. - Show result count ("showing 12 of 47") instead of a silent cap.
- Indicate entry type — events, groups and milestones are visually identical today apart from
the index showing
-. - Show group breadcrumbs, so hits inside collapsed groups are legible.
- Preserve the last query on reopen, selected so typing replaces it.
Home/End/PageUp/PageDownin the result list, matchinguseRundownKeyboard.
Polish
- Use
getAccessibleColour(common/utils/styleUtils) for the index badge. It currently setsbackground: var(--color)raw with fixed foreground text, so a light entry colour is unreadable. The cuesheetEventRow,MilestoneRowandOperatorEventalready do this correctly — the Finder is the odd one out. - Fix row text handling — fixed
3remrows with no ellipsis on long titles, and.cuecapped atmax-height: 1em, which clips descenders. - Stop the
Go ⏎label shifting layout when it appears only on the selected row. - Give the modal a real header instead of
title='', which renders an empty header area. - Reconsider the 100 ms debounce — with a controlled input (item 11) it's unnecessary at these rundown sizes and just reads as lag.
Phase 4 — Cuesheet (~1 day)
- Move the Finder out of
features/rundown/placements/— it stops being an editor view once it has two homes — and mount it in the cuesheet. Pass surface and permission explicitly from the mount site rather than inferring them. - Gate searchable fields through
getCuesheetColumnAccessPolicy().canRead(key)(§1.4). Non-negotiable. - Show runtime state in results — loaded event badged, past entries dimmed, scheduled time and delay per row. Source at render time, not by rebuilding the index (§1.5). This is the differentiator from §2.
- E2E spec alongside
209-rundown-shortcuts.spec.ts, covering both surfaces, with a regression lock for the click bug: click the third result without hovering the first two, assert the third entry is selected.
Phase 5 — Find and replace (~3–4 days)
The strongest expansion, and a better business case than a command palette: renaming a sponsor, speaker or venue across a 200-entry rundown is a real recurring pain that the competitors' spreadsheet-shaped editors handle badly. It also makes custom fields markedly more valuable.
It does not live inside the Finder modal. The Finder is a fast, non-destructive jump box and
Enter must stay safe. The codebase already has the right pattern for this:
renumber-cues-dialog/RenumberCuesDialog.tsx — a bulk mutation with its own dialog, its own
endpoint, and useEventSelection.selectedEvents as its scope. Find-and-replace should be its
sibling, reachable from RundownMenu.tsx (which today holds only "Manage Rundowns…" and "Clear
all") and optionally mod+shift+F.
What the Finder actually contributes is its matcher. That's the real expansion: Phase 2's parser/matcher must be built as a shared module rather than Finder-private code, so find, preview and replace all agree on what "matches" means.
32. The server gap — this is the actual work. batchEditEntries (rundown.service.ts:166)
applies one patch to many ids. Find-and-replace needs per-entry distinct values — each
entry's own title with its own substring swapped. Two options:
- N ×
putEditEntry: N round trips, N revision bumps, NnotifyChangesbroadcasts. During a show that's N timer notifications for one user action. Not acceptable at 40 entries. - A new endpoint taking
Array<PatchWithId<OntimeEntry>>applied inside onecreateTransaction/commit— one revision bump, one broadcast. Sits next tobatchEditEntriesand reuses the same machinery. Perhaps 40 lines, and it's the thing that makes everything below possible.
33. Replaceable fields — deliberately narrow.
- Safe:
title,note, textcustomvalues. Free text, no structural meaning. - Opt-in and validated:
cue. It's a numbering scheme, not free text —cueUtilshasgetIncrement/getCueCandidateand the Renumber dialog exists precisely because of that. The server also rejects an empty cue outright (rundown.service.ts:177), so a replace that empties one fails the whole batch. - Never: times, booleans, colours, enums, ids,
image-type custom fields.
34. Preview is mandatory, because there is no undo anywhere in this app. I checked — the client has no undo stack of any kind. Find-and-replace would be the first feature that can silently alter dozens of entries. So: show every affected entry with before → after per field, with a per-match opt-out, before anything is written. Confirmation names the count and the field: "Replace 'Q' with 'CUE' in title on 23 entries?"
35. A single-step revert. Because the atomic endpoint gives one revision per operation, capturing the prior values client-side makes "Undo replace" a second batch call. Not an undo history — one step, scoped to the operation, discarded on the next mutation. Cheap, honest, and it's the difference between a feature people trust and one they don't touch during a show.
36. Scoping controls: whole rundown vs. current selection (the RenumberCuesDialog precedent
already reads selectedEvents); restrict to one field; case-sensitive toggle — the Finder is
case-insensitive by design, so replace needs this as an explicit option; whole-word toggle.
37. Guard concurrency. Capture the rundown revision at preview time and reject the apply if it
moved. Prevents replacing text the user never saw someone else write. Cheap.
38. Editor only for v1. The cuesheet is permission='operator' and its URL presets can be
read-only or column-restricted; a correct implementation would have to gate every field through
getCuesheetColumnAccessPolicy().canWrite(key). Finding is safe to expose broadly; replacing is
not. Warn when playback is running rather than blocking.
39. No regex. Live operators, no undo history, and one bad pattern destroys a rundown. Whole-word + case-sensitive covers the real cases — renaming a speaker, a sponsor, a venue.
Rough split: server endpoint ~0.5d, matcher extraction ~0.5d, dialog + preview ~1.5d, revert ~0.5d, tests ~1d.
Not recommended
- Ranking / fuzzy matching. Rundown order is deterministic and simpler, and Ontime cues are short
and numeric-ish (
1,1.5,12A) where subsequence matching is pure noise —12would match1…2across half the rundown. Live operators need predictable results more than forgiving ones. - A worker-side index or a server search endpoint. The client holds the whole rundown; a linear
scan over
flatOrderis microseconds. Add a hard scan ceiling so a pathological spreadsheet import can't freeze the UI thread, and leave it there. - Virtualising the result list. A palette showing 400 rows isn't more useful than one showing 50; scanning is the bottleneck, not rendering. Cap and count instead.
- Implicit cross-rundown search. Revealing an entry in another rundown means changing the
loaded rundown — a destructive runtime action mid-show. Only the cuesheet has a non-destructive
"viewed rundown" concept. If ever wanted, an opt-in
rundown:filter there, never in the editor. - The operator view and public viewers. The operator view never calls
setScrollHandler, so "go to entry" would silently do nothing until one is registered.
4. Verification
Each phase should land behind:
- Unit tests for the query parser and matcher — the highest-value case being
index <n>staying aligned with 1-based UI event indices when delays, groups and milestones interleave. - An e2e spec opening
mod+Fin both the editor and the cuesheet, including a regression lock for the click bug (click the third result without hovering the first two). - A manual pass on a project that leans on custom fields, and one on a touch device — the mobile path is currently unreachable and needs checking by hand.
Two claims in this document are worth re-confirming before they drive a decision, since both are
cheap to check and expensive to be wrong about: the cuesheet permission concern
(cuesheet.policies.ts, useTablePermissions.tsx), and the "relevance not speed" assumption —
count flatOrder length on the largest real project file available rather than trusting the estimate.
Sequencing
1 (0.5d) → 2 (1.5–2d) → 3 (1.5d) → 4 (1d) → 5 (3–4d). Each independently shippable.
If only one thing gets done: Phase 1. If two: Phase 1 + Phase 3 — the bugs and the invisibility are what actually cost users today; the search-depth work matters most once people can find the box.
Phase 5 is the one with a real competitive argument, but it depends on Phase 2 shipping its matcher as a shared module rather than Finder-private code. That's a cheap constraint to honour up front and an expensive one to retrofit — worth deciding before Phase 2 starts, even if find-and-replace is months away.