Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

won't show time controls if there is no time range #343

Merged
merged 1 commit into from
May 18, 2022
Merged

Conversation

meganrm
Copy link
Contributor

@meganrm meganrm commented May 13, 2022

Problem

The cellPack files don't need playback controls when they're a single frame

Solution

Only show playback controls if the first time and last time are different

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Steps to Verify:

  1. npm start
  2. http://localhost:9001/viewer?trajUrl=https://www.dropbox.com/s/hhqrwp9bc8huufa/BloodPlasma.simularium?dl=0
  3. Should not show a time bar
  4. go to an example trajectory
  5. time bar should be back

Screenshots (optional):

showing a cellpack file with no time bar
Screen Shot 2022-05-12 at 5 17 16 PM

@meganrm meganrm requested a review from a team as a code owner May 13, 2022 00:36
@meganrm meganrm requested review from toloudis and blairlyons and removed request for a team May 13, 2022 00:36
@github-actions
Copy link

jest coverage report 🧪

Total coverage

Status Category Percentage Covered / Total
🟡 Statements 74.06% 517/698
🟡 Branches 69.07% 105/152
🔴 Functions 42.85% 75/175
🟡 Lines 73.99% 498/673

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

loading={isBuffering}
isEmpty={status === VIEWER_EMPTY}
/>
{firstFrameTime !== lastFrameTime && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder if there is a better check, like count of number of frames === 1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, this component doesn't know the total number, and I didn't investigate when/if that gets sent in. I don't see any way this would be wrong when the count would be right though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's the opposite case i'd be worried about: when num frames > 1 but each frame has the same frame time (or within floating point equality)

@meganrm meganrm merged commit 3997ebf into main May 18, 2022
@meganrm meganrm deleted the feature/no-time branch May 18, 2022 19:19
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.

3 participants