Skip to content

Fix/post redesign followups - #199

Draft
atulmgupta wants to merge 2726 commits into
mainfrom
fix/post-redesign-followups
Draft

atulmgupta wants to merge 2726 commits into
mainfrom
fix/post-redesign-followups

Conversation

@atulmgupta

Copy link
Copy Markdown
Collaborator

Description

Closes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would break existing functionality)
  • Documentation update
  • Infrastructure / CI change

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing tests pass locally
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Screenshots (if applicable)

…ce inputs

Root cause: nextcharge.Decide falls through to charge_home_now when
Preview() fails (unknown rate plan, bad ready-by, no feasible window)
and no Supercharger quote exists - all cost pointers nil. The strip
rendered the badge + empty metrics.

- Strip suppresses badge+body and shows nextCharge.notEnoughPriceData
  (with Autopilot CTA) when kwh_needed > 0 but all three price options
  are empty; 'enough' (0 kWh) still renders priceless. Backend enum
  untouched (contract ripple; display gate is sufficient).
- Regtests fail-before (badge + empty metrics) / pass-after; guards for
  priced charge-home-now and priceless enough. Strip 26/26.
- Catalog +1 key, trio re-pin (42199 keys), 7672/0; tsc/lint/build green
Root cause: all currency paths honored the raw user/metric/global
precision, so a 1-decimal precision rendered \.04 and \.14 alike as
'\.1' (Monthly est, formatCurrency/EnergyCost/Currency/formatMetric);
the Est. cost/km metric additionally ignored the metric precision.

- New currencyDecimals(amount, requested) helper in numberFormat.ts,
  wired into formatCurrency, formatEnergyCost, <Currency>, the cost/km
  metric formatter (now metric-precision + locale aware), and
  formatMetric's currency branch. Amounts >= 1 and non-currency formats
  keep the requested precision.
- 5 regtests fail-before ('\.1') / pass-after; target files 245/245;
  wide formatting trees 3205 + 3 baseline-only; trio 7672/0;
  tsc/lint/build green. Step 2 (a-f) complete.
Replace the DashboardPage 60s setTick (whole-grid re-render) with a
shared 30s useTicker subscription: FreshnessDot, VehicleHero ChargeDoneAt
leaf, FleetOperationsBrief and AnomalyDetectorWidget subscribe as units;
DashboardGrid/VehicleHero memoized; page callbacks stabilized.

Tests: useTicker 2/2, DashboardGrid.ticker 2/2 (single timer + bodies
render once across ticks), DashboardPage ticker-isolation guard;
browser-verified ages advance on ticks (temp spec, deleted after run).
tsc/lint/build green, dashboard 4575/0, trio 7672/0.
The browser-local departure contract asserts a divergent host zone
(America/Los_Angeles) but relied on ambient TZ: 14/14 fail on any
other host zone (verified under UTC and America/New_York). Pin
process.env.TZ at the top of the file per the AdvancedIntelligencePages /
SmartCharge precedent. Each test file runs in its own worker process
(probed), so the pin cannot leak to other files; the beforeEach guards
verify it took effect.

No shared-state leak found in JourneyAssurancePage.test.tsx after
probing zombie paused-mutation resume (none: client.clear drops them),
fixture mutation (27/27 with deep-frozen fixture), formatter caches
(absent), drawer close timing (synchronous) and worker reuse (fresh
process per file). Historical in-suite red was the pre-wave-2 brief
contract, fixed by f73d907 (green in reports c/d).

Proof: file 1 20/20 + 12 shuffle seeds green; file 2 20/20 under
ambient UTC + 14 shuffle seeds green.
…rwrite

The page re-derives isCharging/chargeLimitPct under the 2-minute live
window but re-injected the raw observation, discarding the model's
validSoc sanitization (NaN/Infinity/out-of-range rendered as a limit).
Sanitize the overwrite with the now-exported validSoc predicate.

Adds validSoc regression coverage in chargeAdvisor.test.ts.

Scenario-gate failures (9) remain blocked: scenarios require
coverageEstablished via coveredLocalDates, which no caller provides;
needs an owner decision.
… isolation

Job 1 (15 fails, 0 blocked):
- admin.test.ts (5): align stale expectations to tri-state helpers
  (null/undefined unknown), pin sentry buckets to UTC, expect the
  toggling row timestamp from findLastLockChange
- StatusHero (5): hide decorative LiveIndicator dot from AT inside the
  hero live region (nested role=status double-announce); pin healthy
  icon to circle-check-big (CheckCircle alias renders CircleCheckBig)
- Watch wiring (2): expect unit_of_length/unit_of_temp the component
  sends and the Go handler accepts
- AIDigestNarration (1): localize weekly_digest in HelixEvidenceTrail
  allowlist + en.json helix.tools.weeklyDigest + regen catalogs
- AIQuietHoursSuggestion (1): expect localized Critical severity label
- DataTable (1): expect No-results + Clear-filters no-match copy for
  filtered-to-zero (emptyMessage is for truly-empty data)
Job 2 (flake): pin reduced motion in ChargingForensicsPage.test so
FadeIn panels render final state; visibility assertions no longer
race the 50ms-delay rAF animation clock. Proof: 10x consecutive +
6 shuffle seeds all 29/29.
31 of 35 failing tests migrated to the new shell contract at equal strictness (desktop rail + docked panel, tablet drawer, phone tabs + sheet, Home hub, Pinned/Recent groups, Tooltip labels, sidenav-collapsed-groups persistence).

Prod fix (test-proven, shell-only): persist effect no longer clobbers the saved deck view while its section is late-loading.

4 tests left red by design (no successor contract): icon-only collapsed secondary panel (x2), directional panel entrances ltr/rtl (x2).
…wner-decisions left red)

Fixed (prod): signalCorrelation normalizes -0 lagS to +0 when maxLagS < stepS; existing toBe(0) pin is the regression test.

Fixed (stale test pins, intent kept): deadband page pins updated to current delta-MAD estimator outputs (14 candidates, exact metrics); replay map-height pin updated to row-15 layout; null-efficiency case now pins shared hide-missing brief contract.

Left red for owner: driving NaN-chart test contradicts passing trips NaN pin; gap-detector isStale case contradicts shared deriveDataState contract. See task report for options.
(cherry-picked from fix/step5-d 32871f0bc2; i18n checkpoint conflicts
resolved by re-running the repo generators on the merged tree:
split-i18n-catalog regen + i18n-trio-checkpoint --typed
--checkpoint-catalog, folding date.preset.last6h into the predecessor
per the step-2b/H convention instead of the branch's additions-list
registration.)
- useDLQ (11): tests used numeric ids + general MAX_LIMIT; hook/types/backend confirm opaque string ring ids + DLQ-specific 500 cap (DLQReplayAuditRepo.Recent clamps [1,500]). Export DLQ_AUDIT_MAX_LIMIT; migrate tests to string ids + cap.
- useGuard (8): guardWriteOptions fail-closed skipAuthRefresh is deliberate; pin it in wire-contract expectations.
- hooks/useSettings (2): request() threads AbortSignal per repo contract (matches useSettings.abort test); expect it.
- useVehicleSystems (1, prod): mediaHistory factory unconditionally appended start/end; align with climateHistory conditional short form. No exact-key refs to long no-range key.
- useAnalytics (1): /vehicle-states/summary returns {by_state} envelope (Go handler_test pins keys); mock the envelope.
- useAutomations (1): import endpoint returns {imported[], errors[]} (dtos.go importResult); mock the array shape.
- useLocations (1): bulk delete has complete/partial/failed outcomes (getGeofenceBulkDeleteOutcome + phase6 tests); success-path test now mocks a complete outcome + warning spy.
- api/useSettings (1+2 new): poll redesign invalidates status only, history follows last_poll_time chain, honest triggered toast (a3c4e5a); update poll test + cover the chain both ways.
- authRecovery (1): directRequest camelCaseKeys aliases are the documented client contract; expect {auth_url, authUrl}.
- liveWritePolicy (1): simulate invalidates governanceRunsAll() prefix (same commit updated hook but not table); fix table key.
- useOwnership (1, prod): useSimulateGovernance replayed the plan-recording POST through resilientFetch on failure; fail closed with skipAuthRefresh (guardWriteOptions precedent).
- useSessions (1): test never tracked isRefetching so the in-flight render was skipped by RQv5 tracked-props optimization; spread result during render.
- useVehicleVinFilter (1): LEFT RED by design (see report): d2cb639 deliberately removed stale-VIN cleanup in favor of retain + scopeReady gating consumed by both charging pages.
…checkpoint regen

- Extend i18n-trio-checkpoint --checkpoint-catalog to the two forgotten
  frozen-projection suites (copy-owner-contracts, final-four-gaps) with
  per-group shapes; original five groups byte-identical (no-op rewrite).
- Regen pins via script after --typed verification (42199 keys, 0 missing,
  ar/he preserved): copy-owner 30901/32945, final-four 32929/32933.
- Hoist pairs/intervening/additions/acceptedLater/leaves/physical fixtures
  to top level (same values) so the script reads what the tests assert.
- copy-owner: HistoryPrompt contract 2->3 calls (same per-call fallback
  + execution checks); gating test migrated to reviewed noVehicle-first
  + unresolved precedence (page-test oracle), filter precedence kept.
- RegexTester: Title-Case placeholder fallback aligned to catalog casing
  via --align-typography (1 line).
- shell-preservation 7 left red: byte-pins predate trio+sidenav with no
  covering generator; hand-editing hashes is forbidden. Blocked, exact
  errors recorded for follow-up.
The 15 investigation sections are React.lazy; first navigation to a
section pays a dynamic-import cost that can exceed the 1s findBy
timeout under full-suite load, flaking whichever test touches a
section first (close suite: 'hub exposes source caps...' red in-suite,
67/67 solo). Warm all chunks once in beforeAll with a glob-drift guard
(count must equal features.length). No assertion changed.
…t, live-mode + thermal pins

fix-system-search-ss10 (announcer plurals): add a11y.status.loadedCount _one/_other leaves with {{count}} (governed convention); useStatusAnnouncer + RecommendationDetails pass defaultValue_one/other; new singular/plural unit test; 3 stale '1 items' expectations updated; FirmwareImpactPage i18n mock made plural-aware. Count-default table row moved to a dedicated singular/plural test (same coverage, stronger).

fix-settings-active-sessions-as-05: align hook keys settings.sessions.* -> settingsSessions.* (catalog namespace); add 3 missing leaves with exact fallback wording; plural toast passes raw count + fmtInt displayCount + defaultValue_one/other; new sessionsRevokePlural.test.ts resolves 0/1/3/1234 in canonical + generated bundles.

th06: pin requiresLiveMode on charging-history refresh. ctt-s01: thermal-adapter regression (endpoint ts wins, no AC/DC double count, kWh->Wh, heater unknown).

Catalog regen + --check clean (32954 leaves); trio checkpoints + announcer producer checkpoint re-pinned via generators. Batch suites 188/188; i18n folder back to the 7 pre-existing shell-preservation reds; tsc + eslint clean.
as-02: absent session lastActive renders localized 'No verified activity' instead of 'Never' (key swap + stale pin flip + absence assertion).

privacy-02: policy-aware consent details via describeConsent(state, t, requireConsent); preview copy when no gate (declined/unknown), accepted unchanged; panel + brief pass the flag; 4 meta + 1 panel regressions.

tl08: localized TariffStructure labels (badge + select, raw enum preserved as value/payload) + localized new-band default name; 3 regressions incl. raw-enum submit pin.

sd-12: preference-aware fmtInt counts in diff breakdown sublabels + 1000-row grouping regression; local formatSpan retained (no shared helper reproduces pinned 45s/1m 5s/1h outputs; item parity condition unmet).

tu09: observedBuckets _one/_other leaves + defaultValue_one/other; plural-aware test mock; singular/plural dialog regression.

ss-011: 5 StatusHero headlines via statusHero.headline.* keys (variants + overrides preserved); key-echo wiring suite (6 tests).

Catalog regen + --check clean (32969 leaves, +15); trio + producer checkpoints re-pinned via generators. Batch suites 199/199 + trio 7672/0; tsc/eslint clean.
… delete-failure localization (catalog 32971)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant