Repository navigation
Fix editor interactions (ball, lines, snap, right-click) + regression tests - #2
Merged
Merged
Conversation
…right-click - context-menu: ball button indexed the entities array with a string key (always undefined) so it did nothing. Possession is now modeled by the ball entity's position via EditorState.assignBall (schema-conformant, honors frame deltas, visible on the court). - interaction: lines could be drawn but never re-selected — selectLine() was never called. Added segment-based line hit-testing on click plus a selected-line highlight overlay so the line properties panel and delete are reachable. - interaction: snap indicator was wiped by the per-move innerHTML re-render; re-append it whenever it is detached from the DOM. - interaction: right-click now selects the entity (opening the action menu) instead of deleting it immediately without confirmation. - editor: cap offense/defense numbering at 9 (schema limit) and guard the palette/drop callers against the now-possible null.
Covers the four repaired behaviors plus the numbering cap: #1 ball-possession button assigns the ball entity onto the selected player (base position and frame deltas) #2 drawn lines are selectable by click and deletable #3 snap indicator survives the per-move re-render (driven via synthetic mouse events for determinism) #4 right-click selects an entity instead of deleting it + offense/defense numbering stays capped at 9 Each test was verified to fail against the pre-fix code and pass after. Expose editorState / player / getCurrentTransform on the OCFEditor global so tests can drive and inspect real app state through the bundle.
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.
Was
Behebt vier Editor-Bugs, die das gewünschte Verhalten verhinderten, und sichert sie mit Regressionstests ab.
Fixes
entities-Array mit einem String-Key. Ballbesitz wird jetzt schema-konform über die Ball-Entity modelliert (EditorState.assignBall), inkl. Frame-Deltas und sichtbarer Darstellung.selectLine()wurde nie aufgerufen. Neu: Segment-basierter Hittest beim Klick + Highlight, wodurch Eigenschaftspanel und Löschen erreichbar sind.Zusätzlich:
nextEntityNrfür offense/defense auf 9 begrenzt (Schema-Limit), Aufrufer abgesichert.Tests
Neue
tests/regressions.spec.jsmit 7 Tests (einer pro Bugfix + Numbering-Cap). Jeder Test wurde gegen den Vor-Fix-Code als rot und nach den Fixes als grün verifiziert. Gesamte Suite: 27/27 grün.