feat: responsive nav, mobile breakpoints, CSS cleanup, pre-commit config #48
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-api!48
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "47-template-css-overhaul-pre-commit-hook-re"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
@mediamobile breakpoint so all pages render correctly at 375px.pre-commit-config.yamlwith ruff format + ruff check to prevent recurring CI failures from unformatted agent codeChanges
base.html: Nav inline styles moved to CSS classes (.nav-auth,.user-email,.logout-btn,.login-link).@media (max-width: 600px)breakpoint — brand on own row, auth on own row right-aligned, reduced main padding/margin, card-grid single column, h1 size reduced.landing.html: Tags wrapped in<div class="tag-row">below titles. Section header inline styles moved to.section-headerclass.login.html: All inline styles replaced with CSS classes (.login-form,.login-field,.login-label,.login-input,.login-submit,.login-message,.login-error)..pre-commit-config.yaml: ruff-format + ruff check hooks, rev v0.9.7.Test Plan
ruff formatandruff checkcleanReview Checklist
Related Notes
issue-pal-e-docs-template-css-overhaul— the issue this PR addressesplan-2026-02-27-responsive-design-mobile-ux— Phase 2PR Review — Round 1
BLOCKING
Remaining inline style in
landing.html— Line<p class="meta" style="margin-top: 0.75rem;">(the "View all repos" link) still has an inlinestyleattribute. The whole point of this PR is to move inline styles to CSS classes. This one was partially addressed (theclass="meta"was added) but thestyle="margin-top: 0.75rem;"was left in place. Should be a CSS class (e.g.,.view-all-link { margin-top: 0.75rem; }) or absorbed into an existing class.Pre-commit ruff version is severely outdated —
.pre-commit-config.yamlpinsrev: v0.9.7, but the locally installed ruff is0.15.2, pyproject.toml requires>=0.8, and the current latest ruff release isv0.15.3. Version0.9.7is from mid-2025. While it should still pass since the project doesn't use any bleeding-edge ruff features, having the pre-commit hook run a wildly different ruff version than CI (which uses whateverpip install .[dev]resolves — currently0.15.x) creates a situation where pre-commit passes locally but CI fails, or vice versa. The rev should be updated to match what CI actually uses — at minimumv0.14.0or ideallyv0.15.2. The whole point of this pre-commit config is to prevent CI failures from unformatted code; a version mismatch undermines that goal.SUGGESTION
Nav mobile breakpoint: nav links wrap into the auth row — At 600px,
.brandgetsflex-basis: 100%(own row) and.nav-authgetsflex-basis: 100%(own row). But the 4 nav links (Home, Projects, Repos, Tags) are regular<a>elements without any wrapping container orflex-basisoverride. They will flow between the brand and auth rows as individual flex items, controlled only byflex-wrap: wrapandgap: 0.4rem 1rem. This probably works at 375px because the 4 links fit on one line (~200px total), but it's fragile — if link text changes or a link is added, the layout could break unexpectedly. Consider wrapping the nav links in a<span class="nav-links">with its ownflex-basis: 100%in the mobile breakpoint for explicit control over the 3-row layout (brand / links / auth).login-inputmissingbox-sizing: border-box— The.login-inputclass setswidth: 100%andpadding: 0.5rem. Withoutbox-sizing: border-box, the input would overflow its container. This is currently saved by the universal* { box-sizing: border-box; }reset at the top of the stylesheet. This is fine, but worth noting that the login form relies on this reset — if anyone ever removes it, the login form breaks. No change needed, just documenting the dependency.card-griddesktop:minmax(280px, 1fr)at exactly 375px — The mobile breakpoint overrides togrid-template-columns: 1fr, which is correct. But between 375px and 600px (the breakpoint),minmax(280px, 1fr)means a single column anyway because280px + 1rem gap + 280px = 561pxexceeds the available width of ~373px (375px - 2*0.75rem padding). So the override is redundant in practice between 375–600px, but it's still good to have as an explicit declaration. No change needed.<div class="tag-row">inlanding.htmlbut not intag_notes.html/project_notes.html— The PR adds<div class="tag-row">wrappers around tags in the landing page doc lists, buttag_notes.htmlandproject_notes.htmlboth have bare<div>wrappers around their tag loops (line 10-13 in both). For consistency, these should useclass="tag-row"too. This isn't a mobile layout bug (the bare<div>works fine), but it's inconsistent — the same visual pattern should use the same class name.NIT
CSS class naming:
.login-*prefix vs.nav-authscoping — The nav auth styles use BEM-like scoping (.nav-auth .user-email,.nav-auth .logout-btn), while the login form uses flat prefixed classes (.login-form,.login-field,.login-label). Both approaches work, but they're inconsistent within the same stylesheet. Not worth changing now, but worth noting for future CSS additions.No
font-familyorbox-sizingon.login-input/.login-submit— Form elements don't inheritfont-familyby default in many browsers. The submit button and input might render in a browser default font instead of Atkinson Hyperlegible. Addingfont-family: inheritto form elements is a common best practice. Again, minor since it may already work depending on browser.Summary
The CSS restructuring is well-executed. The inline styles were correctly extracted to semantic classes. The
@mediabreakpoint at 600px is a reasonable choice for mobile, theflex-wrapapproach for the nav is clever, and theflex-basis: 100%trick to force line breaks is the right technique. Login form cleanup is thorough. Thetag-rowandsection-headerclasses are good abstractions.The two blocking issues are:
landing.html— a straightforward oversight.Verdict
CHANGES REQUESTED
PR Review — Round 2
Round 1 Fixes Verified
style="margin-top: 0.75rem;"toclass="meta view-all-link"with corresponding.view-all-linkCSS class. Clean fix.v0.9.7tov0.15.2, which exactly matches the installed ruff version (pip show ruff→0.15.2). No version mismatch.<span class="nav-links">withflex-basis: 100%in the mobile breakpoint. Explicit 3-row layout (brand / links / auth) on mobile.<div class="tag-row">instead of bare<div>.input, button, select, textarea { font-family: inherit; }added at the top of the stylesheet, right after the universal reset. This fixes the cross-browser form font issue.All 5 actionable round 1 findings are resolved.
BLOCKING
None.
SUGGESTION
note.htmltag wrapper missingtag-rowclass — The round 1 review flaggedtag_notes.htmlandproject_notes.htmlfor using bare<div>wrappers around tags — both were fixed to<div class="tag-row">. However,note.html(the individual note detail page) has the same pattern on line 11:<div>with no class wrapping{% for tag in note.tags %}. For consistency, this should also be<div class="tag-row">. The.tag-rowclass currently only addsmargin-top: 0.2remwhich is a subtle change, but using the same class for the same visual pattern across all templates is the right practice.NIT
.nav-linksgap not reduced on mobile — The@media (max-width: 600px)breakpoint reducesnavgap to0.4rem 1rem, but.nav-linkskeeps its owngap: 1.5remfrom the base rule. At 375px this still fits fine (~242px of content in ~351px available width), so it's not a layout bug. But the mobile gap between nav section links is wider than the gap between the brand row and the links row, which is a minor visual inconsistency. Consider adding.nav-links { gap: 1rem; }inside the breakpoint if the spacing looks uneven in visual QA.Overall Assessment
This is a well-executed PR. The CSS restructuring is clean and thorough:
.nav-auth,.nav-links,.section-header,.tag-row,.view-all-link,.login-*).flex-wrap: wraponnav+flex-basis: 100%on each group forces the 3-row stacked layout.card-griddrops to1fr.mainpadding is reduced.h1size is reduced.max-width: 100%), lightbox overlay, auto-link styles, and.table-scrollwrapper are all untouched.v0.15.2matching CI.font-familygap.The one suggestion (adding
tag-rowtonote.html) is a minor consistency fix that could be done now or deferred to Phase 3 visual QA. It does not affect mobile layout.Verdict
APPROVE — with the suggestion to add
class="tag-row"tonote.htmltag wrapper as a follow-up or quick fix before merge.PR Review — Round 3
Prior Fixes Verified
Round 1 findings:
style=removed from landing.html "View all repos" link — now uses.view-all-linkclass<span class="nav-links">with flex layout + mobileflex-basis: 100%breakpointclass="tag-row"added totag_notes.htmlandproject_notes.htmlfor consistencyfont-family: inheritrule added forinput, button, select, textareaRound 2 findings:
note.htmltag container changed from bare<div>to<div class="tag-row">for consistency.nav-linksgap reduced from 1.5rem to 0.75rem inside mobile breakpointFull Template Audit — Inline Styles
Checked all 9 templates on the branch for any remaining
style=attributes:base.html— cleanlanding.html— cleanlogin.html— cleannote.html— cleantag_notes.html— cleanproject_notes.html— cleanprojects.html— clean (was already clean, no changes in this PR)repos.html— clean (was already clean, no changes in this PR)tags.html— clean (was already clean, no changes in this PR)Pattern Consistency Audit
tag-rowclass used consistently in all 5 locations:note.html,tag_notes.html,project_notes.html, and 4 doc-list sections inlanding.htmlsection-headerclass used for all 4 doc category headings inlanding.html(SOPs, Architecture, Conventions, Templates).brand->.nav-links->.nav-authwithflex-wrap: wrapparentlogin-form,login-field,login-label,login-input,login-submit,login-message,login-error)Mobile Breakpoint Analysis
@media (max-width: 600px)breakpoint — each nav section getsflex-basis: 100%for stacking. Brand row, links row, auth row. Correct flexbox pattern.<span>elements used for.nav-linksand.nav-auth— valid since they become flex items indisplay: flexparent (nav), makingflex-basiswork correctlymainpadding reduced to0.75rem— prevents horizontal overflow at 375px.card-gridgoes single-column — prevents overflow fromminmax(280px, 1fr)on narrow screensh1reduced to1.4rem— appropriate for mobileRegression Check
.section svgand.note-content svgselectors still present for mermaid lightbox click targets.sectiondiv — lightbox JS still works.table-scrollwrapper CSS unchanged — table horizontal scroll preservedpre.mermaidstyling unchanged — no regressions.auto-linkCSS unchanged — no regressionssanitized_content | saferendering path unchanged innote.htmlPre-commit Config
ruff-formatandruffhooks configuredv0.15.2— matches locally installed versionBLOCKING
None.
SUGGESTION
None.
NIT
v0.15.2in config vsv0.15.4latest. Not urgent since v0.15.2 matches the installed version, but worth bumping whenever convenient.Verdict
APPROVE — All prior round findings are fixed. Zero inline styles across all 9 templates. CSS patterns are consistent. Mobile breakpoint layout is correct. No regressions in mermaid, lightbox, auto-links, or table scroll. Pre-commit config is properly configured. This PR is clean and ready to merge.