Skip to content

Signed-in menu links on public pages - #82

Merged
lolman420 merged 3 commits into
mainfrom
feat/kiltiskamera-link
Oct 23, 2026
Merged

lolman420 merged 3 commits into
mainfrom
feat/kiltiskamera-link

Conversation

@lolman420

@lolman420 lolman420 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Continues #81, which added Kiltiskamera to the menus. Public pages are static, so until now a member browsing them saw neither the signed-in-only links nor working links to member pages. This PR fixes both without the public HTML naming any of those addresses.

Signed-in-only links (Galleria, Kiltiskamera)

  • The header marks signedIn rows data-signed-in in the member build. The public build gets data-signed-in-probe="/fi/jasenille/", which is the same door the sign-in button already points at.
  • assets/js/signed-in.js fetches that address with redirect: "manual". A signed-out reader gets the Keycloak redirect, and nothing changes. A member gets the member build of the page, and the script copies its data-signed-in rows into the same positions in the desktop mega menu and the phone menu.

Member pages (PTER, Kokouspöytäkirjat / Meeting minutes)

  • In the public build these are grey labels. The labels now carry data-members="<label>" in the mega menu, the phone menu and the sidebar. For a signed-in reader, the script swaps each label for the matching link from the member build's header. The public HTML still holds no member address.

Caching

  • A "not signed in" answer is cached in sessionStorage for the tab, so signed-out readers make only one probe request. Any member-tree page resets it, and signing in always lands on one.

Testing

  • Both builds pass check-trees.sh.
  • I tested in a browser against a local mock of the gate:
    • Signed out: nothing changes.
    • Signed in: Galleria and Kiltiskamera appear, and PTER and Kokouspöytäkirjat become links, in the mega menu, the phone menu and the sidebar, in Finnish and English.
    • After logout everything goes back.
  • The preview host is gated as a whole and shows every link anyway, so the probe itself only runs in production.

🤖 Generated with Claude Code

lolman420 and others added 2 commits October 23, 2026 20:43
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The public HTML still names neither the gallery nor Kiltiskamera. A small
script asks the gate for the member landing page, the address the sign-in
button already names, and copies the rows the member build marks
data-signed-in into the same places in the menus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Esikatselu on poistettu, koska tämä pull request on suljettu.

PTER and the meeting minutes are grey labels in the public build, which may
not name member addresses. The labels now carry data-members, and
signed-in.js swaps each for the member build's link once the gate says the
reader is signed in: in the mega menu, the phone menu and the sidebar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lolman420 lolman420 changed the title Feat/kiltiskamera link Signed-in menu links on public pages Oct 23, 2026
@lolman420
lolman420 merged commit 21d5971 into main Oct 23, 2026
5 checks passed
@lolman420
lolman420 deleted the feat/kiltiskamera-link branch October 23, 2026 19:05
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.

1 participant