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

Store selection state in URL hash #95

Merged
merged 47 commits into from
Jun 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2e32a52
Split selection effect into two
andy-sweet May 31, 2024
0b645ea
Even simpler
andy-sweet May 31, 2024
55920fe
Simplify loading state
andy-sweet May 31, 2024
0d8c661
Fix formatting
andy-sweet May 31, 2024
61490f7
Mostly working with reducer
andy-sweet May 31, 2024
794265d
Remove setter
andy-sweet May 31, 2024
fc4cfed
Clean up
andy-sweet May 31, 2024
b588b11
Format
andy-sweet May 31, 2024
cb0de4c
Clean up effect
andy-sweet May 31, 2024
e304a10
More simplification
andy-sweet May 31, 2024
c9f9fc5
Simplify log
andy-sweet May 31, 2024
d0505a8
Restore track ID state
andy-sweet May 31, 2024
1c0d700
Add other state to URL
andy-sweet May 31, 2024
2ac5cd2
Format
andy-sweet May 31, 2024
bccd835
Add track IDs instead of clobbering
andy-sweet May 31, 2024
6ff4dbe
Fix lint
andy-sweet May 31, 2024
9b66310
Add maxPointsPerTimepoint to state
andy-sweet Jun 4, 2024
3c0ea91
Format
andy-sweet Jun 4, 2024
89253b8
Clean up
andy-sweet Jun 4, 2024
bf05cdc
Skip fetches for root tracks
andy-sweet Jun 4, 2024
266f712
More docs
andy-sweet Jun 4, 2024
7cad9b6
Remove optionals
andy-sweet Jun 4, 2024
08f7ceb
Rename fetched root track ids
andy-sweet Jun 4, 2024
d134a79
Refactor updates with viewer state
andy-sweet Jun 4, 2024
941091b
Move code to toState
andy-sweet Jun 4, 2024
cb45290
Format
andy-sweet Jun 4, 2024
761341b
Reset tracks IDs when clearing
andy-sweet Jun 4, 2024
787b01f
Rename
andy-sweet Jun 4, 2024
a77254c
Mostly working with point IDs
andy-sweet Jun 5, 2024
1278b62
Skip fetching for previously fetched points
andy-sweet Jun 5, 2024
0cff741
Format
andy-sweet Jun 5, 2024
537b84e
Simplify camera state
andy-sweet Jun 5, 2024
662b84d
Fix early return
andy-sweet Jun 5, 2024
52738dc
Fix spherical cursor
andy-sweet Jun 5, 2024
827ec93
Remove callback
andy-sweet Jun 5, 2024
051429c
Add TODO back
andy-sweet Jun 5, 2024
ba2202d
Remove unused import
andy-sweet Jun 5, 2024
d0fa89a
Change brightness when adding a selection
andy-sweet Jun 5, 2024
c902dcd
Remove unused props
andy-sweet Jun 5, 2024
7eaba4f
Format again
andy-sweet Jun 5, 2024
fef5b4e
Remove setSelectedPoints
andy-sweet Jun 6, 2024
8b81cd7
Remove highlight points action
andy-sweet Jun 6, 2024
52e4277
Format
andy-sweet Jun 6, 2024
68109c8
Add TODO
andy-sweet Jun 6, 2024
00d5f01
Remove adding
andy-sweet Jun 6, 2024
a7017f7
Use num tracks loading as state
andy-sweet Jun 6, 2024
caa6f4a
Format
andy-sweet Jun 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove adding
andy-sweet committed Jun 6, 2024
commit 00d5f010c9db5919c3b4a9f78ffb8286cd24e13c
6 changes: 1 addition & 5 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -148,9 +148,6 @@

setIsLoadingTracks(true);

// keep track of which tracks we are adding to avoid duplicate fetching
const adding = new Set<number>();

// this fetches the entire lineage for each track
const updateTracks = async () => {
console.debug("updateTracks: ", canvas.selectedPointIds);
@@ -164,8 +161,7 @@
canvas.fetchedRootTrackIds.add(trackId);
const lineage = await trackManager.fetchLineageForTrack(trackId);
for (const relatedTrackId of lineage) {
if (adding.has(relatedTrackId) || canvas.tracks.has(relatedTrackId)) continue;
adding.add(relatedTrackId);
if (canvas.tracks.has(relatedTrackId)) continue;
const [pos, ids] = await trackManager.fetchPointsForTrack(relatedTrackId);
// adding the track *in* the dispatcher creates issues with duplicate fetching
// but we refresh so the selected/loaded count is updated
@@ -178,7 +174,7 @@
};
updateTracks();
// TODO: add missing dependencies
}, [trackManager, dispatchCanvas, canvas.selectedPointIds]);

Check warning on line 177 in src/components/App.tsx

GitHub Actions / lint-and-test

React Hook useEffect has a missing dependency: 'canvas'. Either include it or remove the dependency array

// playback time points
// TODO: this is basic and may drop frames