Skip to content

fix(hd): align operation tables and close vanilla tech tree - #59

Open
ayleen wants to merge 18 commits into
oxce-plusfrom
calypso/rd-runtime-defects
Open

fix(hd): align operation tables and close vanilla tech tree#59
ayleen wants to merge 18 commits into
oxce-plusfrom
calypso/rd-runtime-defects

Conversation

@ayleen

@ayleen ayleen commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • align HD selection hit-testing with painted row geometry
  • preserve grouped research and production rows
  • fail closed instead of exposing vanilla TechTreeViewerState on Emscripten

Verification

  • Trusted Emscripten build on in1
  • Calypso regression tests pass

Parent Calypso PR: Ayleen-Labs/calypso#128

Address external review findings R01-R08 for the eleven R&D forms.

R01: restore the native selectedTopic binding in ResearchState's
tech-tree #else branch so the native target compiles again.

R02: one logical-space row-hit contract. calypsoSelectionListRowAtLogicalY
replaces the display-space helper: a row origin excludes the column
header, a half-open data viewport excludes the trailing panel remainder,
and out-of-range pointers own no row instead of clamping to the last
one. TextList stores the emitted row origin/viewport/capacity; hover,
press and click gate on the same hit; the native scrollbar track equals
the painted data viewport; every adapter passes one descriptor
(stride, origin, viewport height, emitted slot capacity) instead of
hardcoded wide/compact guesses. The staffing wheel zone now follows the
projected scientists column.

R03: every Tech Tree entry point (all seven states, including
ManufactureState, NewManufactureListState and GlobalResearchDiaryState
which still pushed the vanilla viewer) fails closed on Emscripten while
the vanilla push stays behind #else for native builds.

R04: the archetype generator realizes table-context (and compact
list-inspector) as the approved composition: full-body-width data area,
a context dock above the footer hosting identity and actions, and no
right inspector. Strict per-kind template validation now runs for the
operations kinds, rejecting rogue authored fields. Whole-row slot
capacity is fitted between header and dock.

R05: production controls declare four distinct semantic commands; each
one owns its own 44px+ action slot in both layout classes.

R06: the generator emits a typed resolved profile style and a single
shared binder fills the model, replacing the stale accent default.
Compact workspace typography no longer inherits the F01 chrome
downscale (12/13/18 CSS targets). Danger tone renders as outline/text.

R07: steppers emit a visible localized caption strip; production
publishes a typed resources region (free engineers, workshop space,
native hours per unit) rendered through the fields painter; orphan
model records removed.

R08: the dependency tree state publishes a parallel typed row snapshot
(kind, depth 1-4, authorized text only); the adapter copies it instead
of classifying translated text; the contract is one wide topic column.
The header uses std::vector in its grant-schedule signature but relied
on a transitive include, which breaks the Linux unit-test build with
stricter transitive-include availability.
Close the re-review P1/P2 findings for the R&D family.

Tech Tree destination (re-review P1): the seven R&D entry points push
TechTreeViewerState unconditionally on every platform — the permanent
failHdRoute stand-in is gone. The viewer itself is the registered HD
destination: family F15 (contract f15-tech-tree.json, operations-detail,
dependency-list presentation) attaches CalypsoF15TechTreeUi in its
constructor through the shared operations renderer and the shared
viewport classifier, with fail-closed reserved for real failures
(disabled family, missing contract, viewport below 740x360). The viewer
publishes parallel typed row metadata recorded at the native
addRow/setRowColor sites (blue = structural header, grey = hidden), so
the two synchronized topic lists render as two typed collection regions
and no text is re-derived; hidden topics stay "***". Select Topic, Back
history and the disabled-feature option keep native semantics.

Scrollbar parity (re-review P2): the adapter descriptor now projects the
generated track itself — calypsoSelectionListDescriptorFor derives the
row origin and a data viewport height equal to the painted track, so the
invisible input rail can no longer extend past it (the origin was being
counted twice). All R&D configure sites use the descriptor.

Responsive class (re-review P1): classifyCalypsoHdOperationsLayout is
the shared pure classifier (wide at 1280x720+, compact to 740x360,
below that an explicit HD size failure) reading the canonical logical
viewport; F09/F10/F14 configure and resize no longer read
Options::baseXResolution.

Canonical typography (re-review P2/P3): operations-ac.json carries the
wide/compact typography table; the generator validates and emits it into
the contract, the C++ headers (kTypographyWide/Compact) and the browser
payload, and a shared binder fills the model. The renderer consumes the
bound values. The contract style block now carries the resolved accent
so consumers never fall back to the legacy mint.
Replace the affine reference-canvas stretch with the shared
CalypsoHdOperationsFluidPolicy: authored geometry stays CSS px, the
surplus flows into the data area (columns proportional, row capacity
from the resolved viewport), 44px targets and typography keep their
authored size, and the two reference viewports resolve to exactly the
approved geometry. The F09 adapters/models and the F10 queue migrate to
the resolved rects end to end (native surfaces, HD paint and input share
one rect; the renderer projection is identity because the model design
size equals the actual logical viewport). Unit matrix covers the
reference endpoints, the 1000x600 expansion, capacity and group
redistribution. Remaining kinds stay on the internally consistent affine
path until their one-pass migration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant