Terminal UI in corelib targets TTY character grids.
Contracts and edge cases
Platform spec article
Contracts and edge cases
Spec standingStandard
-
Console controls operate on cell grid, not pixels.
Context
Decision
Rule Detail Coordinates Rows/columns in character cells Graphics Pixel graphics are out of scope Consequences
Layout helpers align with
Console.ConsoleSizeand resize events.Verification anchors
Console control tests under
packages/console. -
Periodic redraw uses LiveTick; callers own fiber/channel loops.
Context
Corelib should not embed a full UI framework inside controls.
Decision
Rule Detail Tick LiveTickdrives periodic redrawLoop Callers compose fibers/channels around tick Consequences
Interactive samples pair LiveTick with concurrency package channels.
Verification anchors
Console controls examples and tests.
- Contracts and edge cases Layout and redraw requirements for console controls.
- Design model Control tree, render context, and character-grid layout.
- Examples Panel and progress bar render patterns.
- Flow and algorithm Frame render and live tick loop.
- Verification and traceability Control layout tests and module paths.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Purpose
Section titled “Purpose”Document contracts and edge cases for the Console Controls feature: role-specific normative detail beyond the feature hub.
Canonical references
Section titled “Canonical references”- Feature hub: Console Controls
- Sibling articles in this bundle (design model, contracts, flow, examples, verification)
Detailed behavior
Section titled “Detailed behavior”Normative requirements
Section titled “Normative requirements”| ID | Requirement |
|---|---|
| CTL-001 | Frame.Render must clamp child layout to columns × rows from ConsoleSize. |
| CTL-002 | Progress ratio must be in 0..=1; out-of-range should clamp. |
| CTL-003 | Full-screen controls should emit Erase.DisplayAll before draw when ANSI enabled. |
| CTL-004 | LiveTick must not block the scheduler indefinitely; one tick == one render pass. |
Edge cases
Section titled “Edge cases”- Terminal shrink: controls should truncate lines rather than panic.
- Zero-size terminal: render may produce empty buffer.
- Resize mid-frame: next tick or
ConsoleMessage::Resizeshould trigger relayout (Console terminal events).
Verification
Section titled “Verification”See the verification and traceability article in this bundle and compiler/corelib/beskid_corelib/tests/corelib_tests/src/console/.
Related topics
Section titled “Related topics”- Parent feature hub and Terminal and console area