ZDDC/browse/js
ZDDC d90975662f feat(zddc): Phase 4b — grid mode driven by cascade default_tool
The /incoming/ path regex in browse/js/grid.js was the second-most
visible client-side hardcode of the canonical convention. Migrating
it to the cascade:

  Header surface:
    X-ZDDC-Default-Tool: <name>   The cascade-resolved default tool
                                  for the listing's directory. Empty
                                  header = no default declared.

  Client wiring:
    loader.fetchServerChildren reads the header into
    state.scopeDefaultTool on every listing fetch (initial mount,
    rescope on dblclick, popstate). grid.classifierAvailableHere
    now returns scopeDefaultTool === 'classifier' instead of
    regex-matching the URL.

  Effect:
    Grid mode auto-activates wherever the cascade picks classifier
    as the default — currently archive/<party>/incoming per
    defaults.zddc.yaml. An operator who sets default_tool: classifier
    on a custom directory gets grid mode there too, no code change.
    An operator who removes the default at incoming sees grid mode
    stop auto-activating there.

  Bootstrap timing fix:
    The initial events.init() runs applyResolvedViewMode before the
    detection fetch completes, so state.scopeDefaultTool is empty
    at that point and grid never auto-activates on first paint.
    app.js bootstrap now re-applies the resolved view mode after
    autoDetectServerMode returns, so a fresh /incoming URL lands
    on grid mode immediately.

The /incoming/ regex is gone. Two client hardcodes remaining
(archive source heuristics, shared/nav stage strip) — Phase 4c/d.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 16:15:25 -05:00
..
app.js feat(zddc): Phase 4b — grid mode driven by cascade default_tool 2026-05-11 16:15:25 -05:00
events.js fix(browse): URL-driven grid mode (?view=grid), default-on inside incoming/ 2026-05-11 13:18:37 -05:00
grid.js feat(zddc): Phase 4b — grid mode driven by cascade default_tool 2026-05-11 16:15:25 -05:00
init.js feat(zddc): Phase 4b — grid mode driven by cascade default_tool 2026-05-11 16:15:25 -05:00
loader.js feat(zddc): Phase 4b — grid mode driven by cascade default_tool 2026-05-11 16:15:25 -05:00
preview-markdown.js Round of UX fixes: tool strip removed, MDL routing, browse markdown layout, reviewing depth-2 2026-05-11 12:30:34 -05:00
preview.js feat(browse): two-pane shell + markdown plugin + grid mode (Phases A/B/C/D) 2026-05-10 15:46:51 -05:00
tree.js feat(zddc): canonical lowercase + .zddc display map + archive project titles 2026-05-11 13:03:53 -05:00
upload.js feat(zddc): Phase 4a — drop_target cascade key, browse upload zone migrated 2026-05-11 16:12:41 -05:00