Commit 42385dc
feat(ops): URL param parsing + chip-state-from-URL (A3c, final A3)
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>1 parent 86eef96 commit 42385dc
2 files changed
Lines changed: 148 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | | - | |
15 | | - | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
41 | 108 | | |
42 | 109 | | |
43 | 110 | | |
| |||
139 | 206 | | |
140 | 207 | | |
141 | 208 | | |
| 209 | + | |
142 | 210 | | |
143 | 211 | | |
144 | 212 | | |
| |||
149 | 217 | | |
150 | 218 | | |
151 | 219 | | |
| 220 | + | |
152 | 221 | | |
153 | 222 | | |
154 | 223 | | |
155 | 224 | | |
156 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
157 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
158 | 243 | | |
159 | 244 | | |
160 | | - | |
161 | | - | |
162 | | - | |
| 245 | + | |
163 | 246 | | |
164 | | - | |
165 | | - | |
| 247 | + | |
| 248 | + | |
166 | 249 | | |
167 | 250 | | |
168 | 251 | | |
| |||
180 | 263 | | |
181 | 264 | | |
182 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
183 | 269 | | |
184 | 270 | | |
185 | 271 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
0 commit comments