trackslash
TRACK-46 P2

Global side navbar duplicates after creating a new token

0
All issues

Description

After creating a new API token, the global side navigation is rendered twice — two sidebars appear side by side.

Steps to reproduce

  1. Go to Tokens.
  2. Create a new token.
  3. Observe the page after the create action completes.

Expected

One global side navbar, unchanged by the token creation.

Actual

Two global side navbars render side by side.

Investigation so far

The original guess (an htmx swap nesting a full page inside the layout) is disproven for this flow. Verified against source:

  • internal/server/templates/tokens.html:13 — the create form is a plain <form method="post" action="/tokens">. The file contains zero hx- attributes.
  • internal/server/templates/shell_sidebar.html:71 — the Tokens entry is a plain <a href="/tokens">, not hx-get/hx-target like the other sidebar links.
  • internal/server/ui_account_pages.go:103 uiCreateToken → renderUITokens (:143) → renderUIShell, which renders the full shell template. Correct for a normal browser POST: the browser replaces the whole document, producing one sidebar.
  • No hx-boost anywhere, so the plain form is not ajaxified.
  • internal/server/static/service-worker.js is push-only with no fetch handler, and preload.js only sets a sidebar-collapsed attribute. Neither can duplicate the shell.

So the duplication is real but not yet explained by the token-create path itself. The nesting mechanism does exist elsewhere — #main (templates/shell_main.html:2) is a sibling of the sidebar inside .app-shell (templates/shell.html:24-27), so any full-page response swapped into #main renders two sidebars side by side. See the related login-redirect bug for a confirmed instance.

Next step

Needs repro detail: browser, and whether the page was reached by a direct navigation or via browser back/forward (htmx history cache restores a body snapshot and is the leading remaining suspect). A screenshot and the HTML of .app-shell at the time would settle it.

Sub-issues

0

Linked issues

0

GitHub

0

No branches or pull requests linked.

Comments

0
No comments.