Repository source: docs/plans/layered_interface/layered_interface_step3_development_plan.md
Layered interface: Step 3 development plan
Completion Contract
Normal entry: a new visitor opens mitrapclub.com on a phone and sees the base view with beginner tips.
End-to-end outcome: they tap the π, the advanced parts appear with explanation bubbles, and other open tabs follow. "I already know this stuff" hides the tips. Another π tap returns to the base view.
Required recovery: when the cookie and localStorage disagree, or localStorage was cleared, the page settles on the newer setting without a visible jump.
Deployment check: after deploy, a cached mitrapclub page is byte-identical for two visitors with different settings, and only
/layer.cssdiffers.Release condition: the flag is on for mitrapclub only, and Ilya has tried both switches on his iPhone.
Key Risks
High risk:
/layer.csscached across visitors. Impact: one visitor's setting reaches another. Validation: Stage 1 checks the route against the high-traffic and static rules inpublic/.htaccess. Mitigation: the route always runs through PHP and is sent as private and uncached.High risk: the base view hides something members need. Impact: members get stuck. Validation: Stage 2 lists every nav item and page control as base or advanced, for Ilya to check. Mitigation: the π is always visible and restores everything.
A layer flash on cached pages. Impact: content jumps after load. Validation: Stage 1 loads
/layer.cssin the head, before paint. Mitigation: the same timing as the theme stylesheet.The π is hard to tap on an iPhone SE. Validation: Stage 3 checks a 44-point target. Mitigation: a larger invisible tap area around a small glyph.
Concepts touched
Site profile, page theme, no-script presentation, feature flags, static publication. Stage 6 adds a new concept page: layer setting.
Stage 1
Goal: add the switch settings and
/layer.css, with no visible change yet.Dependencies: none.
Expected changes:
A new flag,
FORUM_LAYERED_INTERFACE_ENABLED, off by default; themitrapclubsite profile turns it on.One cookie,
layer-hint, holding both switches and the time they were set.A storage key per site,
forum-<namespace>-layer, beside the other keys inBrowserRuntimeProfile.php.A
/layer.cssroute that reads the cookie and returns the hiding rules. It is sent as private and uncached and never takes the static path.With the flag on,
layout.phplinks/layer.cssin the head, next to the theme stylesheet.
Verification approach: a PHP test for each cookie value, a missing cookie and a malformed cookie. A check that the
.htaccessrules never serve/layer.cssfrom a cache. With the flag off, page HTML is unchanged.Risks or open questions: whether the flag takes its default from the site profile or the profile sets the flag. Resolve by following
musicSection's pattern.Canonical components/API contracts touched:
FeatureFlagRegistry,SiteProfileRegistry,BrowserRuntimeProfile.php,templates/layout.php,public/.htaccess, the router inApplication.php.
Stage 2
Goal: mark the four content groups and make the mitrapclub base view.
Dependencies: Stage 1.
Expected changes:
Four plain class names: base (no class),
beginner,advanced, andadvanced-beginnerfor tips that show only when both switches are on. One combined name replaces Pollyanna's nesting.CSS in
site.csshides each group according to/layer.css. Pages without the flag keep showing everything.On mitrapclub, base keeps the tracks queue, the share box and the next meeting. The other nav items and board tools become
advanced. A list goes in the plan folder for Ilya to check.
Verification approach: screenshots of the mitrapclub home and
/tracks/with each switch combination, with and without scripts.Risks or open questions: the base nav list needs Ilya's confirmation before Stage 3.
Canonical components/API contracts touched:
public/assets/site.css,templates/partials/nav.php, the tracks and calendar templates.
Stage 3
Goal: the π works without JavaScript.
Dependencies: Stage 2.
Expected changes:
A small π in the bottom-right corner of every page with the flag on. It is not inside the status bar, which screen readers skip.
The π is a plain link to a
/layerroute. The route turns advanced on or off, leaves beginner as it is, writes the cookie and returns to the same page.The π has a text label for screen readers, a tap target of at least 44 points, and a lit look while advanced is on.
Verification approach: a no-script browser test taps the π, sees advanced and taps back. A keyboard-only test reaches and activates it.
Risks or open questions: the return address must stay on the same site, so the route rejects outside addresses.
Canonical components/API contracts touched:
templates/layout.php, the router inApplication.php, the no-script rules insite.css.
Stage 4
Goal: instant switching and cross-tab updates with JavaScript.
Dependencies: Stage 3.
Expected changes:
A small script switches without a reload, writes both the cookie and localStorage with the same time, and updates the page root.
A
storagelistener switches other open tabs, asmember_approval.jsdoes.A head script, beside the theme script, compares the two copies before paint. The newer copy wins and the other is rewritten.
A comment explains why both copies exist: the cookie for the server and
/layer.css; localStorage for durability in some browsers and for other tabs.
Verification approach: a browser test with two tabs, one switch, and the other tab updated within one second. A test with an older cookie and a newer localStorage value, and the reverse.
Risks or open questions: none beyond the Key Risks.
Canonical components/API contracts touched:
templates/layout.phphead script,public/assets/theme_toggle.js(pattern only),public/assets/member_approval.js(pattern only).
Stage 5
Goal: beginner tips and the "Did you click the π?" help line.
Dependencies: Stage 4.
Expected changes:
A few
beginnertips on the base view, andadvanced-beginnerbubbles beside the main technical details, such as signatures and keys.An "I already know this stuff" ✕ on each tip. It turns beginner off, through the same
/layerroute and script.The mitrapclub About page answers "Where is everything?" with "Did you click the π?"
Verification approach: screenshots with beginner on and off. A test that ✕ leaves advanced unchanged.
Risks or open questions: the tip wording needs Ilya's approval.
Canonical components/API contracts touched: mitrapclub editorial content,
templates/pages/about.php.
Stage 6
Goal: replay Ilya's iPhone case and document the feature.
Dependencies: Stage 5.
Expected changes:
A browser check that copies Safari's behavior: localStorage cleared, the cookie set to advanced. The page starts in advanced and rewrites localStorage.
A check on ZenMemes and QDB that pages look exactly as before.
A new concept page,
docs/concepts/layer_setting.md, and a row in the concepts inventory.Manual guidance for Ilya's real iPhone check after deploy.
Verification approach: the checks above, plus the smoke set and the tests for changed files. The full suite is left to Ilya.
Risks or open questions: the real iPhone check happens only after deploy; the plan records it as pending until Ilya reports.
Canonical components/API contracts touched:
docs/concepts/,tests/browser/.
— Claude · 2026-12-04 UTC
Approval
Approved Step 3 on 2026-12-04 by Ilya, by voice while driving ("I approve step three"). Open before Stage 3: Ilya confirms the base nav list. Open before Stage 5: Ilya approves the tip wording.