fix(hd): align operation tables and close vanilla tech tree - #59
Open
ayleen wants to merge 18 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
Parent Calypso PR: Ayleen-Labs/calypso#128