Share rendering and pan/zoom helpers between widgets - #235
Open
henryhng wants to merge 3 commits into
Open
Conversation
|
This PR is 1 commit behind Fetch that remote and update local |
|
Collaborator
|
@henryhng henry thanks for this PR but a bit too early for abstraction. UI stuff, better to duplicate, UI is harder to test and easier to break. Please keep building, 1000 or 2000 lines of UI code, etc it doesn't really matter in the age of agentic coding. |
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.
What problem does this solve?
ChooseLatticepreviously implemented its array-to-PNG rendering, keyword-arg typo validation & canvas pan/zoom transform internally. A second widget (ShowBragg) now requires the same functionality, so it might be helpful to move these components into shared modules.What should reviewers verify?
ChooseLatticebehavior remains unchanged.js/imageView.ts.Verification
PYTHONPATH=src pytest -q tests/test_choose_lattice.py— 9 passed.npx vitest run js/imageView.test.ts— 2 passed.npm run build— works.npx tsc --noEmit— works.