Skip to content

Make the whole Navbar mobile menu row tappable (two-tap bug) - #98

Open
bencounsell wants to merge 1 commit into
mainfrom
claude/sharp-keller-58wmu5
Open

Make the whole Navbar mobile menu row tappable (two-tap bug)#98
bencounsell wants to merge 1 commit into
mainfrom
claude/sharp-keller-58wmu5

Conversation

@bencounsell

Copy link
Copy Markdown
Member

Summary

Leaf pages in the Navbar mobile menu rendered as a padded, background-styled <div> that toggled submenu state on tap (a no-op for pages without children), while the actual link's hit area was limited to the text itself. Tapping the visible row did nothing, so navigation read as needing two taps (forum threads 56937, 56979).

  • templates/include/mobile_item.html — leaf pages are now a full-row <a> carrying {{classes.mobile.item}}, so tapping anywhere on the row navigates. Pages that also have children render the styled link with flex-1 plus a separate chevron <button @click.stop> that toggles the submenu without navigating. The unreachable @if(page.isFolder) branch was removed (index.html routes folders to mobile_folder.html, which is unchanged).
  • templates/include/mobile_submenu.html — second-level leaf rows had the identical defect and get the same treatment. Third-level rows (mobile_submenu_menu.html) already put the item classes on the link.
  • aria-current / data-active-child move onto the styled <a>, since the aria-[current=page]: / data-[active-child]: variants generated from properties.config.json are self-referential — active highlighting still works, including pages whose only children are hidden from the menu.

Templates only; hooks.source.js / properties.config.json are untouched, so no generated files needed rebuilding.

Testing

  • All 53 existing tests pass (node --test test/*.test.mjs).
  • Headless-Chromium preview built from the exact rendered markup of the new templates, using the pack's vendored alpine.js + alpine-collapse.js: 19/19 hit-area checks passed — row padding navigates at every level, chevrons toggle without navigating and report aria-expanded, tapping a child link keeps its parent submenu open, folder rows still toggle across their full width.

Refs Basecamp todo 10145374696.

🤖 Generated with Claude Code

https://claude.ai/code/session_017D3UxSNcTvJZn9K7Ffz5Hs


Generated by Claude Code

Leaf pages in the mobile menu were rendered as a padded, background-styled
div that toggled submenu state on tap (a no-op for pages without children),
with the actual link's hit area limited to the text itself. Tapping the
visible row area did nothing, so navigating read as needing two taps.

The mobile item row classes now live on the <a> itself so the entire padded
row navigates, matching how mobile_folder.html already styles its full-width
toggle button. Pages that also have children get a separate chevron button
with @click.stop to open the submenu without navigating. The same fix is
applied to second-level leaf rows in mobile_submenu.html; third-level rows
(mobile_submenu_menu.html) already used full-width links.

aria-current and data-active-child move onto the styled element, since the
aria-[current=page]/data-[active-child] variants generated from
properties.config.json are self-referential. The unreachable isFolder branch
in mobile_item.html is removed — index.html routes folders to
mobile_folder.html, which is unchanged.

Refs Basecamp todo 10145374696; forum threads 56937, 56979.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017D3UxSNcTvJZn9K7Ffz5Hs

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants