Repository navigation
refactor(web): draw a poller's list from one shell section - #184
Merged
Merged
Conversation
The PRs page's two lists and the Todos page's Jira tickets each drew a poller's list from a copy of the same markup, texts and styles, and the GitHub page's three lists would make a third copy. PolledSection in the shell now draws them, with each list's row as a snippet, and countLabel replaces pullsNote and ticketsNote. Nothing changes on screen (decision 205).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief
Goal: one component in the shell shows a poller's list in a section, so the GitHub page's three lists don't make a third copy of the PRs page's and the Todos page's Jira section (decision 205, as decision 112 did for the form styles).
Scope
apps/web/src/shell/PolledSection.svelte: the section, generic over the snapshot and its items, with each list's row as a snippet.apps/web/src/shell/count.ts:countLabel(count, noun), which replacespullsNoteandticketsNote.PullsSectionandJiraTicketsuse the component;JiraInboxcounts withcountLabel.Out of scope: the GitHub page (
github-page), the Time page's failure line, the other copies of the card's styles, the Jira inbox's card.Acceptance criteria
pulls*,todos-ticketsandtodos-inbox*end-to-end specs pass unchanged.main.mise run checkis green.What changed
PolledSectionholds whatPullsSectionandJiraTicketscopied: the head's count, "The last search failed: …" with "These PRs are from …", the card with its rows or the empty text, the failed text, and their styles. Each list gives its title, accent, texts, noun, where its snapshot keeps the list (list), and its row (rowsnippet). TypeScript checks each row against its list.countLabelinshell/count.tscounts "1 PR", "3 tickets"; none for an empty list.genericsattribute (💅 svelte specific syntax isn't tracked leading to false positive noUnusedVariables lint error biomejs/biome#11215), so it took thePollsimport used only there for unused. The attribute names it withimport('./snapshot').Pollsinstead, which needs no suppression. An object type there breaks Biome's parser (📝 parse error on Svelte<script>generics attribute containing curly braces biomejs/biome#10896). Both are in plan §10.github-widgetsnow has eight steps; this is the sixth.QA
main's HTML (Svelte's comments and scoped classes removed), and every element's tag, box and computed styles, for 7 PRs-page and 7 Todos-page scenarios: loaded, empty, a failure with an earlier list, a failure before any success, a failed load, not set up, nothing yet, a PR without a link, long unbroken texts. It ran in desktop Chromium and phone WebKit, light and dark: 56 captures on44b1b0fand on this branch, 0 differences. A light-versus-dark control showed 1429 differences, so the diff does catch them.PolledSectionandcountLabel(the guards, the noun, the count, the texts, the rows, the branches). The users' tests killed 12; two survived, the guard that says "These … are from" only with both a list and its time, a gapmainhad too. QA addedshell/PolledSection.test.ts, which tests the component with a list of its own (GitHub'sitemskey, the nounissue) and both halves of that guard; now all 14 are killed.PolledSection.svelte100% of lines and functions, 17 of 18 branches; the one left is the compiler'sfailure ?? ''inside{#if failure}, which can't be reached.count.ts100%.listfails svelte-check.Review
No blocking findings. Non-blocking:
PolledSectioncan importPollslike any other type (plan §10).countLabel's plural adds an s, which every noun so far takes; an irregular noun would need a change (decision 205).PolledSection.test.tslooks for thetimeelement indocumentrather than in the render's container; the same here, since each test renders one component.Gates
mise run check, green locally withBAKHYARD_E2E_PORT=8280: Go fmt, gen, lint, actions and compose lint, tests, coverage, govulncheck; web install, Biome, svelte-check and tsc, Vitest with coverage, knip, pnpm audit, Playwright end-to-end tests in both browsers.