simularium / simularium-website

Front end website for the Simularium project, includes the Simularium viewer
https://simularium.allencell.org
Apache License 2.0
7 stars 3 forks source link

Feature/selector org #606

Closed interim17 closed 1 week ago

interim17 commented 3 weeks ago

Time estimate or Size

small/medium Changes related to directory organization, connected to #607, will not merge to main until both PRs are approved

Problem

Advances #511

Solution

@frasercl raised some interesting concerns about state branches in a previous PR

We have redux selectors in /state that are:

Now adding compoundSelectors to /state to account for selectors that consume state from multiple branches and are used multiple containers.

This resolution keeps the actual data for defaultUIDisplayData in the trajectory branch and selectedUIDisplayData and ColorSettings in the selection branch, and avoids circular dependencies when the branches try to import each other's selectors.

This work is essentially part of #607, but so many lines of moving/organizing code was obscuring the readability of that PR. I will not merge either PR until both are approved. It is a non-breaking change, the app should run as before.

getCurrentUIData

The selector which pulls from multiple branches to determine the current color settings for the app, and to pass to the viewer.

getUiDisplayDataTree

Previously in trajectory moved to ModelPanel as it depends on a compound selector, and is only used in once place, could also be in compoundSelectors folder...

github-actions[bot] commented 3 weeks ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements
67.33% (+0.41% πŸ”Ό)
709/1053
🟑 Branches
67.52% (+0.42% πŸ”Ό)
106/157
πŸ”΄ Functions
35.98% (+0.49% πŸ”Ό)
95/264
🟑 Lines
65.73% (+0.43% πŸ”Ό)
631/960
Show new covered files 🐣
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :----------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------- | :--------- | :------- | :-------- | :---- | | 🟒 |
`...` / types.ts
| 100% | 100% | 100% | 100% | | 🟒 |
`...` / index.ts
| 100% | 100% | 100% | 100% |

Test suite run success

132 tests passing in 8 suites.

Report generated by πŸ§ͺjest coverage report action from 622b3b37464649225cfb7afe3e1685a5e044234a