Skip to content

Commit 280d3fb

Browse files
authored
refactor(methods): rename family-page feed filter param ?cellLine= → ?entity= (#1234)
The Surface B master-detail feed filter on the method-family page was keyed on ?cellLine=, accurate while every entity was a cell line. As the entity layer broadens past cell lines (ReciterAI #252), the generic ?entity= key is the right contract. Renames the 8 read/write sites (rail set/delete, feed get/set/clear, route validation) plus the doc-comments that document the key. No backward-compat shim: the entity layer is staging-only / prod-off with no external deep-links. Internal cellLine* identifiers are left as-is (no behavior change; out of scope for a URL-param rename).
1 parent d720fb7 commit 280d3fb

5 files changed

Lines changed: 15 additions & 15 deletions

File tree

app/(public)/methods/[supercategory]/[family]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export default async function FamilyPage({
9393

9494
// #1166 — when the family resolves to specific cell lines, the master-detail
9595
// cell-line rail (Surface B §5.1) sits in the left column of the publications
96-
// section, driving the `?cellLine=` feed filter. When there are no cell lines,
96+
// section, driving the `?entity=` feed filter. When there are no cell lines,
9797
// the publications feed renders without the rail.
9898
const hasCellLines = cellLineEntities.length > 0;
9999
const cellLineLabels = Object.fromEntries(cellLineEntities.map((e) => [e.entityId, e.label]));
@@ -232,7 +232,7 @@ export default async function FamilyPage({
232232
<section id="publications" className="scroll-mt-20">
233233
{hasCellLines ? (
234234
// #1166 Surface B — master-detail: the cell-line rail (left) drives the
235-
// shared `?cellLine=` filter the feed (right) reads. Mirrors the
235+
// shared `?entity=` filter the feed (right) reads. Mirrors the
236236
// supercategory layout's sticky-rail + cornell-red divider for parity.
237237
<div className="mt-16">
238238
<hr className="mb-10 border-border" />

app/api/methods/[supercategory]/[family]/publications/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ export async function GET(
106106
// #1166 Surface B — optional cell-line filter. Validated against the opaque-id
107107
// shape; the loader additionally gates it on METHODS_LENS_CELL_LINE_ENTITIES and
108108
// ignores an unknown id (empty feed), so a bad value is a 400 here, never a leak.
109-
const entityIdRaw = sp.get("cellLine");
109+
const entityIdRaw = sp.get("entity");
110110
if (entityIdRaw !== null && !ENTITY_ID_RE.test(entityIdRaw)) {
111-
return apiError("invalid cellLine", 400);
111+
return apiError("invalid entity", 400);
112112
}
113113
const entityId = entityIdRaw ?? undefined;
114114

components/method/cell-line-rail.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #1166 Surface B — the master-detail cell-line rail on the method-family page, the
55
* left column of the publications master-detail (the family-page analog of the
66
* supercategory `FamilyRail`). Lists the specific cell lines the family resolves to,
7-
* usage_count-desc; selecting one sets the shared `?cellLine=<entityId>` filter that
7+
* usage_count-desc; selecting one sets the shared `?entity=<entityId>` filter that
88
* the publication feed reads (spec §6 — one shared, singular filter). No "All" row:
99
* no selection ⇒ the full family list (the feed's default); clicking the active row
1010
* clears the filter back to the full list.
@@ -26,7 +26,7 @@ export function CellLineRail({ entities }: { entities: CellLineEntity[] }) {
2626
const pathname = usePathname();
2727
const searchParams = useSearchParams();
2828

29-
const active = searchParams.get("cellLine");
29+
const active = searchParams.get("entity");
3030

3131
// #1168 — the rail noun comes from the family's dominant entity kind (all
3232
// entities in a family share it), so a reagent/instrument/dataset family reads
@@ -36,8 +36,8 @@ export function CellLineRail({ entities }: { entities: CellLineEntity[] }) {
3636

3737
const onSelect = (id: string | null) => {
3838
const params = new URLSearchParams(searchParams.toString());
39-
if (id === null) params.delete("cellLine");
40-
else params.set("cellLine", id);
39+
if (id === null) params.delete("entity");
40+
else params.set("entity", id);
4141
// Reset the feed to page 1 on a filter change (mirrors the prior strip).
4242
params.delete("page");
4343
const qs = params.toString();

components/method/family-publication-layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ export function FamilyPublicationLayout({
3939
supercategorySlug: string;
4040
familySegment: string;
4141
familyLabel: string;
42-
/** #1166 — entity id → label for the feed's `?cellLine=` context-bar chip. */
42+
/** #1166 — entity id → label for the feed's `?entity=` context-bar chip. */
4343
cellLineLabels?: Record<string, string>;
4444
/** #1166 — when the layout is the RIGHT column of the family-page master-detail,
4545
* the page supplies its own `mt-16`+`<hr>` wrapper, so suppress this one's to
4646
* avoid a stray rule above the feed inside the grid. */
4747
embedded?: boolean;
4848
}) {
4949
const feed = (
50-
// The feed reads `?cellLine=` via useSearchParams (#1166) — Suspense lets the
50+
// The feed reads `?entity=` via useSearchParams (#1166) — Suspense lets the
5151
// static shell emit and hydrate at request time (parity with the type-B layout).
5252
<Suspense fallback={null}>
5353
<FamilyPublicationFeed

components/method/publication-feed.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type Hit = {
6565
isLast: boolean;
6666
}>;
6767
/** #1166/#1168 — the per-(pub × entity) relevance sentence, present only when the
68-
* feed is filtered by an entity (`?cellLine=`); revealed under the row. `usage`
68+
* feed is filtered by an entity (`?entity=`); revealed under the row. `usage`
6969
* (WS-C #253) drives the badge: "appears" for a generic mention, else "used". */
7070
entityUsage?: {
7171
sentence: string;
@@ -95,7 +95,7 @@ export function FamilyPublicationFeed({
9595
familySegment: string;
9696
/** Resolved family label, used for the feed heading. */
9797
familyLabel: string;
98-
/** #1166 — entity id → display label, so the `?cellLine=` context-bar chip can
98+
/** #1166 — entity id → display label, so the `?entity=` context-bar chip can
9999
* name the active cell line. Absent (or unknown id) ⇒ no cell-line filter UI. */
100100
cellLineLabels?: Record<string, string>;
101101
}) {
@@ -104,7 +104,7 @@ export function FamilyPublicationFeed({
104104
const searchParams = useSearchParams();
105105
// #1166 — the shared, URL-addressable cell-line filter (spec §6). Only honored
106106
// when its label is known (the entity belongs to this family + the flag is on).
107-
const cellLineId = searchParams.get("cellLine");
107+
const cellLineId = searchParams.get("entity");
108108
const cellLine = cellLineId && cellLineLabels?.[cellLineId] ? cellLineId : null;
109109
const cellLineLabel = cellLine ? cellLineLabels![cellLine] : null;
110110

@@ -143,7 +143,7 @@ export function FamilyPublicationFeed({
143143

144144
const clearCellLine = () => {
145145
const params = new URLSearchParams(searchParams.toString());
146-
params.delete("cellLine");
146+
params.delete("entity");
147147
params.delete("page");
148148
router.replace(params.toString() ? `${pathname}?${params.toString()}` : pathname, {
149149
scroll: false,
@@ -405,7 +405,7 @@ function useFeedFetch({
405405
url.searchParams.set("sort", sort);
406406
url.searchParams.set("page", String(page));
407407
url.searchParams.set("filter", filter);
408-
if (cellLine) url.searchParams.set("cellLine", cellLine);
408+
if (cellLine) url.searchParams.set("entity", cellLine);
409409

410410
fetch(url.toString())
411411
.then((r) => {

0 commit comments

Comments
 (0)