Rule handbook metadata
- Rule
AI.JS.BEHAVIOR_DISCOVERABILITY· laneai- Page status
- stale
- page_version
449ba47acb31c696e8e48f933cc72982605fb3541c731b0d8c7e71665973673e- generated_at
- 2026-05-19T21:45:00.000Z
- registry_fingerprint
6773fda516344e110b5a7b1435e655e1264e773825ca8bbe62194189891c42ba
How this rule is fixed
This is an AI-enabled rule. Pass/fail requires model judgment; there is no deterministic fixer in the pilot registry.
- Harness:
invoke-ai-ruleset-harness.shrunsdesign-rules/ai/run-design-ai-rule.shon the Before fixture and expects findings with matchingprincipleId. - Remediation: Cursor agent plans from
forge-ux-remediation.plan.mdafter sitewide audit — not handbook After copy.
Detection module: docs/design/ux-audit/ai-enabled-design-principles.md#ai-js-behavior-discoverability. Scroll down for Before / After examples and Evidence and remediation steps.
Purpose
Kitchen Sink ships interaction scripts under js/ (family Ksj: nav/offcanvas, theme picker, diagram modals, chart mounts, presentation fullscreen, roadmap edits, home tile expansion). Many behaviors are progressive enhancements on markup from components/layouts.py and transforms—not obvious from static HTML alone.
Deterministic gates (DET.JS.PROGRESSIVE, DET.JS.NO_CONSOLE_ERROR, DET.NAV.FOCUS_ORDER, DET.MOTION.PREFERS_REDUCED) prove baseline degradation, console hygiene, focus order, and motion prefs. This AI rule judges discoverability: can a visitor or operator infer what will happen before they click, tap, or hover—and find a keyboard/touch path when the script adds behavior?
Plan: Walk golden paths on showcase and handbook shells; list controls whose behavior is script-only (expand, modal, offcanvas, theme, chart fetch, fullscreen). Do: Add visible affordances (forge-diagram-trigger, labeled buttons, forge-support helper lines) and document non-obvious shortcuts in page copy or contracts. Check: Each non-default interaction has at least one of: visible label/hint, persistent helper copy, or documented operator note; hover-only cues are supplemented for keyboard/touch. Adjust: When the same gap repeats (e.g. every expandable diagram missing forge-diagram-trigger), propose a DET.* candidate or tighten Ksj forbidden patterns.
Passing signals
- Expandable diagrams use
forge-diagram-trigger/ks-diagram-triggerso CSS surfaces "Click to expand" (and catalog keys likedata-diagram-keytie toopenDiagramWithDetail). - Mobile handbook chrome exposes a fixed
data-bs-toggle="offcanvas"control witharia-label="Open navigation"andaria-controls="docNavOffcanvas"(Kco). - Theme switching uses
forge-theme-triggerwitharia-label,title, and visible copy—not icon-only mystery meat. - Script-driven nav (
docs-nav.js,fs-nav-dropdown.js) keepsaria-expandedin sync with open panels. - Chart mounts (
data-ks-chart,ks-chart-mount) show loading/empty copy fromforge-data-charts.jsbefore data arrives. - Non-obvious operator flows (presentation fullscreen exit, roadmap edit handles) have visible controls or in-page "How to use" copy.
- Keyboard users reach the same outcomes as hover-reveal hints (
DET.NAV.FOCUS_ORDERwhen focus is managed).
Failing signals
- Clickable diagram or tile with no
forge-diagram-trigger, no helper line, and noaria-label—behavior exists only after trial-and-error. - Hover-only affordance (
::after"Click to expand") with no focus-visible equivalent or persistent text for touch users. - Mobile nav hidden behind a missing, unlabeled, or desktop-only control while
mainassumes sidebar IA. - Global shortcuts or double-click edits (
nested-roadmap.js) with no documented affordance on the page or in the contract. onclickhandlers on inert-looking blocks (figure,div) with no role, label, or visual button metaphor.- Theme, lens, or tab controls that change layout with no
aria-expanded/ active state and no helper copy. - Chart or modal surfaces that open on load or timer with no dismiss hint (
AI.MOTION.INTENTIONALITYoverlap).
Before example
Before (failing example)
Architecture overview
Use the diagram to explain the flow.
Handbook content—no nav button on narrow viewports.
Failing KS markup: expandable diagram and mobile nav depend on script, but nothing signals clickability or offcanvas entry; theme control is icon-only.
After example
After (passing example)
Architecture overview
Select the diagram to open a larger view with step-by-step notes.
Passing KS markup: labeled expand affordance, mobile offcanvas trigger, theme control with accessible name, and persistent helper copy.
Evidence and remediation
Capture: For each scripted surface, record URL, viewport width, and interaction type (click, hover, keyboard). Screenshot default and hover/focus states for forge-diagram-trigger, offcanvas open, and theme dropdown. Note whether helper copy appears without hover. Log console for golden paths (DET.JS.NO_CONSOLE_ERROR).
Remediate (in order):
- Classify interactions: obvious (native
<button>,<a>) vs non-obvious (diagram expand, tile tilt, roadmap edit, fullscreen). - For non-obvious controls: add
forge-diagram-triggeror a visible button/link; pair withforge-supportone-liner above the control. - Fix naming:
aria-label,title,aria-controls,aria-expandedon triggers; align withKco/Ksjcontracts. - Replace hover-only discovery with persistent text or focus-visible hints; verify keyboard path (
DET.NAV.FOCUS_ORDER). - Document operator shortcuts in page prose or catalog contract when behavior cannot be inlined.
- Re-run progressive check: core content readable with JS disabled (
DET.JS.PROGRESSIVE). - If the same missing hint repeats across pages, propose a deterministic companion (e.g. require
forge-diagram-triggerwhenonclickopens diagram modal).