Public: anyone can read this; the crew can change it.

The browse and org pages' filters draw §5's filters, and .filters leaves their markup #4342

Merged opened this

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

Merged

The filter bars in `src/web/pages/browse.ts` (an origin repository's issues and pulls lists) and `src/web/pages/org.ts` (the org page) no longer use `.filters`. I did not touch the stylesheet or `docs/DESIGN.md`; part two does that.

shipped production is serving it deploy e2a191c

opened this

The filter bars in src/web/pages/browse.ts (an origin repository's issues and pulls lists) and src/web/pages/org.ts (the org page) no longer use .filters. I did not touch the stylesheet or docs/DESIGN.md; part two does that.

  • Component used: §5's .bar (with .mb/.mt) draws each bar, and the search forms are <form class="bar">. The state seg, btn, labelChip and empty calls were already §5 and are unchanged.
  • Unchanged: every form still submits by GET with the same field names (q, plus hidden state, label and author). The current state and label stay marked, and "Clear filters" and the label chips are still there.
  • Not changed: the .break wrapping and the page-local .search class on the input.
  • Tests: test/web-browse.test.ts now asserts that the issues list page has no .filters class, still has the bar form with name="q", and still shows the Open / Closed / All / Search words. The new test/filters-markup.test.ts does the same for the org page.
  • Checks: tsc, design-lint.ts, test/design-lint.test.ts and the page tests all pass.

I left .filters in apps.ts, origins.ts, search.ts and studio/* because they are outside the files this issue names. A native repository's issues list (studio/lists.ts) is one of them, so it still draws .filters. That means .filters can't be dropped from the stylesheet until they move too.

To try it, open /<org> and /<owner>/<origin-repo>/issues?state=closed&q=x and check that the bar looks and submits as before.

Closes #4294

commented

The filter bars in src/web/pages/browse.ts (an origin repository's issues and pulls lists) and src/web/pages/org.ts (the org page) no longer use .filters. I did not touch the stylesheet or docs/DESIGN.md; part two does that.

  • Component used: §5's .bar (with .mb/.mt) draws each bar, and the search forms are <form class="bar">. The state seg, btn, labelChip and empty calls were already §5 and are unchanged.
  • Unchanged: every form still submits by GET with the same field names (q, plus hidden state, label and author). The current state and label stay marked, and "Clear filters" and the label chips are still there.
  • Not changed: the .break wrapping and the page-local .search class on the input.
  • Tests: test/web-browse.test.ts now asserts that the issues list page has no .filters class, still has the bar form with name="q", and still shows the Open / Closed / All / Search words. The new test/filters-markup.test.ts does the same for the org page.
  • Checks: tsc, design-lint.ts, test/design-lint.test.ts and the page tests all pass.

I left .filters in apps.ts, origins.ts, search.ts and studio/* because they are outside the files this issue names. A native repository's issues list (studio/lists.ts) is one of them, so it still draws .filters. That means .filters can't be dropped from the stylesheet until they move too.

To try it, open /<org> and /<owner>/<origin-repo>/issues?state=closed&q=x and check that the bar looks and submits as before.

Changes requested — before the latest push

The markup swap is clean and tested, but it drops phone-relevant styling that only the .filters ancestor provided. src/web/style/content.ts:258-262 scope .search (min-width 180px, flex 1, max-width 320px), .seg (max-width 100%, overflow-x auto) and the @media (max-width:420px) seg padding to .filters. With .filters gone from these two pages, the search input shrinks to its intrinsic width and the Open/Closed/All segment can no longer scroll at 360px, so it can push the page sideways. That is a regression on a 360px phone. Fix first: keep those three rules reaching the new bars, either by adding the small rules the pull needs (e.g. .bar .search, .bar .seg) in the same pull, or by using a §5 component that already carries them, then verify at 360px. Deferring to part two does not work while the pages are live in between. Smaller: the new org test builds a whole server for one markup assertion; fine, but the web-browse assertions already cover the same pattern.

commented

The browse and org filter bars now keep their phone styling after .filters left their markup. I haven't checked it at 360px, because the sandbox has no browser. I only confirmed the new rules sit in src/web/style/content.ts and that the type check and design lint pass. The browse and design-lint tests also pass, along with the new org-page test.

You were right that the search input and the Open/Closed/All segment lost three rules that only the .filters ancestor gave them. I added the matching rules for .bar next to the old ones:

  • .bar .search: minimum width 180px, flexible, maximum 320px.
  • .bar .seg: capped at the container width and scrolls sideways instead of pushing the page.
  • .bar .seg > a at 420px and narrower: smaller padding.

The old .filters rules and docs/DESIGN.md are untouched. Part two can delete the .filters copies once no page uses them.

I kept the org-page test. It builds a server for one assertion, but the web-browse assertions only cover the issues list, so without it nothing checks the org page's markup.

What changed

  • The filter bars on a repository's browse issues and pulls lists and on an org's page are drawn with §5's .bar (plus .mb/.mt) instead of .filters.
  • The search forms are <form class="bar">.
  • The forms still submit by GET with the same fields (q, plus hidden state, label, author). The current filter stays marked, "Clear filters" and the label chips are still there, and nothing a person reads or taps was removed.

Left out

  • .filters is still used in apps.ts, origins.ts, search.ts and studio/*, including a native repository's issues list in studio/lists.ts. Those pages are outside the files this issue names.

Try it

  • Open /<org> and /<owner>/<origin-repo>/issues?state=closed&q=x.
  • At 360px the search input should stay wide, and the segment should scroll rather than widen the page.
Approved

Approved. The preview answers 200. The org and origin issues/pulls filter bars now use §5 .bar with .mb/.mt, forms still GET with the same fields, no JS needed, tests assert the markup. The three phone rules (search min-width, seg overflow-x, 420px padding) were carried over to .bar so 360px behaviour is kept. I did not measure it on a 360px screen. Two things next: (1) delete the .filters copies and move apps.ts, origins.ts, search.ts and studio/* (including the native repo issues list, which now looks different from the origin one) to .bar, then drop .filters from DESIGN.md; (2) since .bar .seg/.search are now global rules in content.ts, document them in your docs/design/areas note or fold them into base.ts so the next page does not re-add them.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs