58 lines
5.6 KiB
JSON
58 lines
5.6 KiB
JSON
|
|
{
|
||
|
|
"featureId": "f14-heatmap-strip",
|
||
|
|
"reviewedAt": "2026-04-07T20:00:00.000Z",
|
||
|
|
"commitId": "e8175d9",
|
||
|
|
"transcriptSkeletonReviewed": true,
|
||
|
|
"diffReviewed": true,
|
||
|
|
"status": "pass",
|
||
|
|
"codeReview": {
|
||
|
|
"summary": "The HeatmapStrip component is a well-structured implementation covering all 6 validation assertions (VAL-HEAT-001 through VAL-HEAT-006). The code follows SolidJS conventions correctly — reactive data derivation via `cellData()`, `<For>` for keyed list rendering, `createSignal` for local UI state, and `onCleanup` in ParamPopup for keyboard listener. The drag-to-set pattern uses pointer capture with a dead-zone threshold to distinguish click vs drag, which is the right approach. Tests cover all assertions with 12 test cases including bar counts per mode, width proportionality, inference updates, drag, click popup, mode rebuild, colors, and tooltip. Minor issues noted below but none are blocking.",
|
||
|
|
"issues": [
|
||
|
|
{
|
||
|
|
"file": "src/components/visual/HeatmapStrip.tsx",
|
||
|
|
"line": 102,
|
||
|
|
"severity": "non_blocking",
|
||
|
|
"description": "Uses `(props.mlStore as any)._updateOutputs(newOutputs)` to access the internal method. The `_updateOutputs` method IS declared on the MLStore interface (line 168), so the `as any` cast is unnecessary — `props.mlStore._updateOutputs(newOutputs)` would work directly and be type-safe. This is a cosmetic/maintainability concern, not a bug."
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"file": "src/components/visual/HeatmapStrip.tsx",
|
||
|
|
"line": 207,
|
||
|
|
"severity": "non_blocking",
|
||
|
|
"description": "The `createCellHandlers()` function is called inside the `<For>` render function, meaning a new closure with new handler functions is created for each cell on every render. This is a minor efficiency concern — the handlers reference `paramIndex` from the closure which is correct behavior. In practice with <=126 bars this is fine, but a future optimization could memoize handlers per index."
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"file": "src/components/visual/HeatmapStrip.tsx",
|
||
|
|
"line": 96,
|
||
|
|
"severity": "non_blocking",
|
||
|
|
"description": "In `applyDragValue()`, the code calls `iml.setOutput(paramIndex, x)` followed by `new Float32Array(iml.getOutputs())`. Since `iml.getOutputs()` returns `this.outputState` (a `number[]`), and `setOutput` modifies `outputState` in-place, the `new Float32Array()` constructor iterates the shared array. This works correctly because `setOutput` clamps to [0,1] and the Float32Array constructor copies values. However, there's a subtle concern: if `process()` is called between `setOutput` and `getOutputs` (unlikely in single-threaded JS but worth noting), the output would be overwritten by inference. The code is correct for the current synchronous usage pattern."
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"file": "src/components/visual/HeatmapStrip.tsx",
|
||
|
|
"line": 100,
|
||
|
|
"severity": "non_blocking",
|
||
|
|
"description": "The `defaultParamColor` function parameter is named `_index` (prefixed with underscore indicating unused), but the function body actually uses `_index` to compute hue. This is a misleading naming convention — the underscore prefix conventionally signals an unused parameter, but it IS used. Should be renamed to `index`."
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"file": "src/components/visual/HeatmapStrip.tsx",
|
||
|
|
"line": 28,
|
||
|
|
"severity": "non_blocking",
|
||
|
|
"description": "The exported `defaultParamColor` function at module level has the same `_index` naming issue as the instance method."
|
||
|
|
}
|
||
|
|
]
|
||
|
|
},
|
||
|
|
"sharedStateObservations": [
|
||
|
|
{
|
||
|
|
"area": "conventions",
|
||
|
|
"observation": "The `_updateOutputs` method on MLStore is prefixed with underscore (indicating internal) and is documented in architecture.md as internal. However, it's used by HeatmapStrip which is a sibling component, not an internal helper. The pattern of exposing internal ML store methods for cross-component communication works but isn't explicitly documented as a convention in AGENTS.md. A 'store internal methods' pattern could be useful for future features.",
|
||
|
|
"evidence": "src/stores/ml-store.ts:168 — `_updateOutputs(newOutputs: Float32Array): void` declared on interface. src/components/visual/HeatmapStrip.tsx:102 — `(props.mlStore as any)._updateOutputs(newOutputs)` used in drag handler."
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"area": "knowledge",
|
||
|
|
"observation": "The `_index` underscore-prefix inconsistency in `defaultParamColor` — the parameter IS used in the function body but named with underscore prefix suggesting it's unused. This is a minor style inconsistency that could confuse future developers.",
|
||
|
|
"evidence": "src/components/visual/HeatmapStrip.tsx:28 — `function defaultParamColor(_index: number): string { const hue = (_index * 37) % 360; ... }`"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"addressesFailureFrom": null,
|
||
|
|
"summary": "Feature f14-heatmap-strip passes review. The implementation is clean, well-documented, and covers all 6 validation assertions (VAL-HEAT-001 through VAL-HEAT-006). The component follows SolidJS reactive patterns correctly — cellData derived reactively, <For> for keyed rendering, local signals for UI state. Drag-to-set uses pointer capture with dead-zone threshold to distinguish clicks from drags. ParamPopup (from f15) is integrated for click-to-open behavior. Tests are thorough with 12 cases covering bar counts per mode, width proportionality, inference updates, drag interaction, popup opening, mode rebuild, and tooltip. Minor non-blocking issues: unnecessary `as any` cast for `_updateOutputs`, `_index` parameter naming inconsistency, and handler recreation per render cycle. No blocking bugs or missing behaviors found."
|
||
|
|
}
|