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

[WIP] Select cells tip #66

Closed
wants to merge 2 commits into from
Closed

[WIP] Select cells tip #66

wants to merge 2 commits into from

Conversation

ehoops-cz
Copy link
Collaborator

@ehoops-cz ehoops-cz commented Apr 19, 2024

Resolves #65

Add a callout to tell the user how to select cells. This PR shows the callout whenever no cells are selected.

Some open questions are in code comments.
Apr-19-2024 13-56-29

Copy link

vercel bot commented Apr 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
points-web-viewer ✅ Ready (Inspect) Visit Preview Apr 19, 2024 8:45pm

@ehoops-cz ehoops-cz changed the title Select cells tip [WIP] Select cells tip Apr 19, 2024
// This currently removes the tracks visually, but the cells are still selected. Is this intentional?
clearTracks={() => {
setSelectedPoints(undefined);
return canvas?.removeAllTracks();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was being returned previously, I don't think it needs to be, but I left it while debugging.

The bigger issue is that without this addition, clicking "Clear tracks" does not reset the selectedPoints, so the state of the left panel does not reset. With this change, the state resets, but some of the tracks continue to get drawn and then there is no 'Clear Tracks' button to clear them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@aganders3 aganders3 Apr 19, 2024

Choose a reason for hiding this comment

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

I agree this doesn't need to actually return anything - I think just the compact form was making it return something automatically. In any case I think the result of the function it's returning removeAllTracks is also undefined so I'm not sure it makes a difference.

On the bigger issue - this is something we have yet to clear up with selection, and basically hits on one of the larger outstanding decisions we need to make. See also #61.

selectedPoints is at least partly just bad naming. It's is a transient value that is set by the selection helper, used to trigger an effect that fetches the corresponding tracks (and their ancestors/descendants) and adds them to the canvas. It's re-set whenever a user makes a new selection, even though the previously loaded tracks remain. It's extra confusing because points correspond to cells within a timeframe, but a track could also be considered a single cell (multiple points) as it moves through time.

edit: selectedPoints should maybe even be re-set to empty (and I think at some point was) after sending requests for all the corresponding tracks.

All this to say: if you look at #64 we're using currently loaded number of tracks to indicate whether a selection has been made.

One final thought - my impression from @clarsen-czi's designs was that this info pane would only show on first launch, and disappear forever once any selection had been made. If this is the case I think all of the above is actually irrelevant to the current PR. I will defer to design on how they'd like that to actually work (I don't think Connor reads these github notifications so we can just ask in Slack).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed with the summary from Ashley that selection is a mess, so anything that touches it is likely to get burned. Given the input from design, I think this change is fine for now. Though we probably want to avoid future tweaks to anything selection related until we get a proper handle on it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for all of this context!

Would checking the currently loaded number of tracks mean something like canvas.tracks.size > 0?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes!

Copy link
Collaborator

@andy-sweet andy-sweet left a comment

Choose a reason for hiding this comment

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

The callout is useful, and I like code reorganization here too. I'll defer to @aganders3 to work out how best to integrate this with #64.

@aganders3
Copy link
Collaborator

Ah yeah I screwed this up by eagerly merging #64 (and then the actual PR #69 🤦).

@ehoops-cz I'm happy to do the work to fix the merge conflicts if you'd like.

@ehoops-cz ehoops-cz mentioned this pull request Apr 26, 2024
@ehoops-cz ehoops-cz closed this Apr 26, 2024
@TeunHuijben TeunHuijben deleted the select-cells-tip branch November 4, 2024 01:03
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.

Show tip for how to select cells
3 participants