Skip to content

feat(workflows): batch enable toggles into the save queue, dither on truth - #25

Merged
ripgrim merged 3 commits into
mainfrom
fix/workflow-toggle-save-queue
Jul 29, 2026
Merged

feat(workflows): batch enable toggles into the save queue, dither on truth#25
ripgrim merged 3 commits into
mainfrom
fix/workflow-toggle-save-queue

Conversation

@ripgrim

@ripgrim ripgrim commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

what

  • the grid's enable/disable switches no longer write per flip. they bind through
    useSaveQueueField like the rules page, so a run of toggles collects into one
    batch that the unsaved-changes bar commits or discards. mounting the bar is
    also what arms the nav guard while dirty.
  • enableMutation is gone entirely — the save-queue contract is explicit that a
    control keeping its own mutation splits the source of truth.
  • commit fans out one write per flipped workflow. enabling runs the strict
    validator server-side and can refuse; those keys stay queued via failedKeys
    so the toggle holds intent on screen while the rest clear.
  • the card dither now animates in and out, gated on workflow.enabled — the
    server's flag, never the queued toggle. texture on a card therefore always
    means the workflow is genuinely live. the old optimistic cache update is gone,
    it would have lied about exactly this.
  • easing is a quantized ramp, seven discrete opacity levels, so the texture
    materialises in bands the way an ordered dither thresholds a gradient rather
    than a generic fade. opacity-only, so it survives reduced-motion as a
    crossfade, and initial={false} keeps already-live cards static on load.

ci was red on main

two of four ci steps fail on main as of #24. both fixed here:

  • hasData lost its only consumer when the stat card stopped gating the chart
    on a non-empty series — failed noUnusedVariables and typecheck.
  • customize-page was left unformatted — failed biome.

also excluded .turbo from biome: bun dev writes
.turbo/preferences/tui.json, gitignored but not biome-ignored, so
bun run check failed locally for anyone who had run the dev server. ci never
saw it on a fresh checkout.

still red, not from this branch

bun run typecheck fails on packages/utils/src/guarded-fetch.ts:335
Uint8Array<ArrayBufferLike> is not assignable to BlobPart under the web
workspace's lib settings. @tripwire/utils typechecks clean on its own; only
the web workspace trips it. untouched here and needs its own change — widening
the MultipartFile.bytes type ripples into the worker's economics digest and
the png encoder, which is not this pr's business.

checks

  • biome: pass
  • boundaries: pass
  • build: pass
  • tests: 846 pass, 1 pre-existing flaky db integration test
  • typecheck: the guarded-fetch error above, pre-existing

ripgrim added 3 commits July 28, 2026 23:35
`hasData` lost its only consumer when the stat card stopped gating the chart
on a non-empty series — noUnusedVariables and typecheck both failed on main.

`.turbo/preferences/tui.json` is written by `bun dev` and is gitignored but
not biome-ignored, so `bun run check` failed locally for anyone who had run
the dev server. Excluded alongside .output/.tanstack/.vercel.
…truth

the grid's on/off switches wrote straight to the server on every flip. they
now bind through useSaveQueueField like the rules page, so a run of toggles
collects into one batch and the unsaved-changes bar commits or discards it.
mounting the bar is also what arms the nav guard while dirty.

commit fans out one write per flipped workflow. enabling runs the strict
validator server-side and can refuse — those keys stay queued via failedKeys
so the toggle keeps the user's intent on screen while the rest clear.

the dither now animates in and out, gated on `workflow.enabled` — the SERVER's
flag, never the queued toggle. texture on a card therefore always means the
workflow is genuinely live: flipping the switch does nothing to it until the
batch saves and the list refetches. easing is a quantized ramp so the texture
materialises in bands the way an ordered dither thresholds a gradient, rather
than a generic fade. opacity-only, so it survives reducedMotion as a
crossfade, and initial={false} keeps already-live cards from animating on load.
@ripgrim
ripgrim merged commit cde55d2 into main Jul 29, 2026
1 check failed
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