fix(pulse): make effort badge tier-aware (E1–E5) via a shared resolver#1399
Open
krikauskis wants to merge 1 commit into
Open
fix(pulse): make effort badge tier-aware (E1–E5) via a shared resolver#1399krikauskis wants to merge 1 commit into
krikauskis wants to merge 1 commit into
Conversation
work.json's effort field carries two writer vocabularies: a session-init placeholder (standard/starting) and the real Algorithm tier written by ISASync (E1..E5). The three Observability renderers each hard-coded an inline legacy quality->E-level map and never reconciled the two, producing two defects: 1. A real tier (E3/E4) had no map key -> EffortBadge returned null (no badge); the ladder lit nothing. 2. The placeholder 'standard' mapped to E1 -> an unclassified session showed a confident, false 'E1 STANDARD' badge. Adds src/lib/effort-tier.ts (single resolveEffortTier() + tier class maps) and rewires EffortBadge / PhaseDetailPanel / UnifiedWorkDashboard to it, deleting three copies of the inline map. Placeholders now resolve to a neutral pending state, never a false E1.
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
Introduces
src/lib/effort-tier.ts— a singleresolveEffortTier()+ tier classmaps — and rewires the three Observability renderers (
EffortBadge,PhaseDetailPanel,UnifiedWorkDashboard) to it, removing three copies of aninline legacy quality→E-level map.
Why
work.json'seffortfield carries two vocabularies: a session-init placeholder(
standard/starting) and the real Algorithm tier written by ISASync (E1..E5).The renderers only understood the legacy quality words, producing two bugs:
E3/E4) has no map key → the badge renders nothing(
EffortBadgereturnsnull; the ladder lights nothing).standardis mapped toE1→ a session thatwas never classified shows a confident, false "E1 STANDARD" badge.
Change
src/lib/effort-tier.ts:resolveEffortTier(raw)mapsE1..E5(case-insensitive) → that tier; legacy
extended/advanced/deep/comprehensive→their tier; everything else (incl.
standard/starting) → a neutral pendingstate — never a false E1. Ships tier class maps (
TIER_BADGE_CLASSES,TIER_TEXT_CLASSES,EFFORT_TIERS) as the single source of truth.EffortBadge/PhaseDetailPanel/UnifiedWorkDashboardconsume the resolver;their inline maps are deleted (DRY — one source of truth).
EffortBadgegains ahidePendingopt to render nothing for placeholders instead of a pending chip.Testing
effort="E3"now shows an E3 badge (was blank); a sessionwith
effort="standard"shows a neutral pending chip (was a false "E1 STANDARD").resolveEffortTieris a pure function covering E1–E5 (any case), the four legacywords, and the never-false-E1 placeholder cases — straightforward to unit-test.
The only maintainer-taste call is cosmetic — whether a not-yet-classified session
shows a neutral "Pending" chip or renders nothing;
hidePendingsupports both.