Like T3 Code, the strip below the composer shows the thread's pull request (#N, colored by its state) beside the branch; it opens the pull request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Showing 1 changed file with 23 additions and 0 deletions.
| @@ -75,6 +75,29 @@ impl ChatView { | ||
| 75 | 75 | strip = strip.child(self.render_workspace_control(cx)); |
| 76 | 76 | } |
| 77 | 77 | strip = strip.child(div().flex_1()); |
| 78 | + if let Some(pull_request) = self.session.read(cx).pull_request.clone() { | |
| 79 | + let color = match pull_request.state.as_str() { | |
| 80 | + "OPEN" => p.green_ink, | |
| 81 | + "MERGED" => p.tints[5], | |
| 82 | + "CLOSED" => p.red, | |
| 83 | + _ => p.ink3, | |
| 84 | + }; | |
| 85 | + let url = pull_request.url.clone(); | |
| 86 | + let state = match pull_request.state.as_str() { | |
| 87 | + "OPEN" => "Open", | |
| 88 | + "MERGED" => "Merged", | |
| 89 | + "CLOSED" => "Closed", | |
| 90 | + _ => "Draft", | |
| 91 | + }; | |
| 92 | + strip = strip.child( | |
| 93 | + composer::strip_control("strip-pull-request") | |
| 94 | + .icon(Icon::new(Lucide::GitPullRequest).size(px(12.)).text_color(color)) | |
| 95 | + .label(format!("#{}", pull_request.number)) | |
| 96 | + .text_color(color) | |
| 97 | + .tooltip(format!("PR #{} - {state}", pull_request.number)) | |
| 98 | + .on_click(move |_, _, _| crate::ui::workspace::open_url(&url)), | |
| 99 | + ); | |
| 100 | + } | |
| 78 | 101 | if git { |
| 79 | 102 | strip = strip.child(self.render_branch_control(branch, cx)); |
| 80 | 103 | } |