Feature plan: Step 1 · Step 2 · Step 3 · Step 4

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.css differs.

  • Release condition: the flag is on for mitrapclub only, and Ilya has tried both switches on his iPhone.

Key Risks

  • High risk: /layer.css cached across visitors. Impact: one visitor's setting reaches another. Validation: Stage 1 checks the route against the high-traffic and static rules in public/.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.css in 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; the mitrapclub site 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 in BrowserRuntimeProfile.php.

    • A /layer.css route 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.php links /layer.css in 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 .htaccess rules never serve /layer.css from 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 in Application.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, and advanced-beginner for tips that show only when both switches are on. One combined name replaces Pollyanna's nesting.

    • CSS in site.css hides 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 /layer route. 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 in Application.php, the no-script rules in site.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 storage listener switches other open tabs, as member_approval.js does.

    • 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.php head 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 beginner tips on the base view, and advanced-beginner bubbles 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 /layer route 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.