Repository navigation
feat(gpui): rename timeline lanes - #2847
YoavLevavi wants to merge 4 commits into
Conversation
Names are stored per lane in ProjectConfiguration::track_names, keyed "<track>:<lane>"; an empty name restores the track's own label. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@YoavLevavi is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks @YoavLevavi, lane names are handy, and the dialog follows the preset dialog's patterns nicely (Enter/Escape, one undo step, an empty name restores the default). One functional issue: names are keyed |
- reorder_track_names moves a track's lane names with the same shift as reorder_track_lane, in the same edit, so a renamed lane keeps its name after being dragged (overlay reorders only change overlay_order, so their names already stay put). Test included. - track_names is skipped when empty, so projects without names save unchanged; bindings regenerated. track_name_key sits above track_chip's doc comment again. - Merges origin/main; audio_project_key lists track_names as not affecting playback audio. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks @richiemcilroy, all three are in 3753c65 (also merged main):
@greptileai review |
| .child(track_chip( | ||
| theme, | ||
| row.kind, | ||
| model.track_names.get(&track_name_key(row)).cloned(), | ||
| )), |
There was a problem hiding this comment.
Deletion gives lanes wrong names
Lane deletion shifts segment indexes but leaves the new track_names keys unchanged. Name audio:0 “Voice” and audio:1 “Music”, then delete lane 0: the music segments move to lane 0 and display “Voice”. Remove the deleted lane’s name and shift higher name keys down in the same edit, including when deleting an empty lane.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/editor_timeline.rs
Line: 2217-2221
Comment:
**Deletion gives lanes wrong names**
Lane deletion shifts segment indexes but leaves the new `track_names` keys unchanged. Name `audio:0` “Voice” and `audio:1` “Music”, then delete lane 0: the music segments move to lane 0 and display “Voice”. Remove the deleted lane’s name and shift higher name keys down in the same edit, including when deleting an empty lane.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| self.edit_project("track-rename", window, cx, move |project| { | ||
| if default { | ||
| project.track_names.remove(&key).is_some() | ||
| } else if project.track_names.get(&key) == Some(&name) { | ||
| false | ||
| } else { | ||
| project.track_names.insert(key, name); |
There was a problem hiding this comment.
Open style groups discard renames
Open a style group for the selected style segment, then double-click that same lane’s label. Selecting the same segment leaves sidebar.style_target set, so edit_project sends the rename through apply_style_control_change. That function changes a cloned project and copies back only style settings, discarding track_names. The dialog closes without saving the name. Use a project-wide edit path that does not route through the selected style group.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/editor_window.rs
Line: 7393-7399
Comment:
**Open style groups discard renames**
Open a style group for the selected style segment, then double-click that same lane’s label. Selecting the same segment leaves `sidebar.style_target` set, so `edit_project` sends the rename through `apply_style_control_change`. That function changes a cloned project and copies back only style settings, discarding `track_names`. The dialog closes without saving the name. Use a project-wide edit path that does not route through the selected style group.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| /// exactly as the Solid dialogs replace the dropdown. | ||
| presets_menu: Option<PresetsMenu>, | ||
| preset_dialog: Option<PresetDialog>, | ||
| /// The lane being renamed (double-click on its label), and the input. |
There was a problem hiding this comment.
The new comment above track_rename only restates the fields and gesture. AGENTS.md requires comments to explain non-obvious context and explicitly bans comments that narrate the code. Remove this comment and the similarly descriptive comment above open_track_rename. This repository requirement must be satisfied before merging.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/editor_window.rs
Line: 1590
Comment:
**Comments repeat the code**
The new comment above `track_rename` only restates the fields and gesture. `AGENTS.md` requires comments to explain non-obvious context and explicitly bans comments that narrate the code. Remove this comment and the similarly descriptive comment above `open_track_rename`. This repository requirement must be satisfied before merging.
**Context Used:** AGENTS.md ([source](https://github.com/capsoftware/cap/blob/main/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Fixed in b349374: @greptileai review |
Rename timeline lanes: double-click a lane's label in the gutter to give it a name ("Music", "Voice-over"...).
ProjectConfiguration::track_names, keyed"<track>:<lane>"(for exampleaudio:1),#[serde(default)].track_chipshows the name, andTimelineModelcarries the names so drawing doesn't touch the project.Testing:
cargo test --bin cap-gpui(newlane_names_come_from_the_project_by_track_and_lane).🤖 Generated with Claude Code
The style-group rename fix is sound, but the earlier lane-deletion bug and comments-rule violation still need fixes before merging.
Findings
Fix with agent prompt
Summary
Adds custom timeline lane names and a rename dialog.
Reviews (2) · Last reviewed commit: "Save lane renames past an open style gro..." · Reviewed by Greptile