fix: move settings section after effort picker, matching docs
argus caught the settings block appending before the effort picker's conditional despite the PR description and docs both saying it lands after — DOM order is visual order here (no CSS order: override), so actual layout was model -> settings -> effort. Moved the block after the effort picker's if-block; layout now matches what both already claimed.
This commit is contained in:
parent
198db326b3
commit
3b299375e3
1 changed files with 34 additions and 34 deletions
|
|
@ -267,40 +267,6 @@ window.marked = marked;
|
|||
menu.append(btn);
|
||||
}
|
||||
|
||||
// ─── settings: expand tool output by default ───────────────────
|
||||
// Pure client-side, browser-local preference (no backend involved) —
|
||||
// see docs/web-ui/agent.md::Overflow button. Controls the *default*
|
||||
// open state of otherwise-collapsed `<details>` rows in the live
|
||||
// terminal (long tool-results, Write/Edit diffs, …); rows that
|
||||
// already default open (send/ask/answer/recv) are unaffected.
|
||||
// Read live by the shared terminal factory (HiveTerminal.create's
|
||||
// `expandDetails` option below), so toggling mid-session applies to
|
||||
// the next rendered row without a reload.
|
||||
const settingsSep = el('div', { class: 'overflow-sep', 'aria-hidden': 'true' });
|
||||
const settingsLabel = el('div', { class: 'overflow-section-label' }, 'settings');
|
||||
menu.append(settingsSep, settingsLabel);
|
||||
const expandIcon = el('span', { class: 'overflow-item-icon', 'aria-hidden': 'true' },
|
||||
getExpandDetailsPref() ? '☑' : '☐');
|
||||
const expandBtn = el('button', {
|
||||
type: 'button',
|
||||
class: 'overflow-item overflow-item-verbosity' + (getExpandDetailsPref() ? ' active' : ''),
|
||||
role: 'menuitemcheckbox',
|
||||
'aria-checked': String(getExpandDetailsPref()),
|
||||
title: 'expand tool output panels by default in this terminal (persisted to this browser only)',
|
||||
id: 'expand-details-btn',
|
||||
},
|
||||
expandIcon,
|
||||
'expand tool output',
|
||||
);
|
||||
expandBtn.addEventListener('click', () => {
|
||||
const next = !getExpandDetailsPref();
|
||||
setExpandDetailsPref(next);
|
||||
expandBtn.classList.toggle('active', next);
|
||||
expandBtn.setAttribute('aria-checked', String(next));
|
||||
expandIcon.textContent = next ? '☑' : '☐';
|
||||
});
|
||||
menu.append(expandBtn);
|
||||
|
||||
// ─── effort quick-picker ───────────────────────────────────────
|
||||
// One-click shortcuts for each reasoning-effort level the backend
|
||||
// declares in `availableEfforts` (from `state.available_efforts`).
|
||||
|
|
@ -344,6 +310,40 @@ window.marked = marked;
|
|||
}
|
||||
}
|
||||
|
||||
// ─── settings: expand tool output by default ───────────────────
|
||||
// Pure client-side, browser-local preference (no backend involved) —
|
||||
// see docs/web-ui/agent.md::Overflow button. Controls the *default*
|
||||
// open state of otherwise-collapsed `<details>` rows in the live
|
||||
// terminal (long tool-results, Write/Edit diffs, …); rows that
|
||||
// already default open (send/ask/answer/recv) are unaffected.
|
||||
// Read live by the shared terminal factory (HiveTerminal.create's
|
||||
// `expandDetails` option below), so toggling mid-session applies to
|
||||
// the next rendered row without a reload.
|
||||
const settingsSep = el('div', { class: 'overflow-sep', 'aria-hidden': 'true' });
|
||||
const settingsLabel = el('div', { class: 'overflow-section-label' }, 'settings');
|
||||
menu.append(settingsSep, settingsLabel);
|
||||
const expandIcon = el('span', { class: 'overflow-item-icon', 'aria-hidden': 'true' },
|
||||
getExpandDetailsPref() ? '☑' : '☐');
|
||||
const expandBtn = el('button', {
|
||||
type: 'button',
|
||||
class: 'overflow-item overflow-item-verbosity' + (getExpandDetailsPref() ? ' active' : ''),
|
||||
role: 'menuitemcheckbox',
|
||||
'aria-checked': String(getExpandDetailsPref()),
|
||||
title: 'expand tool output panels by default in this terminal (persisted to this browser only)',
|
||||
id: 'expand-details-btn',
|
||||
},
|
||||
expandIcon,
|
||||
'expand tool output',
|
||||
);
|
||||
expandBtn.addEventListener('click', () => {
|
||||
const next = !getExpandDetailsPref();
|
||||
setExpandDetailsPref(next);
|
||||
expandBtn.classList.toggle('active', next);
|
||||
expandBtn.setAttribute('aria-checked', String(next));
|
||||
expandIcon.textContent = next ? '☑' : '☐';
|
||||
});
|
||||
menu.append(expandBtn);
|
||||
|
||||
overflowMenuPopulated = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue