From a list to a shortlist you can defend
By the end of this lesson you will have a shortlist beside your screen holding three promoted names, each with the sentence you were made to write, under results that say "matches your filters" and name the field they are sorted by.
Your screener returns forty names. Forty is still too many to think about, and the ordering decides which five you actually read. Choose it deliberately.
Sorting is a claim
Build Your First Tool said an ordering is an opinion. In a screener it is stronger than that: the sort decides what gets attention, and everything below the fold effectively does not exist.
So the sort field is not a UI preference, it is part of the question. "Largest market cap" and "highest yield" produce different shortlists from identical filters, and neither is more correct — they answer different questions. Make the person choose, and show what they chose.
Composite scores, and why they mislead
The tempting next step is one number: weight a few fields, add them up, rank by the total.
const score = 0.4 * cheapness + 0.3 * yieldRank + 0.3 * sizeRank; // resist
Three problems, and the third is the serious one.
The weights are invented. Why 0.4? Because it looked reasonable. There is nothing behind it, and the output inherits that nothing while looking quantitative.
It hides its own reasoning. A composite of 7.3 cannot be argued with. You cannot tell whether a name ranked high because it is genuinely cheap or because one component was extreme, and you cannot see which.
It launders a guess into a number. This is the real damage. A ranked list with a score reads as analysis; underneath it is your hunch with decimals. The tool has made you more confident without making you more right.
If you want one, keep the components visible beside the total so the score can be taken apart. Better for now: sort on one field you can name, and let the other columns be read.
The shortlist is the artefact, and it carries reasons
The output of a good screening session is not a list of tickers. It is a handful of names with a sentence each:
NVDA — came up on size and momentum. Watching whether the margin holds. Not acting yet.
You already built this: it is the notes feature from Build Your First Tool, applied to a different surface. (The first lesson of this course put notes under Dies, because a note on a row of a result set that changes every run has nothing to belong to. A name you promoted to a shortlist does stay, which is why the note lives there.) Promote a row from the results into a saved shortlist, and require a note when you do.
Requiring it is the design decision that matters. Without a reason, in three weeks you have a list of tickers and no memory of what you were thinking, which is worth precisely nothing. With it, you can review your own judgement later — and reviewing your own past reasoning is the only way anyone gets better at this.
The line this course does not cross
A screener narrows. A shortlist records what you were thinking. Neither is advice, neither is a recommendation, and the tool must never phrase itself as though it were.
Concretely: no "top picks", no "buy signals", no green ticks on rows. Call it "matches your filters", because that is exactly and only what it is. The moment the interface implies a judgement it did not make, it is lying to the person who trusts it most — the person who built it.
The finance behind it
Before you rank on a multiple, know what a low one can hide: Why can a genuinely "cheap" multiple stay cheap forever?
Try it now
Run a screen, promote three names to a shortlist, and write the sentence for each. Then leave it a week and come back. Whether those sentences still make sense to you is the honest measure of whether this tool is useful — and it is a measure no test suite can give you.
The prompt
Mock mode on, plan mode on, and paste:
Add a shortlist to the screen page. A Promote control on each result
row asks for a note, and nothing is saved without one (the page says
a note is needed): { code, note,
screen (its f= query), addedAt }. Keep it in localStorage under
shortlist-v1, keyed by code, with the same guarded parse as saved
screens, in src/lib/shortlist.ts, tests first. Show the shortlist with
its notes under the results. Let me pick the sort field from the same
allowlist the filters use, limited to fields the table shows as a column,
and name it above the results. The sort goes into the one screener
request the page already makes, so a load costs the same. The heading
says "Matches your filters": no picks, no ticks, no score. No new
request. Done means npm test, typecheck, lint, check:leak green.
A good answer adds src/lib/shortlist.ts, its test and src/components/Shortlist.tsx, and changes the screen page for the heading, the sort choice and the shortlist. The sort field is validated like a filter, because it reaches the request too.
Check it yourself
- Promote a row with an empty note: nothing is saved, and the page tells you a note is needed, in words or with a Save that stays disabled beside a hint until you write one.
- Promote three names with a sentence each and reload: all three are there, notes intact.
- The field the results are sorted by is named above them, and a sort field typed into the address that is not on the list is refused. On mock the fixture answers every sort with the same rows in the same order, so only the name above them changes; the order changes live.
- No heading, row or label says top, picks, buy or signal. A plain verb in a hint, such as "choose another field", is fine.
Compare with ours
// src/lib/shortlist.ts: no sentence, no entry
export type Shortlisted = { code: string; note: string; screen: string; addedAt: string };
export function promote(list: Record<string, Shortlisted>, entry: Shortlisted) {
if (entry.note.trim() === "") return { list, refused: "Write why it is here first." };
return { list: { ...list, [entry.code]: entry } };
}
The full state at the end of this unit is on the starter's branch ref/build-a-screener/u4.
Checkpoint
npm test && npm run typecheck
git status # only the files this step touched, no .env*
git add -A
git commit -m "Shortlist with a sentence per name; results are matches, sorted by a field I name"
Then answer this lesson's questions.