strictNullChecks slice 3: chart widgets + autopilot (#6)#211
Open
mairas wants to merge 1 commit into
Open
Conversation
Slice 3 of #6: the least-mechanical remainder — trend charts, minichart, the history-chart dialog, and the autopilot control widget. 385 issues fixed, betterer baseline 574 -> 189. Honest widening only; no `!`, casts, or suppressions. Widened `IAutopilotConfig.apiVersion` to `| null` to match its already-nullable siblings and the widget's own `if (!apiVersion)` handling. Null/empty history is a normal runtime state (Skip ships no history provider), so chart data is widened and passed through, not defaulted. Notably `IDataSetRow.{x,y}` stay `number | null` to preserve Chart.js's null-coordinate = line-gap rendering rather than coercing to 0. Behaviour deltas the honest typing surfaced (flagged, not silently changed): - widget-autopilot: the V1 legacy mode-path patch is a write, so it can't be optional-chained; on a config missing the `autopilotMode` entry (only via a malformed config — DEFAULT_CONFIG always defines it) it now warns and keeps the configured path instead of throwing. Normal configs are byte-identical. - widget-windtrends-chart: theme-null guards in the Chart.js draw hooks skip a frame instead of throwing (matches the sibling gauge widgets); also removed 9 pre-existing non-null assertions, replacing them with real narrowing. These widgets' unit specs pass (25 tests across the 5 touched files); validated via AOT build (strictTemplates), lint, and betterer. No file regressed. Refs #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice 3 of the
strictNullChecksmigration (#6) — the least-mechanical remainder. Four Sonnet agents on disjoint files under hard guardrails, this round told to flag any behaviour change the honest typing surfaces rather than change it silently (the discipline slices 1–2's reviews taught). I reconciled, scanned every diff, and reviewed the flagged candidates.Fixed (385 issues, betterer baseline 574 → 189 — cumulative 80% of #6)
widget-data-chart(164 → 0) — null/undefined equivalence verified against Chart.js source;IDataSetRow.{x,y}keptnumber | nullto preserve Chart.js's null-coordinate = line-gap rendering (not coerced to 0).widget-windtrends-chart(100 → 0)widget-autopilot(65 → 0) — required wideningIAutopilotConfig.apiVersionto| nullto match its already-nullable siblings (instanceId,pluginId,modes) and the widget's ownif (!apiVersion)handling. No spillover toselect-autopilot(already uses a nullable signal).minichart(33 → 0),widget-history-chart-dialog(23 → 0)Null/empty history is a normal runtime state (Skip ships no history provider), so chart data is widened and passed through, not defaulted.
Behaviour deltas (flagged, not silently changed)
autopilotModeentry (only reachable via a malformed config —DEFAULT_CONFIGalways defines it) it now warns and keeps the configured path instead of throwing. Normal configs are byte-identical. Affects the mode display subscription, not commands.Verified clean
No
any/!/@ts-ignore/eslint-disableadded;as unknown ascounts unchanged (windtrends consolidated the file's existing chart-scale cast idiom); the retypedIChartColors/IDataSetRow/AnnPlugininterfaces are local to each chart file. No file regressed vs the baseline.Coverage
All 5 touched files have specs (25 tests, passing). Validated via AOT build (
strictTemplatesover the widened chart types), lint, andbetterer:ci(189).Remaining under #6
~189 issues across smaller components/widgets (
dashboard.component36,widget-ais-radar12, and a long tail) — a final cleanup slice.Refs #6