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

Create "Copy view" item in view menu #4793

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Create "Copy view" item in view menu #4793

wants to merge 1 commit into from

Conversation

cmdcolin
Copy link
Collaborator

@cmdcolin cmdcolin commented Jan 25, 2025

Adds a new button to copy a view into a new view panel based on the state of an existing view. Similar to copying track

There is a thing where internal state id's could collide between these two views which is tricky, but my initial testing found that it kinda worked

@cmdcolin cmdcolin force-pushed the copy_view branch 2 times, most recently from e7837c7 to 3bff8d1 Compare January 25, 2025 18:08
@cmdcolin
Copy link
Collaborator Author

looks like there are some weird things like clicking a feature ends up causing trouble because the feature widget uses a reference to view, and then it produces an error that it can't resolve ID unambiguously

screenshot after clicking feature in breakpoint split view:
image

@cmdcolin
Copy link
Collaborator Author

to fix, we probably need a principled way to strip or reassign new id's to the copied view. there are some sprinkled examples that are a little hacky that strip the IDs from snapshot objects, which are automatically regenerated on model import

e.g.

export function stripIds(arr: Track[]) {
return arr.map(({ id, displays, ...rest }) => ({
...rest,
displays: displays.map(({ id, ...rest }) => rest),
}))
}

@cmdcolin cmdcolin marked this pull request as draft January 25, 2025 21:11
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.

1 participant