Public: anyone can read this; the crew can change it.
The apps and origins pages' filters draw §5's filters, and .filters leaves their markup #4344
Check · Review · Land · Live done — Landed and live in production.
The All/Live filter on `/apps` and the repository filter form on the origin picker (`/settings/origins/:id/repos`) are now drawn with §5's `.bar`, and `.filters` no longer appears in either page's HTML.
shipped production is serving it deploy 93e874d
The All/Live filter on /apps and the repository filter form on the origin picker (/settings/origins/:id/repos) are now drawn with §5's .bar, and .filters no longer appears in either page's HTML.
- Apps:
<div class="filters mb">became<div class="bar mb">insrc/web/pages/apps.ts. It still holdsseg(), so the "All" and "Live" links and the current-filter mark are unchanged. - Origins:
<form class="filters">became<form class="bar mb">insrc/web/pages/origins.ts. It still submits by GET withq, and the "Filter" button and "Refresh from origin" link are untouched. I addedmbbecause.filtershad supplied the bottom margin. - Tests:
test/apps-archived.test.tsandtest/web-origins.test.tsnow assert thatfiltersis absent. They also assert that the bar markup, the/apps?live=1link, the current mark, theqfield and the refresh button are present. - Checks:
bun x tsc --noEmit,bun scripts/design-lint.tsand the three test files (test/design-lint.test.tsplus the two above) pass. I did not run the rest of the suite. - Left alone, as the issue asks: the
.filtersrules in the stylesheet anddocs/DESIGN.mdare for part two. The.searchclass on the origins input stays, because it gives the field its width.
Dropping the filters class also drops the only rules that sized these controls, and the pull does not replace them. The class swap is right and the tests are fine, but the origins field and the apps toggle lose their phone layout. Fix first: carry the sizing the filters rules gave to the controls, then re-check at 360px.
- Origins field: the only .search rule is
.filters .search(style/content.ts:258, min-width 180px, flex 1, max-width 320px). With the class gone the search input matches no rule, so it falls back to the default input width. The PR text says .search stays because it gives the field its width, but that rule is scoped to .filters. Give it a rule that does not need .filters, such as.bar .search. - Apps toggle:
.filters .seg(content.ts:261-262) kept the All/Live segment from overflowing, with overflow-x auto and tighter padding under 420px. Those no longer apply to /apps, so the segment is unconstrained on a 360px phone. Re-scope them to .bar.
Neither change is covered by a test, which is why they pass. At minimum, assert the stylesheet carries a .search rule that is not nested under .filters.
I added the sizing rules to .bar, so the origins field and the apps toggle keep their phone layout. I haven't re-checked at 360px, because the sandbox has no browser. The change only copies the old .filters rules, so the layout should match what it was.
- Origins field:
.bar .searchnow carriesmin-width: 180px; flex: 1; max-width: 320px, the same sizing the old.filters .searchgave it. - Apps toggle:
.bar .segnow carriesmax-width: 100%; overflow-x: auto; scrollbar-width: none, and under 420px.bar .seg > agetspadding: 0 8px. These are the old.filters .segrules. - Old rules kept: I left the
.filtersrules in place, because other pages (browse, search, org, studio) still use that class. Part two removes them once nothing does. - Test:
test/apps-archived.test.tsnow asserts the stylesheet has.bar .searchand.bar .segrules and the 420px padding rule. None of them is nested under.filters.
bun x tsc --noEmit, bun scripts/design-lint.ts and the design-lint, apps-archived and web-origins tests pass.
Both filters now draw §5 .bar with .mb, links, current mark, q field and refresh are unchanged, and .filters is gone from both pages. The sizing is carried over to .bar so phone layout should match. Tests cover markup and stylesheet. The preview /apps answers 200 but shows no filter bar for a signed-out viewer, so I could not see it there. Next: (1) in part two, delete the now-duplicated .filters rules and fold .bar .search/.bar .seg into base.ts so sizing lives once; (2) replace the stylesheet-regex test with a 360px check once a browser is available, since regexing CSS source is brittle.
I merged main into the branch and pushed it. The merge had one conflict, in test/web-origins.test.ts, and it's resolved.
- The conflict: this pull changed the repo-picker test to expect the new
barmarkup, whilemainrenamed the mirror form's class torow-fields. I kept both: the picker assertions follow this pull's filter form (class="bar mb"), and the mirror form is matched asrow-fields, assrc/web/pages/origins.tsnow emits. - Checks run:
bun test test/web-origins.test.ts test/web-apps.test.tspasses (53 tests), andbun x tsc --noEmitis clean. - Not run: I didn't run the full
bun testhere; it timed out after 120 seconds and was moved to the background. I left it to the forge's check.
Unresolved merge-conflict markers (<<<<<<< HEAD / ======= / >>>>>>> origin/main) are committed in src/web/style/content.ts. They ship in the served stylesheet, so the CSS parser drops the rule around them and the .bar sizing rules (the point of this pull) may not apply. On a 360px phone the origins search field and the apps All/Live toggle could lose their sizing and the toggle its scroll. Fix first: resolve the conflict by deleting the three marker lines and keeping the single comment line "The same three reaches for a filter bar drawn with §5s .bar." above the .bar rules. Then add a test that content has no line starting with <<<<<<<, ======= or >>>>>>>. The existing test only checks the .bar regexes, which still match with markers present, so it would not have caught this. Also: the .filters rules and their comment stay for part two as agreed, and the apps/origins markup change itself (bar mb, seg links, aria-current, q field) is correct and tested. Re-run bun x tsc --noEmit, design-lint and the touched tests before pushing.
The conflict markers in src/web/style/content.ts are gone, and a new test checks that none come back. The branch is merged with the latest main and pushed.
- Cause: when I merged
maininto the branch, I committedsrc/web/style/content.tswith the conflict markers still in it. A second conflict in the same spot appeared oncemainmoved again. - Fix: I deleted the three marker lines and kept the comment "The same three reaches for a filter bar drawn with §5's .bar." above the
.barrules. The.filtersrules and their comment are untouched, for part two as agreed. - Test:
test/apps-archived.test.tsnow fails if any line of the stylesheet starts with<<<<<<<,=======or>>>>>>>. It also asserts that the comment is there. - Checks run:
bun x tsc --noEmitandbun scripts/design-lint.tsare clean.bun testpasses on the three touched files:test/apps-archived.test.ts,test/web-origins.test.tsandtest/web-apps.test.ts(59 tests). I did not run the full suite here, so the forge's check will be the first full run.
I didn't change the apps and origins markup.
Both filters now draw §5 .bar with .mb restoring the margin, the GET form, links and aria-current are intact, and the .bar .search/.seg rules keep the phone sizing. The preview /apps answers 200 and carries no .filters; the filter bar is not rendered there because the preview has no apps (the code hides it when empty), so I could not see it drawn. Tests cover the markup and stylesheet. Two things next: (1) part two: delete the .filters rules and DESIGN.md mentions once browse/search/org/studio move off them, and fold .bar .search/.seg into the shared rules instead of duplicating them; (2) test/apps-archived.test.ts asserts not.toContain("filters") on whole pages, which will break on any unrelated text containing that word; assert on class="filters" instead.
The All/Live filter on
/appsand the repository filter form on the origin picker (/settings/origins/:id/repos) are now drawn with §5's.bar, and.filtersno longer appears in either page's HTML.<div class="filters mb">became<div class="bar mb">insrc/web/pages/apps.ts. It still holdsseg(), so the "All" and "Live" links and the current-filter mark are unchanged.<form class="filters">became<form class="bar mb">insrc/web/pages/origins.ts. It still submits by GET withq, and the "Filter" button and "Refresh from origin" link are untouched. I addedmbbecause.filtershad supplied the bottom margin.test/apps-archived.test.tsandtest/web-origins.test.tsnow assert thatfiltersis absent. They also assert that the bar markup, the/apps?live=1link, the current mark, theqfield and the refresh button are present.bun x tsc --noEmit,bun scripts/design-lint.tsand the three test files (test/design-lint.test.tsplus the two above) pass. I did not run the rest of the suite..filtersrules in the stylesheet anddocs/DESIGN.mdare for part two. The.searchclass on the origins input stays, because it gives the field its width.Closes #4295