Fix #138: Fix navigation bar link icons and text appearing on separate lines #139
Closed
typosaurus
wants to merge 1 commits from
typosaurus/ticket-138 into master
pull from: typosaurus/ticket-138
merge into: :master
:master
:typosaurus/169-implement-links-to-the-official-ios-app-in-the-web-app
:typosaurus/162-add-non-color-indicator-to-vote-button-state
:typosaurus/132-missing-notification-when-another-user-comments-on-a-post-th
:typosaurus/134-cosmetic-title-replaces-clickable-username-on-leaderboard
:typosaurus/157-add-badge-earned-info-to-user-profile-badges-api-response
:typosaurus/ticket-150
:typosaurus/ticket-152
:typosaurus/ticket-148
:typosaurus/ticket-146
:typosaurus/112-expose-level-progress-percentage-in-profile-api-response
:typosaurus/113-fix-badge-names-returning-null-in-profile-endpoint
:typosaurus/138-fix-navigation-bar-link-icons-and-text-appearing-on-separate
:typosaurus/ticket-138
:typosaurus/ticket-135
:typosaurus/ticket-132
:typosaurus/ticket-110
:typosaurus/ticket-116
:typosaurus/ticket-113
:typosaurus/ticket-114
:typosaurus/ticket-111
:typosaurus/ticket-112
:typosaurus/ticket-106
:typosaurus/ticket-104
:typosaurus/ticket-84
:typosaurus/ticket-93
:typosaurus/ticket-73
:typosaurus/ticket-89
:typosaurus/ticket-85
:typosaurus/ticket-86
:typosaurus/ticket-88
:typosaurus/ticket-105
:typosaurus/ticket-95
:typosaurus/ticket-102
:typosaurus/ticket-91
:typosaurus/ticket-90
:typosaurus/ticket-87
:typosaurus/ticket-72
:typosaurus/ticket-81
:typosaurus/ticket-83
:typosaurus/ticket-78
:typosaurus/ticket-74
:typosaurus/ticket-82
:typosaurus/ticket-97
:typosaurus/ticket-99
:typosaurus/ticket-68
:typosaurus/ticket-66
:typosaurus/ticket-75
:typosaurus/ticket-61
:typosaurus/ticket-44
:typosaurus/ticket-57
:typosaurus/ticket-48
:typosaurus/ticket-64
:typosaurus/ticket-94
:typosaurus/ticket-103
:typosaurus/ticket-26
:typosaurus/ticket-71
:typosaurus/ticket-7
:typosaurus/ticket-70
:typosaurus/ticket-10
:typosaurus/ticket-65
:typosaurus/ticket-69
:typosaurus/ticket-67
:typosaurus/ticket-76
:typosaurus/ticket-21
:production
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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:app.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