Let the app bar's update line use the room the bar has

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-29 10:49:44 -08:00
1 parent 834b71e82d
commit 97f65edd84
4 files changed
+132 -4

No files matched your search

+4 -1
View File
@@ -427,8 +427,11 @@ function fitBar() {
barRowEl.classList.remove('no-model', 'no-status');
const model = agentModelEl.hidden ? 0 : agentModelEl.offsetWidth;
const status = agentStatusEl.textContent ? agentStatusEl.offsetWidth : 0;
// The step text shrinks rather than overflowing the row, so what it hides
// counts as needed room: the model and status drop before it is cut.
const stepCut = nextStepEl.hidden ? 0 : Math.max(0, nextStepTextEl.scrollWidth - nextStepTextEl.clientWidth);
// Only an agent's menu can hold them, so with none the row keeps everything.
const fit = agentMenuBtn.hidden ? { model: true, status: true } : barFit({ available: barRowEl.clientWidth, needed: barRowEl.scrollWidth, model, status });
const fit = agentMenuBtn.hidden ? { model: true, status: true } : barFit({ available: barRowEl.clientWidth, needed: barRowEl.scrollWidth + stepCut, model, status });
const dropModel = !fit.model && model > 0;
const dropStatus = !fit.status && status > 0;
barRowEl.classList.toggle('no-model', dropModel);