Summary
Four bugs found in CodeRabbit review of src/components/DriverVersionsCatalog.tsx. Deferred from the SBOM pipeline PR (upstream-pr/sbom-pipeline) as they are pre-existing and out of scope.
Bug 1 — formatDate: missing UTC timezone (date-display off-by-one)
File: src/components/DriverVersionsCatalog.tsx:42-51
return parsed.toLocaleDateString('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric',
// Missing: timeZone: 'UTC'
});
Date strings like 2025-03-15 are parsed as UTC midnight, then rendered in the user's local timezone. Users west of UTC will see the previous day. Same issue exists in FeedItems.tsx:formatLongDate.
Fix: Add timeZone: 'UTC' to the toLocaleDateString options object in both formatDate functions.
Bug 2 — word-break: break-word is deprecated CSS
Likely location: src/components/DriverVersionsCatalog.module.css
word-break: break-word is not part of the CSS spec (it was a WebKit extension). The correct values are break-all or overflow-wrap: anywhere.
Fix: Replace word-break: break-word with overflow-wrap: anywhere (or word-break: break-all if hard-breaking is intentional).
Bug 3 — rebaseCommandForTag: jq selector escaping
File: src/components/DriverVersionsCatalog.tsx:80-83
The jq filter uses escaped double-quotes inside single-quoted jq syntax. Verify the escaping survives copy-paste from the browser's clipboard — some renderers unescape \" to ", breaking the shell command.
Fix: Test the rendered output in the browser to confirm the jq selector appears correctly. Consider using bracket notation: .["image-name"].
Bug 4 — valueOrFallback suppresses versionMissing CSS class
File: src/components/DriverVersionsCatalog.tsx:53-55, 94-96
function valueOrFallback(value: string | null | undefined, fallback = 'N/A') {
return value || fallback; // returns string always
}
// Later:
const kernel = valueOrFallback(row.versions.kernel); // always a string
// ...
<VersionValue value={kernel} /> // never null → versionMissing never applied
VersionValue renders styles.versionMissing only when value is null/undefined, but because valueOrFallback already converts null to 'N/A', the versionMissing CSS class is never triggered in the ReleaseNode component. The only path that correctly uses VersionValue directly (and can show the missing style) is the hwe value on line 97 which passes the raw value.
Fix: Remove the valueOrFallback calls for kernel/nvidia/mesa in ReleaseNode and pass the raw values directly to VersionValue, which already handles null/undefined gracefully.
Acceptance Criteria
Context
Found in CodeRabbit review of the SBOM pipeline PR. Pre-existing issues in DriverVersionsCatalog.tsx, deferred to keep the SBOM PR scoped.
Summary
Four bugs found in CodeRabbit review of
src/components/DriverVersionsCatalog.tsx. Deferred from the SBOM pipeline PR (upstream-pr/sbom-pipeline) as they are pre-existing and out of scope.Bug 1 — formatDate: missing UTC timezone (date-display off-by-one)
File:
src/components/DriverVersionsCatalog.tsx:42-51Date strings like
2025-03-15are parsed as UTC midnight, then rendered in the user's local timezone. Users west of UTC will see the previous day. Same issue exists inFeedItems.tsx:formatLongDate.Fix: Add
timeZone: 'UTC'to thetoLocaleDateStringoptions object in both formatDate functions.Bug 2 — word-break: break-word is deprecated CSS
Likely location:
src/components/DriverVersionsCatalog.module.cssword-break: break-wordis not part of the CSS spec (it was a WebKit extension). The correct values arebreak-alloroverflow-wrap: anywhere.Fix: Replace
word-break: break-wordwithoverflow-wrap: anywhere(orword-break: break-allif hard-breaking is intentional).Bug 3 — rebaseCommandForTag: jq selector escaping
File:
src/components/DriverVersionsCatalog.tsx:80-83The jq filter uses escaped double-quotes inside single-quoted jq syntax. Verify the escaping survives copy-paste from the browser's clipboard — some renderers unescape
\"to", breaking the shell command.Fix: Test the rendered output in the browser to confirm the jq selector appears correctly. Consider using bracket notation:
.["image-name"].Bug 4 — valueOrFallback suppresses versionMissing CSS class
File:
src/components/DriverVersionsCatalog.tsx:53-55, 94-96VersionValuerendersstyles.versionMissingonly whenvalueis null/undefined, but becausevalueOrFallbackalready converts null to'N/A', theversionMissingCSS class is never triggered in theReleaseNodecomponent. The only path that correctly usesVersionValuedirectly (and can show the missing style) is thehwevalue on line 97 which passes the raw value.Fix: Remove the
valueOrFallbackcalls for kernel/nvidia/mesa inReleaseNodeand pass the raw values directly toVersionValue, which already handles null/undefined gracefully.Acceptance Criteria
Context
Found in CodeRabbit review of the SBOM pipeline PR. Pre-existing issues in
DriverVersionsCatalog.tsx, deferred to keep the SBOM PR scoped.