Skip to content

fix(studio): restore grid renderer data and redraw contracts - #79

Draft
zedarvates wants to merge 2 commits into
fix/studio-editor-bindingsfrom
fix/studio-grid-renderer-contracts
Draft

zedarvates wants to merge 2 commits into
fix/studio-editor-bindingsfrom
fix/studio-grid-renderer-contracts

Conversation

@zedarvates

@zedarvates zedarvates commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

GridRenderer and PanelRenderer lost their concrete data types and disagreed on basic panel output. Restore the existing Layer/Panel/crop/annotation contracts, remove the LegacyAny URL assertions, and fix the reproduced redraw and composition defects.

Partial follow-up to #74, draft stacked on #78 at af83b71145191bb964f2109261adbe15234cdd87. Current head: e51f631d4215c8f2e1c925d3e57a38fb4999596a. Dependency versions/locks and full application compiler flags/source inclusions are unchanged.

Resulting behavior:

  • Grid image draws now use the same normalized crop and cropped aspect ratio as individual panels.
  • Visible locked layers stay visible; lock still prevents editing through the existing layer controls.
  • Drawing opacity composes with layer opacity and preserves zero.
  • Incomplete rectangle/ellipse point lists no longer stop the annotation layer; individual panels now draw the existing line annotation type.
  • Obsolete image-load completions do not repaint old props or notify an old panel. Resize uses current grid props. Requests themselves are not aborted and the existing image-error policy is unchanged.
  • Native failures in asynchronous image-completion draws are reported through console.error; a failed draw does not notify panel load. Helper dependencies are explicit. Remove the redundant imagesLoaded state/second effect: the individual canvas draws current annotations/borders/cached images immediately and active completions redraw it directly.

Local evidence — Node 24.19.0 / npm 11.9.0, same Studio-only setup as the exact base:

  • The new strict grid program reproduces 111 diagnostics before repair (63 grid / 48 individual panel), then passes using skipLibCheck: false and negative numeric-geometry cases.
  • The 13 old renderer tests pass before repair, while 11 of 14 new tests fail. After repair, 53 tests in seven files pass, alongside all four strict contract programs, the library-name audit (5,712 bindings in 966 files), targeted ESLint and production bundle.
  • Full unchanged tsc -b still fails with 1,095 diagnostics, down from 1,206 at the exact fix(studio): restore editor control bindings for React 19 #78 base in the same setup. All 111 renderer diagnostics disappear; no new diagnostic fingerprints appear after normalizing line numbers. Hosted counts must be read separately.

Sonar follow-up: the first head 91e9854f5833eb0654e8d2009ce0d632cc930afc failed its SonarCloud gate, Reliability C on New Code (A required). Its ten GitHub annotations identify seven unnecessary void discard expressions in the compile-only fixture, two unhandled render promise chains and a complexity finding. The follow-up exports the same positive/negative type fixtures without discard expressions, handles asynchronous draw failures with two additional regression tests, and isolates unchanged crop arithmetic in a small typed helper. No scanner suppression/exclusion, threshold change or disabled rule is added.

Hosted evidence — 2026-10-04, exact current head e51f631d4215c8f2e1c925d3e57a38fb4999596a:

  • Node 22.12.0 and Node 24.19.0 succeed: Studio-only clean installation with lifecycle scripts disabled and legacy peer resolution, the shared-library audit (5,712 bindings / 966 files), all four strict contract programs, targeted ESLint, 53 tests in seven files and production bundles.
  • Node 24 additionally passes one bounded offline Chromium launcher startup check with live providers/backends blocked. Node 22 browser steps are skipped by matrix design.
  • Full application types fails, exit 1, with 1,163 diagnostics. Its artifact is retained; the overall renderer workflow therefore concludes failure.
  • SonarCloud Code Analysis succeeds on this head: Quality Gate passed, zero new issues and zero new security hotspots reported, with no check annotations. It reports 0.0% coverage on new code; the passing tests are separate evidence and do not supply measured Sonar coverage. This is recovery from the earlier 91e9854 failed gate, not proof that all repository security alerts or runtime gaps are resolved.
  • All four exposed check runs are completed; there is no current queued/running check in that snapshot. No separate commit-status contexts are exposed. No formal PR review has been submitted.

Review/blockers: review crop parity, lock/visibility semantics, opacity composition, incomplete-shape handling and stale-load/resize cleanup. Unit tests keep actual hooks, prop updates and pointer handlers, but control native canvas/image boundaries; their drawing-command checks are not browser pixel or photo-decoding proof. Effect rendering remains incomplete (grid label / individual panel no-op), and pivot/clipping semantics, full strict compilation, primary Electron, persisted media/project round trips and live generation remain unfinished. The #70/#63/#73 dependency combination has not been retested with this batch. Keep #74 open and this PR in draft; no merge or commercial availability is claimed.

Scope and commands.

@sonarqubecloud

sonarqubecloud Bot commented Oct 4, 2026

Copy link
Copy Markdown

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