Conversation
Summary of ChangesHello @andeplane, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the frontend's robustness by introducing a comprehensive suite of unit tests for the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive suite of unit tests for the View.tsx component, which is a great addition for ensuring its stability and correctness. The tests are well-structured and cover a wide range of functionality.
The scope of this PR also includes the removal of a backend test feature, including its associated database model, API router, and Alembic migration file. While this cleanup is likely beneficial, it's worth noting that these backend changes are not mentioned in the pull request description. In particular, deleting a migration file (2da813b175f0_initial_test_schema.py) can break the migration history if it has been applied to any persistent database. Please ensure this is not the case.
I've added a few minor suggestions in the new test file to enhance type safety by replacing some instances of any with more specific types. Overall, this is a solid contribution.
Comprehensive tests covering: - Auto-clear selection on simulation change (P0) - Escape key clears selection (P1) - Particle click handling (shift/plain/deselect) - No simulation modal behaviour (embedded vs normal) - localStorage persistence for showAnalyze - Visualizer idle toggled by visible prop - Responsive overlay initial state
16e725b to
7bdc455
Compare
Summary
Closes #276.
clearSelectionis called andselectedAtomsresets whenever thesimulationstore value changes.visualizer.clearSelection) when atoms are selected.isEmbeddedMode=true.showAnalyzeis read from localStorage on mount and written back when not in embedded mode; writes are skipped in embedded mode.embedConfig.showSimulationSummarygates whetherResponsiveSimulationSummaryrenders in embedded mode.visualizer.idleis toggled correctly by thevisibleprop.Mocking strategy
useStoreState/useStoreActionsvi.fn()+ mutable sharedmockStateobject updated inbeforeEach; selectors run against real state shapeVisualizer(omovi)vi.fn()at module level; regular-functionmockImplementationused in the Escape test sonew Visualizer()succeedsantdLayout / Modal / ButtonLayout.Headerattached as static propertydata-testidattributesvi.spyOn(Storage.prototype)in a nestedbeforeEach/afterEachTest plan
npm test -- --run View→ 17/17 passnpm test) → 250/250 pass, no regressions🤖 Generated with Claude Code