Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

04 — Information Architecture (Settings Module)

Where the Settings module lives in the shell (00-shared/05 §2: Settings → /settings, role: admin) and how its data surface is organized. Everything derived from setting.schema.ts (groups), settings.controller.ts (API), and the organizations module's separate embedded-settings surface.


1. Placement in the app shell

AppShell
 └─ Settings (nav destination, admin) ─ /settings
     ├─ Settings hub (this module): group tabs + key/value list
     ├─ Roles & permissions   (RBAC module: /settings/roles, /settings/members)
     ├─ Security              (Auth module: /settings/security/*)
     ├─ Organization          (/organization — embedded settings + branding + flags)
     └─ Profile               (avatar menu → /settings/profile)

The module owns only the key/value Settings hub. Sibling surfaces under the same /settings prefix are owned by other modules (see design-docs/rbac/04, design-docs/auth/04).

2. Data model: groups (fixed enum)

GroupEnum valueTypical contents (illustrative; no registry exists)Source
Academicacademicgrading scale, passing %, academic labelssetting.schema.ts:8
Attendanceattendancegrace period, late threshold, working dayssetting.schema.ts:9
Gradinggradinggrade bands, roundingsetting.schema.ts:10
Notificationnotificationchannel toggles, digest timessetting.schema.ts:11
Themethemeprimary/secondary color (parallels org settings.theme)setting.schema.ts:12
Generalgeneral (default)anything ungroupedsetting.schema.ts:13,24-25
COACHING(planned)batch defaults, test series config, DPP settingsIMPLEMENTATION_PLAN.md:773

Server sorts list by group: 1, key: 1 (settings.service.ts:11) — the UI renders tabs in enum order (setting.schema.ts:7-14 declaration order) and rows alphabetically per group.

3. Route table (module-owned; extends 00-shared/05 §4)

RouteScreenAuthSource API
/settingsSettings list (hub)JWT + settings.read (client)GET /settings[?group=]
/settings/group/:groupGroup-filtered list (deep link)sameGET /settings?group=
/settings/:keySetting detail + editJWT + settings.read/updateGET /settings/:key, PUT /settings
/settings/403shared permission screen

4. Screen hierarchy

flowchart TD
    SET[/settings/] --> GRP[/settings/group/attendance/]
    SET --> DET[/settings/:key/]
    DET --> EDIT[typed editor inline]
    SET --> BULK[multi-select → Save all]
    subgraph sibling surfaces (other modules)
      RBAC[/settings/roles/]
      SEC[/settings/security/]
    end
  • List is the hub; detail is a push (phone) / right pane (tablet+, master-detail ≥840 dp).
  • Editing happens in place on the list (inline typed editor per row) or on the detail page — both call the same PUT /settings upsert (see 03 §2, 08).

5. Modal hierarchy (module, per 00-shared/05 §5)

  1. Snackbar/toast — "Saved", "Setting deleted", "Copied (JSON)".
  2. Bottom sheet — JSON editor (multi-line, needs height), delete confirm for inline rows.
  3. Dialog — delete confirm (destructive), "Discard changes?" on dirty exit, JSON parse error details.
  4. Full-screen page — setting detail (key, group, value, meta).
  5. Loader — row-level saving spinner; never full-screen dual column (list is cached).

6. Screen relationships & state handoff

  • Detail edits return to the list with the row refreshed from the server response (data: Setting from PUT /settings).
  • Group chip state survives navigation via SettingsCubit (selected group held in state, 13_State_Management.md).
  • Delete pops detail → list; row removed on server 200 (or 404 treated as removed).

7. Cross-surface: embedded org settings (context, not module-owned)

SurfaceLocationSource
Org embedded settings (attendance/academic/theme objects)/organization → Settings tabs (Organizations module S4)organization.schema.ts:96-112; organizations.controller.ts:56-72
Org branding (colors/logo/favicon)/organization → Brandingorganization.schema.ts:114-120
Feature flags (boolean toggles)/organization → Feature flagsfeature-flags.controller.ts:23-58; feature-flag.schema.ts:9-23

Design consequence: two surfaces can hold overlapping concepts — settings.theme keys in this module vs organization.settings.theme + branding (dual-surface confusion, see design-docs/organizations/09 § — "Which settings apply?" OQ). The Settings hub must carry a visual note: "Org-level config (attendance, theme, working days) also lives under Organization" with a cross-link, until the blueprint's organization_settings collection (COLLECTIONS.md:767-783) consolidates them (planned).

8. Quick actions / FAB / context menus

  • FAB (list, extended): "New setting" → creates an unsaved key (group default GENERAL).
  • Row menu (AppMenu): Edit value, Duplicate key (new key copy), Delete.
  • Multi-select (long-press rows on phone; checkboxes on desktop) → bottom Save all bar.
  • Keyboard (desktop): Ctrl+F focuses search (client-side); + / N new setting; Esc closes editor/confirm; Ctrl/Cmd+Enter saves from the JSON editor (00-shared/08 §2).

9. Accessibility of IA

  • One headlineMedium per screen; group tabs announced as tab list with selected state.
  • Focus order: search → group chips → first row; row edit opens editor with focus in value.
  • Group chips never color-only — label + selected pill (00-shared/09 §9).