Skip to content

feat(ops): URL param parsing + chip-state-from-URL (A3c, final A3)#556

Merged
silversurfer562 merged 1 commit into
mainfrom
feat/workflows-page-a3c-url-params
Jun 2, 2026
Merged

feat(ops): URL param parsing + chip-state-from-URL (A3c, final A3)#556
silversurfer562 merged 1 commit into
mainfrom
feat/workflows-page-a3c-url-params

Conversation

@silversurfer562
Copy link
Copy Markdown
Member

Summary

A3c — final A3. URL param parsing + chip-state-from-URL. Mirror of Specs page A3c (PR #539).

After this PR merges, the entire Workflows page refinement is shipped.

URL schema

URL Effect
/workflows Defaults — all 7 buckets active, empty search
/workflows?bucket=review,audit Only review + audit chips active
/workflows?q=security Search prefilled with security
/workflows?bucket=review&q=auth Both combined

Defaults are normalized OUT of the URL — share a link from default state and you get bare /workflows. Bucket values are sorted in the URL for stability.

How it works

Change What
readURLState() New — parses ?bucket=…&q=… on init. Invalid bucket names filter to defaults (no zero-chip lockout).
bucketsAreDefault() New — true when all 7 buckets on. Used to keep clean URLs short.
syncURL() New — called after every state change. Uses history.replaceState so toggles don't pollute the back button.
syncChipsToState() New — brings visual chip state in line with URL-derived logical state on first paint.
Init order readURLStatesyncChipsToStatewireChipswireSearchapplyFilters. Chip + search handlers now call syncURL() after applyFilters().

Tests (9 new)

TestURLStateSurface class in test_workflows_refined_js.py:

  • readURLState / syncURL / bucketsAreDefault on the public namespace
  • searchParams.get("bucket") + searchParams.get("q") source-grep
  • history.replaceState used (not pushState)
  • Defaults removed from URL (delete("bucket") + delete("q"))
  • syncURL() called from chip + search handlers (≥2 occurrences)
  • init() calls readURLState()

Test plan

  • Local: 60 tests pass (A2 + A3a + A3b + A3c combined)
  • Older-browser graceful degradation (silent fallthrough on URL/history API errors)
  • CI green

Spec progression — FINAL

Step Status
A1 — module (#552) Awaiting CI
A2 — route (#553) Stacked on A1
A3a — chips + pill + JS (#554) Stacked on A2
A3b — kebab menu (#555) Stacked on A3a
A3c — URL params (this) Stacked on A3b — final A3

Worth a v7.3.1 patch when combined with Phase 6 of sdk-error-message-fidelity (#551, merged). Or v7.4.0 minor if there's other unreleased value to bundle.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
website Ready Ready Preview, Comment Jun 2, 2026 12:37am

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

🔒 Security Scan Results

⚠️ Error: Could not complete security scan

Could not extract JSON from CLI output

Please check the workflow logs for details.

@silversurfer562 silversurfer562 changed the base branch from feat/workflows-page-a3b-kebab to main June 1, 2026 19:39
A3c of docs/specs/ops-workflows-page-refinement/. Final piece of the
A3 implementation. Mirror of Specs page A3c (PR #539).

What changes in workflows_refined.js:

- New readURLState() — parses ?bucket=…&q=… on init. Bucket
  values are filtered against VALID_BUCKETS so invalid params
  fall through to defaults (no zero-chip lockout). Search value
  is taken verbatim.
- New bucketsAreDefault() — returns true when all 7 buckets are
  on. Used by syncURL() to keep "clean" URLs short.
- New syncURL() — called after every state change (chip toggle,
  search input). Uses history.replaceState so toggles don't
  pollute the back button. Defaults are normalized OUT of the
  URL — share a link from default state and you get bare
  /workflows.
- syncChipsToState() — new helper called in init() AFTER
  readURLState(). The server-rendered HTML has all chips
  chip-active; URL params may have flipped some off. This brings
  visual state in line with the logical state on first paint.
- init() reorders: readURLState → syncChipsToState → wireChips →
  wireSearch → set input.value → applyFilters. Chip handlers
  now also call syncURL() after applyFilters().

URL schema:

  ?bucket=review,audit  → only review + audit chips active
  ?q=security           → search prefilled with "security"
  ?bucket=review&q=auth → combine both
  (no params)            → defaults (all 7 buckets, empty search)

Bucket values are sorted in the URL for stability (toggle order
doesn't affect the generated link).

Older browsers silently fall through to default state if URL or
history APIs are unavailable — no UX regression.

Tests (9 new):

tests/unit/ops/test_workflows_refined_js.py gains a TestURLStateSurface
class covering:

- readURLState / syncURL / bucketsAreDefault on the public namespace
- ?bucket= parsing (searchParams.get("bucket"))
- ?q= parsing (searchParams.get("q"))
- replaceState used (not pushState) — no history pollution
- Defaults removed from URL (delete("bucket") + delete("q"))
- syncURL called from chip + search handlers (>= 2 occurrences)
- init() calls readURLState()

All 60 Workflows-page tests pass (A2 + A3a + A3b + A3c combined).

Spec progression now complete:
- A1 — module (#552)
- A2 — route (#553)
- A3a — chips + pill + JS (#554)
- A3b — kebab menu (#555)
- A3c — URL params (this PR — final A3)

After this stack merges, the /workflows route fully mirrors the
just-shipped /specs page UX. Worth a v7.3.1 patch when combined
with Phase 6 of sdk-error-message-fidelity (#551, merged).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@silversurfer562 silversurfer562 merged commit 943c564 into main Jun 2, 2026
39 of 40 checks passed
@silversurfer562 silversurfer562 deleted the feat/workflows-page-a3c-url-params branch June 2, 2026 00:57
@silversurfer562 silversurfer562 mentioned this pull request Jun 2, 2026
3 tasks
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