Fix #138: Fix navigation bar link icons and text appearing on separate lines #139
Loadingโฆ
Reference in New Issue
Block a user
No description provided.
Delete Branch "typosaurus/ticket-138"
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?
Resolves #138.
Plan
Implementation Plan
1. Add "Quizzes" link to navigation templates
File:
devplacepy/templates/base.html.topnav-links): Insert the new link after the existing "News" link so the order becomes:๐ Home | ๐ Posts | ๐ฐ News | ๐ Gists | ๐ Projects | ๐ฑ Farm | ๐ QuizzesUse the same HTML structure as the other links:
.topnav-mobile-links): Insert a corresponding link with the mobile class:quizzes.indexdoes not exist yet. Choose a placeholder route that corresponds to the future Quizzes feature (e.g., a static URL/quizzes). Since the ticket is only about the layout bug, create a minimal route indevplacepy/routes/quizzes.py: Register the blueprint inapp.py.2. Harden
.topnav-linkCSS to prevent line-wrappingFile:
static/css/base.cssAdd to
.topnav-linkblock (line ~622):This matches the pattern already used for
.topnav-mobile-linkand ensures the icon and text always stay on one line.Optionally ensure
.iconhasdisplay: inline-block(line ~952):This makes the
width: 20pxeffective, though the flex approach on the parent already provides alignment.3. Add Playwright e2e test for icon+text layout
File:
tests/e2e/root.py(or create newtests/e2e/quizzes.py)Add a test that:
.topnav-linkelements.getBoundingClientRect()top coordinate of the.iconchild equals the top coordinate of the text node (or the anchorโsinnerTextappears on same line)..topnav-linkhas a computedline-heightdifferent from itsheight(indicating wrapping), or that the anchorโs scrollHeight equals its clientHeight.Example:
4. Ensure test infrastructure is solid
playwright install chromium.Definition of Done
.topnav-linksand mobile.topnav-mobile-linksnavigation bars with correct icon and text..topnav-linkCSS class now includesdisplay: flex; align-items: center; gap: 0.375rem; white-space: nowrap./quizzes) and the link points to it without 404 errors.test_topnav_links_icon_and_text_same_linepasses, verifying that for every.topnav-linkthe icon and text bounding boxes have the same vertical position.playwright install chromiumif not already done in CI.)Opened automatically by Typosaurus.
Pull request closed