Skip to content

Admin nav owner only - #11

Merged
pip-install-python merged 2 commits into
mainfrom
admin-nav-owner-only
Aug 1, 2026
Merged

Admin nav owner only#11
pip-install-python merged 2 commits into
mainfrom
admin-nav-owner-only

Conversation

@pip-install-python

Copy link
Copy Markdown
Owner

No description provided.

pip-install-python and others added 2 commits August 1, 2026 15:38
The board was reachable by URL and advertised nowhere. It now has its own
"Admin" nav section in both the desktop navbar and the mobile drawer,
hidden by default and revealed server-side.

The link is COSMETIC and the tests say so. /admin/control-board already
gates itself twice -- pages/control_board.layout() re-checks on every
render, and the mutating callback re-checks before changing anything --
and it fails CLOSED when Clerk is unavailable. Revealing the link grants
nothing; hiding it stops the board being advertised to readers it would
only reject.

Three things worth keeping:

* the reveal is decided server-side, not from `clerk-auth-store`. That
  store lives in the page and a visitor can put anything in it, so the
  callback calls is_admin_user() against the real session instead.

* it uses the SAME predicate as the page rather than comparing against
  the owner's address literally. A narrower rule would hide the board
  from an ADMIN_EMAILS account that can still open it by URL, and a link
  that lies about access is worse than no link. With ADMIN_EMAILS unset
  -- today's state -- is_admin_user reduces to OWNER_EMAIL alone, which
  is the owner-only behaviour asked for.

* `url.pathname` is the trigger, not the auth store: the store only
  exists when Clerk runs, and a callback with a missing Input never
  fires, which would silently disable this wherever Clerk is off.

The id is pattern-matched because create_content renders twice; two
components cannot share a plain string id, and one ALL output reaches
both. prevent_initial_call=False is load-bearing -- the app sets
prevent_initial_callbacks=True globally, so without it the section stays
hidden until the visitor navigates, including for the owner on the page
they just signed in to.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The remaining items from the rollout checklist's "found on the email
pass" -- each of which bit a satellite that already looked finished.
Documentation site and network wiring only; no dl2.* component changed.

DEPLOY ORDER MATTERS. og:image now declares 1200x630 and the battery
reads the CDN file's real pixels, so the new card must be uploaded to
cdn.2plot.ai/github_assets/leaflet.2plot.dev.png BEFORE this ships.
Against production today the battery is 10 pass / 1 fail, and the one
failure is exactly that: "the CDN file is 1280x515, the tags declare
1200x630". That gate is deliberate.

* The network bulletin was never wired. The hub publishes announcements
  and tips and every satellite renders them in its llms.txt viewer
  header; this host had no lib/bulletin.py at all, so it showed "No
  announcements." and one generic tip where the hub publishes two. An
  unwired host still renders both panels, which is why nobody noticed.
  dash_improve_my_llms never reads NETWORK_BULLETIN_URL -- setting that
  variable without this code does nothing, silently -- so run.py now
  prints which of the two states it booted in. app_id() derives from
  lib.satellite_analytics.APP_ID: this repo has no satellite_reporter
  (the sibling copy raises ModuleNotFoundError) and AD_APP_ID is the ad
  network's long id, not the directory key.

* The social card was the wrong shape and the wrong image -- 1280x515
  (2.49:1), wider than both the OG ideal and Twitter's 2:1 slot, and the
  2plot wordmark rather than a card for this site.

* dash-clerk-auth 0.9.0 renders a dead avatar on satellites. This host
  is one. Vendored 0.9.1.

* markdown2dash was installed without --no-deps in compat_matrix.py and
  the README, so every per-Dash-version venv booted an app with no
  documentation pages and the matrix measured nothing.

* AD_APP_ID was the package name. The hub lists dash-leaflet2 under
  legacy_ids and folds it in "until leaflet's own network-standard pass
  sets AD_APP_ID=leaflet". This is that pass.

Also: the Control Board now appears in the nav for admins only (the link
is cosmetic -- the page gates itself twice and fails closed), BASE_URL
accepts APP_BASE_URL first with the legacy name as an alias, and
SITE_SHORT_NAME / OG_IMAGE_TYPE join the standard constants block.

98 tests, flake8 + actionlint clean, smoke_test 72/72.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pip-install-python
pip-install-python merged commit edef185 into main Aug 1, 2026
18 of 19 checks passed
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