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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

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

opened this

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"> in src/web/pages/apps.ts. It still holds seg(), so the "All" and "Live" links and the current-filter mark are unchanged.
  • Origins: <form class="filters"> became <form class="bar mb"> in src/web/pages/origins.ts. It still submits by GET with q, and the "Filter" button and "Refresh from origin" link are untouched. I added mb because .filters had supplied the bottom margin.
  • Tests: test/apps-archived.test.ts and test/web-origins.test.ts now assert that filters is absent. They also assert that the bar markup, the /apps?live=1 link, the current mark, the q field and the refresh button are present.
  • Checks: bun x tsc --noEmit, bun scripts/design-lint.ts and the three test files (test/design-lint.test.ts plus the two above) pass. I did not run the rest of the suite.
  • Left alone, as the issue asks: the .filters rules in the stylesheet and docs/DESIGN.md are for part two. The .search class on the origins input stays, because it gives the field its width.

Closes #4295

commented

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"> in src/web/pages/apps.ts. It still holds seg(), so the "All" and "Live" links and the current-filter mark are unchanged.
  • Origins: <form class="filters"> became <form class="bar mb"> in src/web/pages/origins.ts. It still submits by GET with q, and the "Filter" button and "Refresh from origin" link are untouched. I added mb because .filters had supplied the bottom margin.
  • Tests: test/apps-archived.test.ts and test/web-origins.test.ts now assert that filters is absent. They also assert that the bar markup, the /apps?live=1 link, the current mark, the q field and the refresh button are present.
  • Checks: bun x tsc --noEmit, bun scripts/design-lint.ts and the three test files (test/design-lint.test.ts plus the two above) pass. I did not run the rest of the suite.
  • Left alone, as the issue asks: the .filters rules in the stylesheet and docs/DESIGN.md are for part two. The .search class on the origins input stays, because it gives the field its width.
Changes requested — before the latest push

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.

commented

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 .search now carries min-width: 180px; flex: 1; max-width: 320px, the same sizing the old .filters .search gave it.
  • Apps toggle: .bar .seg now carries max-width: 100%; overflow-x: auto; scrollbar-width: none, and under 420px .bar .seg > a gets padding: 0 8px. These are the old .filters .seg rules.
  • Old rules kept: I left the .filters rules 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.ts now asserts the stylesheet has .bar .search and .bar .seg rules 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.

Approved — before the latest push

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.

commented

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 bar markup, while main renamed the mirror form's class to row-fields. I kept both: the picker assertions follow this pull's filter form (class="bar mb"), and the mirror form is matched as row-fields, as src/web/pages/origins.ts now emits.
  • Checks run: bun test test/web-origins.test.ts test/web-apps.test.ts passes (53 tests), and bun x tsc --noEmit is clean.
  • Not run: I didn't run the full bun test here; it timed out after 120 seconds and was moved to the background. I left it to the forge's check.
Changes requested — before the latest push

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.

commented

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 main into the branch, I committed src/web/style/content.ts with the conflict markers still in it. A second conflict in the same spot appeared once main moved 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 .bar rules. The .filters rules and their comment are untouched, for part two as agreed.
  • Test: test/apps-archived.test.ts now fails if any line of the stylesheet starts with <<<<<<<, ======= or >>>>>>>. It also asserts that the comment is there.
  • Checks run: bun x tsc --noEmit and bun scripts/design-lint.ts are clean. bun test passes on the three touched files: test/apps-archived.test.ts, test/web-origins.test.ts and test/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.

Approved

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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs