Repository navigation
fix(site): full-period range ("Hele perioden") on /arbeidsmarked + un-grey "max" - #201
Merged
Merged
Conversation
…ioden" on /arbeidsmarked unavailableRanges() greyed out "max" itself — its -Infinity cutoff always sorts before earliestMs — so on /arbeidsmarked, where every finite trailing window also predates JOBBMARKED_DATA_CUTOFF, the only selectable range was "1 mnd". Exempt "max" from greying; it is the full-dataset reference every other range is compared against and must never grey itself. This also restores the "Maks" option on /media, /offentlig and /oppstart, where the same bug was masked by their longer-reaching data. On /arbeidsmarked, drop the always-greyed finite ranges (6m/1år/Siden 2024) from the toggle and relabel "max" as "Hele perioden" — the full collected period. As live NAV data accumulates past the cutoff, those ranges reappear on their own. Add range.test.ts as the regression guard (max never greyed; young-pillar vs old-pillar horizons; non-finite horizon). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The previous commit staged the whole arbeidsmarked scroller, which carried an uncommitted `definition` prop on <PillarHero> that depends on a pillar-hero.tsx change not in this PR — so CI typecheck failed against main. Remove it here; the WIP prop stays uncommitted in the working tree, untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
On
/arbeidsmarkedthe only selectable time-range was 1 mnd —6 mnd,1 år,Siden 2024andMakswere all greyed with "Ikke nok data ennå", so there was no way to view the full collected period.Root cause:
unavailableRanges()greys ranges whose trailing window reaches before the earliest data (they'd render identically tomax). ButrangeCutoffMs("max")is-Infinity, which always sorts beforeearliestMs— so the helper greyedmaxitself. On/arbeidsmarked(data only since the2026-04-13cutoff, so every finite window predates it) that left one option. The bug was masked on/mediaand/offentligbecause they still have1 år/Siden 2024live.Changes
range.ts— exemptmaxfromunavailableRanges()(one-line root-cause fix). Also restores the Maks option on/media,/offentlig,/oppstart— e.g./offentligregains a real 2019→now view.arbeidsmarked/_components/scroller.tsx— drop the always-greyed finite ranges from the jobs toggle and relabelmax→ "Hele perioden" (reuses the toggle's existingoptionsprop; no newRangevalue). As live data accumulates past the cutoff,6m/1årreappear on their own.range.test.ts— new regression test:maxnever greyed; young-pillar (/arbeidsmarked) vs old-pillar (/offentlig) horizons; non-finite horizon.Verification
pnpm typecheck✓ ·pnpm lint:postgrest✓ ·pnpm test(330 ✓, incl. 5 new) ·pnpm build✓ — the four CI gates, all green locally.Scoped to my three files only; the branch's other WIP is not included.
🤖 Generated with Claude Code