oliver-zehentleitner / maity

clean-up: G7 landing routes and assets: an unreachable badge branch, a stale "Draft" header, duplicated page rules in public-pages.css

Sign in to report

tsk-g897yh3qkj4w Open

From the clean-up audit tsk-hgnbapyw7hnh (uncovered files, G7 sign-in, joining, landing and notification routes), read at 9dfd4b65. Every line number is at 9dfd4b65. Paths are under hub/src/maity_hub/.

The module code of area 11 is on tsk-tnetc5fgr7pm. This card is routes/badges.py and landing_assets/. routes/landing.py and badge_template.py gave nothing new (see "Covered elsewhere").

1. Dead code: the badge's else branch cannot run, and the policy list is written twice

  • Kind: dead code, duplication.
  • Files: routes/badges.py:44-46 answers not_found (with the shared budget) unless _served (:63-64) is true, and _served admits only members and agents_online. So :52-53 (else: # an unrecognised stored policy never makes a project public) never runs; the two policy names are listed at :48-51 and again at :64.
  • Also: limit_source and limit_not_served (:24-36) are public names with no caller outside the module.
  • Proposal: keep one list of served policies (for example badges.POLICIES), drop the dead branch or make it the only check, and make the two limit helpers private.
  • Effort: S. Risk: none (the not-served path keeps its shared budget).

2. Docs drift: public-pages.css still calls itself a draft

  • Kind: docs drift.
  • Files: landing_assets/public-pages.css:1-2 ("Draft: pages without a session …"). The sheet is served at /assets/landing/public-pages.css (landing_files.py:99-101) for login, register, the legal pages, /explore and the stored public pages, and the dashboard links it (web/js/site-chrome.js:17).
  • Proposal: replace the header with what the sheet is for now (the door, the legal and stored pages, /explore, in the landing's tokens).
  • Effort: S. Risk: none.

3. Duplication: the join page repeats the stored page's table and quote rules

  • Kind: duplication.
  • Files: landing_assets/public-pages.css:141-143 (.stored-page table, th, td, blockquote) and :166-168 (.join-page with the same three rules, byte for byte).
  • Proposal: one rule each with both selectors (.stored-page table, .join-page table …).
  • Effort: S. Risk: none (web smoke reads this file at web/tools/smoke.js:16797 only for the narrow-panel rule).

Checked, no finding

  • landing_assets/public-pages.css:22, :58 and :61 set dark values only under [data-theme="dark"]. That is not a dark-mode gap: the elements they style (.flag.session-ended, .send-status) exist only on the dashboard, where web/css/app.css:31-32, :52, :99-100 and :110 define --flag-bg, --error-bg and --field for both themes and for the system setting.
  • badge_template.py repeats the word mark's path in both templates; hub/context/serving.md:123-131 records that the templates are byte-for-byte copies of the approved brand files, so that stays.

Covered elsewhere

  • The If-None-Match handling in routes/badges.py:57-59: tsk-k25qqhygend8.
  • public, max-age=60 as routes/badges.py:21 CACHE, and the frame reads in routes/landing.py:118 and :166-169: tsk-tnetc5fgr7pm items 4 and 1.
  • routes/landing.py:23-25 _require_admin: tsk-hbpjgp03esez item 1.

Effort sum: 3 S.