Show section icons in page headers across all pages - #339
Merged
Conversation
Add a typed icon prop to PageHeader that renders the section icon at
h-8 w-8 inside the heading, replacing the ad-hoc span wrapper used by
Channels and Routes. Migrate all 10 list pages to pass their section
icon, and add section icons to the 3 detail page headers (PacketDetail,
PacketGroupDetail, NodeDetail).
Normalize Channels/Routes title keys to the entities.* namespace
(used everywhere else) and add the missing entities.channels key to
nl.json ('Kanalen'). Visible text is unchanged.
Update PageHeader tests for the icon contract and add a focused icon
assertion to each affected page test.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
Adds the appropriate section icon before the page name in every page header, standardizing what was previously only done for Channels and Routes (via an ad-hoc
<span>wrapper stuffed into thetitleprop).Changes
PageHeadergained a typedicon?: ComponentTypeprop that renders the section icon ath-8 w-8inside the<h1>, replacing the duplicated span hack.PacketDetail&PacketGroupDetailgain a new<h1>(withIconPackets), andNodeDetailprefixes its title withIconNodesalongside the existing node-type emoji.t("entities.channels")/t("entities.routes")(title +usePageTitle), matching every other page. Added the missingentities.channels: "Kanalen"key tonl.json. Visible text is unchanged.PageHeader.test.tsxcovers the icon contract (renders/omits); every affected page test (13 files) asserts its heading contains the section<svg>.Verification
npx tsc --noEmit— cleannpx vitest run— 337/337 passingpre-commit run --all-files— all greenNo new dependencies, no backend/router changes.