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
662 changes: 492 additions & 170 deletions design/hide-screens.pen

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions design/hide-ui.lib.pen
Original file line number Diff line number Diff line change
Expand Up @@ -36822,8 +36822,8 @@
{
"type": "text",
"id": "agb-pr-n",
"name": "#221",
"content": "#221",
"name": "221",
"content": "221",
"fill": "$--subtle-foreground",
"fontFamily": "$--font-mono",
"fontSize": "$--text-caption",
Expand Down Expand Up @@ -38125,7 +38125,7 @@
"fill": "$--pr-failed"
},
"agb-pr-n": {
"content": "#221"
"content": "221"
},
"agb-pr-rv": {
"enabled": true
Expand Down Expand Up @@ -38550,7 +38550,7 @@
"fill": "$--pr-merged"
},
"agb-pr-n": {
"content": "#216"
"content": "216"
},
"agb-pr-rv": {
"enabled": false
Expand Down Expand Up @@ -39380,7 +39380,7 @@
"fill": "$--pr-failed"
},
"agb-pr-n": {
"content": "#221"
"content": "221"
},
"agb-pr-rv": {
"enabled": true
Expand Down Expand Up @@ -39805,7 +39805,7 @@
"fill": "$--pr-merged"
},
"agb-pr-n": {
"content": "#216"
"content": "216"
},
"agb-pr-rv": {
"enabled": false
Expand Down Expand Up @@ -40469,8 +40469,8 @@
{
"type": "text",
"id": "ath-pr-n",
"name": "#924",
"content": "#924",
"name": "924",
"content": "924",
"fill": "$--subtle-foreground",
"fontFamily": "$--font-mono",
"fontSize": "$--text-caption",
Expand Down
11 changes: 6 additions & 5 deletions docs/UI_BEHAVIOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,23 +545,24 @@ The core supplies Needs You, Working, Done, Idle and Resolved in that order, lea
Needs You and Done are the same agents as the sidebar's in the same scope; Working holds working agents and quiet roots whose descendants work; Idle holds stopped agents already seen.
Delegated children and Factory workers are not Sessions rows of their own.
Resolved holds work resolved in the last 24 hours, by the operator or automatically once the agent stopped with no demand and every PR it held merged or closed.
Within a group, Needs You waits longest first, Working puts a failed PR first and then the most recent, Done is most recent first, and Idle puts unfinished work, then a failed, mergeable, pending, draft or merged PR, before the rest; Idle rows with neither a PR nor unfinished work wait behind `그 외 N`.
Within a group, Needs You waits longest first, Working puts a failed PR first and then the most recent, Done is most recent first, and Idle puts unfinished work, then a failed, mergeable, pending, draft or merged PR, before the rest; every Idle row is drawn, as in Needs You, Working and Done.

A row's first line is its mark, provider, title, own PR mark, descendant mark while its tree is closed, and elapsed time; a Needs You row has no PR mark and no descendant mark.
Every row, a child and a resolved row included, ends in the Resolve button's slot, so the times of the panel stand in one column as in the sidebar.
There is no checkout name, front-checkout bar or status word on a root row.
Its second line is the ask on Needs You, the label line on Working (or the line of the most recently changed working descendant while it waits on them), the finished turn's line on Done, and on Idle only the remaining work of an unfinished turn after `◐`; with no label line there is no second line.
The PR mark shows one PR as its state's icon and number, and several as the worst PR's (`#924 +1`); a closed PR is not counted, and each row, a child included, dims while the GitHub read behind its own PRs is stale, with that read's last time in the tooltip.
The PR mark shows one PR as its state's icon and number, and several as the worst PR's (`924 +1`); a closed PR is not counted, and each row, a child included, dims while the GitHub read behind its own PRs is stale, with that read's last time in the tooltip.
Pressing the mark lists each PR with its mark and title, worst first, and choosing one opens the existing PR panel.
The core verb ladder, read rules and PR summary are owned by [status-model.md](status-model.md#the-sessions-tool).
Reading an AI question removes its Answer and Needs You attention; an active menu or plan approval stays until answered.
A row with children, at any depth, opens them under its chevron, closed at first and remembered apart from the sidebar's folds; a row whose tree is closed wears its descendant mark, and Sessions has no popover.
Five siblings show per parent and the rest wait behind `N개 더`, as in the sidebar (`web/src/sidebarTree.ts`).
A child steps one indent right of its parent down to the third level below the root; deeper rows stay in the third level's column and hang from their parent's chevron lane, whose rail runs down through them, so a narrow Tools column keeps room for titles (`web/src/sessionTree.ts`).
A child row has the root's first line without the Resolve button, and the same second line.
When the child works in another checkout than its parent, that line starts with the checkout's branch (the core's `branch_badge`, the name the sidebar gives the checkout) in dim mono, without the part up to the first `/` (`fix/`, `feat/`), cut with `…` past two fifths of the line, with the whole branch and the checkout's path in its tooltip; the label takes the rest of the line and is cut with `…`.
When the child works in another checkout than its parent, that line starts with the checkout's branch (the core's `branch_badge`, the name the sidebar gives the checkout) in dim mono, without the part up to the first `/` (`fix/`, `feat/`), cut with `…` past two fifths of the line when a label follows and at the line's end when it stands alone, with the whole branch and the checkout's path in its tooltip; the label takes the rest of the line and is cut with `…`.
A child in its parent's checkout carries no branch, an Idle child with no label line and a branch has a second line with the branch alone, and a root row carries none.
A child's title is quiet (subtle) unless it asks or is selected, by the sidebar's title rule; a root's title is not.
While a Workspace is in front, the row standing for its focused pane is selected as in the sidebar: the focused pane's row, or, when a closed tree or `N개 더` hides it, the nearest ancestor row the panel draws, with the sidebar's selected fill and `aria-current`; nothing opens by itself, and a root hidden behind `그 외 N` or the folded Resolved has no selected row.
While a Workspace is in front, the row standing for its focused pane is selected as in the sidebar: the focused pane's row, or, when a closed tree or `N개 더` hides it, the nearest ancestor row the panel draws, with the sidebar's selected fill and `aria-current`; nothing opens by itself, and a root hidden in the folded Resolved has no selected row.
An agent is drawn once in Sessions: a raised child's ask rides its root's row, and the child's own row, where its root's tree is open, is the one selected.
The selected fill stays under the pointer, and keyboard focus draws its ring over it.

Expand Down Expand Up @@ -1054,7 +1055,7 @@ Any project row can be pinned from its right-click menu: a row Herdr shows witho
The pin lives on the project's registration and survives a relaunch; removing the registration takes the pin with it.
A pinned project is exempt from its device's inactive fold whatever its activity; its own stale worktrees still fold behind their own `Inactive N` row.
PR state colour is a semantic-colour exception to otherwise neutral chrome, one colour per state on every surface, including during hover and selection (docs/status-model.md, Pull request visual states; operator approval, 2026-10-10): failed red, pending amber, mergeable green, draft grey, merged purple with the merge icon, and closed dim.
Every surface draws a pull request as the one PR mark (`web/src/components/pr-mark.tsx`): the state's icon in its colour and `#N` in the text colour, `+N` after it for an agent row's other PRs, with no border and no glyph; a pressable mark fills under the pointer, a mark whose GitHub read is stale dims with the last read time in its tooltip, and where the row already names the pull request (a checkout's glyph, a graph head, a search row) the mark drops the number.
Every surface draws a pull request as the one PR mark (`web/src/components/pr-mark.tsx`): the state's icon in its colour and the bare number `N` in the text colour (the icon already says pull request; `#N` stays where a number stands without the icon, such as a PR card's header or a tooltip), `+N` after it for an agent row's other PRs, with no border and no glyph; a pressable mark fills under the pointer, a mark whose GitHub read is stale dims with the last read time in its tooltip, and where the row already names the pull request (a checkout's glyph, a graph head, a search row) the mark drops the number.
Only a change request keeps a word beside the mark, `변경 요청` in red, as failed checks are; the Overview chip, Issues, the graph box and the PRs row draw no separate checks mark.
On the web a checkout row whose glyph is a pull request's mark makes that glyph a button (PRD checkout-pr-glyph-card): a ring in the state's colour under the pointer and the pointer cursor say so, a click opens the pull request as a browser display of the Workspace in front (an address the Workspace already shows is brought forward instead), and ⌘-click opens it in the default browser.
While no Workspace is in front (the shared Overview page) or the checkout is an SSH device's, the click opens the default browser too.
Expand Down
2 changes: 1 addition & 1 deletion docs/status-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ Regression owners: `herdr-core/src/request_view/tests.rs` for the verb, the pull
A Needs You row draws its `row.state.ask` (verb and what to do) in place of a line, and a blocked one, which has no ask, its cause; a Working row its label line, or while it waits on its children the line of its most recently changed working descendant; a Done row its label line.
An Idle row carries a line only for a stopped turn (`◐`, the same rule as the sidebar's Stopped mark), marked `unfinished`.
Needs You is ordered by when the ask began, Working puts a failed PR first and then the most recent, Done is most recent first, and Resolved is most recently resolved first.
Idle puts unfinished work first, then a failed, mergeable, pending, draft and merged PR, then the rest, and publishes those with neither a PR nor unfinished work as `more`, which the panel folds behind `그 외 N`.
Idle puts unfinished work first, then a failed, mergeable, pending, draft and merged PR, then the rest, and the panel draws every Idle row as it draws the other groups, with no fold.
A blocked menu takes Approval before an unread AI question's Answer.
A current native `user_turn.kind = question` instead takes Answer while its session holds for a reply, including after it is read and when its content is absent.
Native plan approval keeps Approval; the typed native wait, rather than a provider name or an AI question label, distinguishes these cases.
Expand Down
12 changes: 3 additions & 9 deletions herdr-core/src/agent_state/sessions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ pub(crate) fn row(agent: &SidebarAgentSnapshot) -> Row {
line: label_line(),
unfinished: false,
},
// A read block rests here with its cause, ahead of the fold
// (agent-blocked-state B2).
// A read block rests here with its cause, ahead of the other Idle
// rows (agent-blocked-state B2).
_ if agent.demand == "error" => Row {
group: Group::Idle,
line: agent.detail.clone(),
Expand Down Expand Up @@ -163,8 +163,6 @@ pub struct Section {
pub group: Group,
/// Member indices, in the order the panel draws them.
pub members: Vec<usize>,
/// Idle rows with neither a PR nor unfinished work, folded as "N more".
pub more: Vec<usize>,
}

#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)]
Expand Down Expand Up @@ -235,13 +233,9 @@ pub(crate) fn scope<'a>(members: impl Iterator<Item = (usize, &'a SidebarAgentSn
if rows.is_empty() {
continue;
}
let (shown, more): (Vec<_>, Vec<_>) = rows
.into_iter()
.partition(|(_, row)| group != Group::Idle || idle_rank(row) < 5);
result.groups.push(Section {
group,
members: shown.into_iter().map(|(member, _)| member).collect(),
more: more.into_iter().map(|(member, _)| member).collect(),
members: rows.into_iter().map(|(member, _)| member).collect(),
});
}
result
Expand Down
12 changes: 6 additions & 6 deletions herdr-core/src/request_view/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ fn a_pr_reads_draft_then_failed_or_changes_requested_then_mergeable_then_pending
}

#[test]
fn sessions_keep_delegated_children_out_order_each_group_and_fold_quiet_idle_rows() {
fn sessions_keep_delegated_children_out_and_order_each_group_with_quiet_idle_rows_last() {
use crate::agent_state::sessions::{Group, scope};
let mut rows = rows(&[
("approval", "blocked"),
Expand Down Expand Up @@ -316,16 +316,16 @@ fn sessions_keep_delegated_children_out_order_each_group_and_fold_quiet_idle_row
let groups: Vec<_> = scope
.groups
.iter()
.map(|section| (section.group, section.members.clone(), section.more.clone()))
.map(|section| (section.group, section.members.clone()))
.collect();
assert_eq!(
groups,
[
(Group::NeedsYou, vec![0], vec![]),
(Group::Working, vec![1], vec![]),
(Group::NeedsYou, vec![0]),
(Group::Working, vec![1]),
// Unfinished first, then a failed check, then mergeable; a row
// with neither a PR nor unfinished work folds into "N more".
(Group::Idle, vec![4, 5, 6], vec![2]),
// with neither a PR nor unfinished work comes last, not folded.
(Group::Idle, vec![4, 5, 6, 2]),
]
);
assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion scripts/pen-agent-tree.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function buildAgentTreeParts(tokens) {
// variant hides the number where the row already names the pull request.
const prIcon = frame(AGENT_TREE_MASTERS.prIcon, 'PR mark', {reusable: true, layout: 'horizontal', gap: '$--spacing-xxs', alignItems: 'center', width: 'fit_content', height: PR}, [
icon('ath-pr-g', 'git-pull-request', {size: PR, fill: '$--pr-failed'}),
caption('ath-pr-n', '#924', '$--subtle-foreground', {mono: true}),
caption('ath-pr-n', '924', '$--subtle-foreground', {mono: true}),
{...caption('ath-pr-more', '+1', '$--muted-foreground', {mono: true}), enabled: false},
]);

Expand Down
2 changes: 1 addition & 1 deletion scripts/pen-screens-disk.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function diskCleanupRows(tokens, {themedXref, screenButton, screenDialogS
// A checkout's pull request as the one PR mark (web/src/components/pr-mark.tsx).
const prMark = (id, [number, state]) => {
const [, glyph, fill] = PR_STATES.find(([key]) => key === state);
return themedXref(id, AGENT_TREE_MASTERS.prIcon, `PR #${number}`, {}, {'ath-pr-g': {icon: glyph, fill}, 'ath-pr-n': {content: `#${number}`}});
return themedXref(id, AGENT_TREE_MASTERS.prIcon, `PR #${number}`, {}, {'ath-pr-g': {icon: glyph, fill}, 'ath-pr-n': {content: `${number}`}});
};
const HAIR = num(tokens, '--size-hairline');
const DIM = num(tokens, '--opacity-dimmed');
Expand Down
11 changes: 5 additions & 6 deletions scripts/pen-screens-sessions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function sessionScreens(tokens, {frame, text, icon, themedXref, screenBut
// The PR mark (web/src/components/pr-mark.tsx), a ref of Component / Agent tree parts: the state's icon and colour, the number, and `+N` for several (B22).
const prChip = (id, {number, state, more = 0}) => {
const [, glyph, fill] = PR_STATES.find(([key]) => key === state);
return themedXref(id, AGENT_TREE_MASTERS.prIcon, `PR #${number}`, {}, {'ath-pr-g': {icon: glyph, fill}, 'ath-pr-n': {content: `#${number}`}, 'ath-pr-more': more ? {enabled: true, content: `+${more}`} : {enabled: false}});
return themedXref(id, AGENT_TREE_MASTERS.prIcon, `PR #${number}`, {}, {'ath-pr-g': {icon: glyph, fill}, 'ath-pr-n': {content: `${number}`}, 'ath-pr-more': more ? {enabled: true, content: `+${more}`} : {enabled: false}});
};
const chevron = (id, open) => frame(id, 'Chevron lane', {width:16,height:20,layout:'horizontal',justifyContent:'center',alignItems:'center'}, open === null ? [] : [icon(`${id}-g`, open ? 'chevron-down' : 'chevron-right', {size:12,fill:'$--muted-foreground'})]);

Expand Down Expand Up @@ -67,16 +67,13 @@ export function sessionScreens(tokens, {frame, text, icon, themedXref, screenBut
]),
]);
function panel(suffix, width=420, id=`sfu-panel-${suffix}`) {
const group=(key,title,rows,{folded=false,more=0,count}={})=>frame(`${id}-${key}`,title,{width:'fill_container',layout:'vertical',gap:0},[
const group=(key,title,rows,{folded=false,count}={})=>frame(`${id}-${key}`,title,{width:'fill_container',layout:'vertical',gap:0},[
frame(`${id}-${key}-heading`,'Group heading',{width:'fill_container',height:32,layout:'horizontal',gap:6,alignItems:'center',padding:[0,12]},[
...(folded?[icon(`${id}-${key}-fold`,'chevron-right',{size:12,fill:'$--muted-foreground'})]:[]),
caption(`${id}-${key}-label`,title,key==='needs'?'$--warning':'$--subtle-foreground',{weight:'500'}),
caption(`${id}-${key}-group-count`,String(count ?? rows.length)),
]),
...(folded?[]:rows.map((spec,index)=>row(`${id}-${key}-${index}`,spec,width))),
...(more?[frame(`${id}-${key}-more`,'Folded rest',{width:'fill_container',height:28,layout:'horizontal',gap:6,alignItems:'center',padding:[0,12,0,24]},[
icon(`${id}-${key}-more-g`,'chevron-right',{size:12,fill:'$--muted-foreground'}),caption(`${id}-${key}-more-l`,`그 외 ${more}`,'$--subtle-foreground'),
])]:[]),
]);
return frame(id,'Sessions panel',{width,height:760,layout:'vertical',gap:8,fill:'$--card',stroke:'$--border',strokeWidth:1,strokeAlignment:'inner',clip:true},[
frame(`${id}-tabs`,'Tools tabs',{width:'fill_container',height:32,layout:'horizontal',gap:12,padding:[0,12],alignItems:'center'},[
Expand Down Expand Up @@ -106,7 +103,9 @@ export function sessionScreens(tokens, {frame, text, icon, themedXref, screenBut
{title:'P8 읽기 전용 준비 계획',provider:'codex',mark:'◐',tone:'$--warning',pr:{number:809,state:'failed'},age:'19h',line:'Grok 훅 연결 마무리 남음'},
{title:'에이전트 막힘 상태 PRD',mark:'○',tone:'$--muted-foreground',pr:{number:861,state:'failed'},age:'3h'},
{title:'세션 읽기 큰 레코드 건너뛰기',mark:'○',tone:'$--muted-foreground',pr:{number:869,state:'mergeable'},age:'2h'},
],{more:2,count:5}),
{title:'코어 호스트 노드 이동 설계 문서',mark:'○',tone:'$--muted-foreground',age:'1d'},
{title:'Memory 기능 PRD 초안',mark:'○',tone:'$--muted-foreground',age:'1d'},
]),
group('resolved','Resolved',[],{folded:true,count:7}),
]);
}
Expand Down
Loading
Loading