docs(principles): a front end displays state; it does not reimplement behaviour
User ruling 2026-09-20: minimise the amount of new code a new UI framework needs. Centralise logic in a redux-like store so a second or third front end is a function from state to pixels plus a wire for events, not a second implementation of how the application behaves. Names the pieces that already exist as what they are -- Command is the action, reduce_view and WidgetCache::apply are the reducer, ViewState plus the caches are the store, Sessions::apply is dispatch -- and gives the question to ask of any front-end code: would a third front end have to write this again? Three things make it concrete: the measure is lines of framework-specific code and should trend to 'paint and wire'; a derivation done twice is the defect even when both copies are correct today (improvise-edp is the worked example, gotcha 44 is the same defect still open); and sharing a table beats testing two copies of it, which is why the keymap is shared rather than mirrored. Also says what legitimately stays local: painting, event wiring, and a semantic-value-to-framework-type lookup like AxisColor -> axis_fg. Sections 5-7 renumbered; the §6 testing references in repo-map.md and the code-review skill updated with them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EoW5BB87ZZdm96SvBTWawH
This commit is contained in:
+4
-4
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user