mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-29 13:21:18 -08:00
Let the app bar's update line use the room the bar has
AI Assisted
This commit is contained in:
1 parent
834b71e82d
commit
97f65edd84
4 files changed
+132
-4
No files matched your search
@@ -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);
|
||||
|
||||
@@ -105,8 +105,15 @@
|
||||
@media (prefers-reduced-motion: reduce) { #loop-dot, .loop-pip.current { animation: none; } }
|
||||
#bar-grow { flex: 1; min-width: 0; }
|
||||
/* The one next step for the console or the skills, at the right end. */
|
||||
#next-step { display: flex; align-items: center; gap: 8px; flex: none; }
|
||||
#next-step-text { overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
|
||||
/* It takes the room the row has left and is cut, with an ellipsis, only
|
||||
once fitBar() has already dropped the model and status text. The text's
|
||||
column may shrink to nothing, so the box's own floor is its buttons:
|
||||
it never squeezes them, or runs them under the menu button. */
|
||||
#bar-row > #next-step {
|
||||
display: grid; grid-auto-flow: column; grid-template-columns: minmax(0, max-content); grid-auto-columns: max-content;
|
||||
align-items: center; gap: 8px; flex: 0 1 auto;
|
||||
}
|
||||
#next-step > #next-step-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
||||
#next-step-text.is-ok { color: var(--ok); }
|
||||
#next-step-text.is-warn { color: var(--stage); }
|
||||
#next-step-text.is-err { color: var(--warn); }
|
||||
|
||||
Reference in new issue
Block a user