Skip to content

Commit d34ecb8

Browse files
committed
fix(model): strip clonotypeAxisId to AxisId shape
The output was returning the raw `AxisSpec` (with `annotations` and other fields). `PlAgDataTableV2` does isJsonEqual(colDef.context.id, props.showCellButtonForAxisId) inside `cellRendererSelector`, and the table-side `colDef.context.id` is run through `getAxisId` first — so it only carries `{ type, name, domain?, contextDomain? }`. The deep-equal silently returned false against our richer object, and the open button never rendered on the clonotype-axis cell. No console error, no overlay — just a row with no button. Switch to `getAxisId(found)` from `@platforma-sdk/model` so the returned axis matches the table-side shape byte-for-byte. The 3D-Structure-Prediction block does the same trim manually at `ui/src/pages/MainPage.vue:248` and that's where the working pattern came from.
1 parent ad7141f commit d34ecb8

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

model/src/index.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
createPlDataTableStateV2,
1515
createPlDataTableV2,
1616
DataModelBuilder,
17+
getAxisId,
1718
parseResourceMap,
1819
} from "@platforma-sdk/model";
1920

@@ -581,14 +582,16 @@ export const platforma = BlockModelV3.create(dataModel)
581582
if (!ref) return undefined;
582583
const pdbSpec = ctx.resultPool.getPColumnSpecByRef(ref);
583584
if (!pdbSpec) return undefined;
584-
const spec = pdbSpec as unknown as { axesSpec: AxisId[] };
585585
// The upstream PDB column carries [sampleId, scClonotypeKey] — match
586586
// the clonotype axis by name rather than index, since `[0]` is
587587
// sampleId here and the cell button must hang off the clonotype axis.
588-
const found = spec.axesSpec.find(
589-
(a) => (a as unknown as { name: string }).name === "pl7.app/vdj/scClonotypeKey",
590-
);
591-
return found;
588+
const found = pdbSpec.axesSpec.find((a) => a.name === "pl7.app/vdj/scClonotypeKey");
589+
if (!found) return undefined;
590+
// Return a stripped AxisId — `PlAgDataTableV2` does an `isJsonEqual`
591+
// against its own column's axisId (run through `getAxisId`, dropping
592+
// `annotations` etc). Returning the raw `AxisSpec` with extra fields
593+
// silently breaks the deep-equal check → no open button renders.
594+
return getAxisId(found);
592595
})
593596
.sections(() => [
594597
{ type: "link", href: "/", label: "Main" },

0 commit comments

Comments
 (0)