Skip to content

refactor(#459): rename two missed callback locals; correct the filterActive rationale - #479

Merged
BorisTyshkevich merged 1 commit into
mainfrom
chore/dashboard-rename-followup-459
Jul 26, 2026
Merged

refactor(#459): rename two missed callback locals; correct the filterActive rationale#479
BorisTyshkevich merged 1 commit into
mainfrom
chore/dashboard-rename-followup-459

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

Summary

  • Follow-up to Rename surviving filter terminology to Dashboard variables #459: renames two callback locals in ui/dashboard.ts that the scripted rename pass missed because it only matched callbacks whose body started with filter. ((filter) => !ordinaryTimeIds.has(filter.id) and (filter) => filter.id).
  • Corrects the CHANGELOG and ADR-0003 addendum: the filterActive family is not purely "the WORKBENCH's optional-block activation" — VariableBarApp, the shared port both the Dashboard and detached Data view build the bar through, also declares it. params is a Pick<WorkbenchParameterSession, …> so folding the rename into Rename surviving filter terminology to Dashboard variables #459 would break that Pick, and the bar mutates the caller's map in place before calling saveFilterActive() — an adapter that copies rather than aliases would silently stop persisting activation in the detached view, with no test today that would catch it. Rename shared VariableBar activation port to caller-neutral names #478 tracks the write-through test this requires.

This commit was cherry-picked from refactor/variable-terminology-459 (33f5476), which was pushed after PR #474 (the #459 PR) had already merged, so it never made it into a PR.

Test plan

  • npm test — 5603 passed, 100% statement/line coverage
  • tsc --noEmit / check:arch clean (via npm test pretest)

Part of #459

🤖 Generated with Claude Code

https://claude.ai/code/session_011sMwR4BHM85MExSBYXzTYj

…Active rationale

Review follow-up. Two items, one code and one accuracy.

`ui/dashboard.ts:752` still had `(filter) => !ordinaryTimeIds.has(filter.id)` and
`(filter) => filter.id`. The scripted pass only matched callbacks whose body
STARTED with `filter.`, so a chained predicate slipped through. Renamed to
`variable`. Every other surviving `filter` local is a documented exception:
`schema.ts:229` (schema text search) and `spec-examples.test.js:88` (iterating a
legacy dashboard-v1 example's `filters`).

The accuracy fix matters more. Both the CHANGELOG and the ADR addendum justified
keeping the `filterActive` family as "the WORKBENCH's optional-block activation,
not a Dashboard variable at all". The first half is right; the last clause is
wrong, and the review caught it. `VariableBarApp` — the SHARED port both the
Dashboard and the detached Data view build the bar through — also declares
`state.filterActive` and `params.saveFilterActive`, and `ui/dashboard.ts:773-781`
satisfies it with a purely local `draftActive` map and a no-op
`saveFilterActive`. So one of that port's two callers has no Workbench state and
nothing persisted behind the name.

The exception itself still holds, on a narrower argument now recorded: what the
name denotes is activation of a parameter's optional `/*[ … ]*/` filter block
(`variable-bar.ts:539` is literally
`app.state.filterActive[p.name] = input.value !== ''`), a live SQL-filter concept
that predates the curated Dashboard model and survived its removal — not a
surviving curated-filter identifier. But naming a shared port after one caller's
persisted field is a leaky abstraction, so #478 (inbox) tracks renaming the port
to caller-neutral members while `AppState.filterActive`, `saveFilterActive`,
`effectiveFilterActive` and `asb:filterActive` stay put.

That is deliberately NOT folded in here, for two reasons the issue records:
`params` is a `Pick<WorkbenchParameterSession, …>`, so renaming a member stops it
being a Pick and the detached caller can no longer pass the app straight through;
and the bar MUTATES the caller's map in place before calling
`saveFilterActive()`, so an adapter that copies rather than aliases would
silently stop persisting activation in the detached view — with no test today
that would fail. #478 requires that write-through test regardless of the rename.

npm test 5603 passed, tsc/check:arch/build clean.

Part of #459

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BF6uJrfy51KgkeTvfzyWDB
@BorisTyshkevich
BorisTyshkevich merged commit e7e5b75 into main Jul 26, 2026
7 checks passed
@BorisTyshkevich
BorisTyshkevich deleted the chore/dashboard-rename-followup-459 branch August 6, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant