Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .braid/issues/brd-pdno.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ schema_version: 4
id: brd-pdno
title: visually distinguish meta and design issues in TUI
priority: P2
status: doing
status: done
deps: []
tags:
- tui
owner: agent-three
owner: null
created_at: 2025-12-28T08:44:05.329879Z
updated_at: 2025-12-28T18:11:33.492273Z
updated_at: 2025-12-28T23:20:14.053918Z
acceptance:
- style meta issues like brd ls does
- style design issues like brd ls does
Expand Down
4 changes: 2 additions & 2 deletions docs/agent-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ for teams that want CI gates and human review before merging, braid supports a P
### new commands

```bash
brd agent branch <issue-id> # create feature branch <agent>/<issue-id> from main
brd agent branch <issue-id> # create feature branch pr/<agent>/<issue-id> from main
brd agent pr # create PR from current branch to main
```

### simple PR workflow (no sync branch)

```bash
brd agent branch brd-xyz # create branch agent-one/brd-xyz from main
brd agent branch brd-xyz # create branch pr/agent-one/brd-xyz from main
brd start brd-xyz # claim issue (committed in branch)
# ... do work, commit as usual ...
brd done brd-xyz # mark done (committed in branch)
Expand Down
17 changes: 12 additions & 5 deletions src/commands/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ pub fn cmd_agent_branch(cli: &Cli, paths: &RepoPaths, issue_id: &str) -> Result<
let mut issues = load_all_issues(paths, &config)?;
let full_id = resolve_issue_id(issue_id, &issues)?;

// Create branch name: feature/<issue-id>
let branch_name = format!("feature/{}", full_id);
// create branch name: pr/<agent>/<issue-id>
let branch_name = format!("pr/{}/{}", agent_id, full_id);

// Check if branch already exists
if git(
Expand Down Expand Up @@ -317,9 +317,16 @@ fn get_current_branch(cwd: &std::path::Path) -> Result<String> {
}
}

/// extract issue ID from branch name (format: <agent>/<issue-id>).
/// extract issue ID from branch name.
/// supports both formats:
/// - "pr/<agent>/<issue-id>" (new format)
/// - "<agent>/<issue-id>" (legacy format for backwards compatibility)
fn extract_issue_id_from_branch(branch: &str) -> Option<&str> {
branch.split('/').nth(1)
if branch.starts_with("pr/") {
branch.split('/').nth(2)
} else {
branch.split('/').nth(1)
}
}

/// create a PR from the current branch using gh cli.
Expand All @@ -332,7 +339,7 @@ pub fn cmd_agent_pr(cli: &Cli, paths: &RepoPaths) -> Result<()> {
// extract issue ID from branch name
let issue_id = extract_issue_id_from_branch(&branch).ok_or_else(|| {
BrdError::Other(format!(
"branch '{}' doesn't match expected format '<agent>/<issue-id>'",
"branch '{}' doesn't match expected format 'pr/<agent>/<issue-id>'",
branch
))
})?;
Expand Down
24 changes: 22 additions & 2 deletions src/tui/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,24 @@ fn draw_ready_list(f: &mut Frame, area: Rect, app: &mut App) {
issue.priority(),
truncate(issue.title(), title_width)
);
let style = if is_active && i == app.ready_selected {
let mut style = if is_active && i == app.ready_selected {
Style::default()
.bg(Color::Yellow)
.fg(Color::Black)
.add_modifier(Modifier::BOLD)
} else {
Style::default()
};
// add type-based styling (italic for design, bold for meta)
match issue.issue_type() {
Some(crate::issue::IssueType::Design) => {
style = style.add_modifier(Modifier::ITALIC);
}
Some(crate::issue::IssueType::Meta) => {
style = style.add_modifier(Modifier::BOLD);
}
None => {}
}
ListItem::new(text).style(style)
})
.collect();
Expand Down Expand Up @@ -310,7 +320,7 @@ fn draw_all_list(f: &mut Frame, area: Rect, app: &mut App) {
issue.priority(),
truncate(issue.title(), title_width)
);
let style = if is_active && i == app.all_selected {
let mut style = if is_active && i == app.all_selected {
Style::default()
.bg(Color::Yellow)
.fg(Color::Black)
Expand All @@ -324,6 +334,16 @@ fn draw_all_list(f: &mut Frame, area: Rect, app: &mut App) {
crate::issue::Status::Todo => Style::default(),
}
};
// add type-based styling (italic for design, bold for meta)
match issue.issue_type() {
Some(crate::issue::IssueType::Design) => {
style = style.add_modifier(Modifier::ITALIC);
}
Some(crate::issue::IssueType::Meta) => {
style = style.add_modifier(Modifier::BOLD);
}
None => {}
}
ListItem::new(text).style(style)
})
.collect();
Expand Down