Skip to content

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