mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 20:45:33 -08:00
Show the agent's model and effort in the app bar
AI Assisted
This commit is contained in:
1 parent
02380fa6fe
commit
b585eccd5a
4 files changed
+71
-5
No files matched your search
@@ -18,6 +18,7 @@ const agentDotEl = document.getElementById('agent-dot');
|
||||
const agentNameEl = document.getElementById('agent-name');
|
||||
const agentEndedEl = document.getElementById('agent-ended');
|
||||
const agentBypassEl = document.getElementById('agent-bypass');
|
||||
const agentModelEl = document.getElementById('agent-model');
|
||||
const agentNoneEl = document.getElementById('agent-none');
|
||||
const agentStatusEl = document.getElementById('agent-status');
|
||||
const restartBtn = document.getElementById('agent-restart');
|
||||
@@ -166,6 +167,12 @@ function applyAgentState(next, { skipReset } = {}) {
|
||||
agentNameEl.textContent = active || ended ? label || 'The agent' : '';
|
||||
agentDotEl.className = `agent-dot${active ? (bypassActive ? ' is-warn' : ' is-ok') : ''}`;
|
||||
agentEndedEl.hidden = !ended;
|
||||
// The model and effort the app started it with, when it knows them: an agent
|
||||
// on its own default model has none to show, and an effort needs a model.
|
||||
const modelText = agent.model ? (agent.effort ? `${agent.model} · ${agent.effort}` : agent.model) : '';
|
||||
agentModelEl.textContent = active || ended ? modelText : '';
|
||||
agentModelEl.hidden = !agentModelEl.textContent;
|
||||
agentModelEl.title = agentModelEl.textContent ? `Started on ${agentModelEl.textContent}` : '';
|
||||
agentBypassEl.hidden = !bypassActive;
|
||||
renderAgentMenuHead(label || 'The agent', { active, ended, bypassActive });
|
||||
if (agentMenu.hidden === false && agentMenuBtn.hidden) closeBarMenus();
|
||||
|
||||
@@ -45,7 +45,8 @@
|
||||
.agent-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #666; }
|
||||
.agent-dot.is-ok { background: #6a9955; }
|
||||
.agent-dot.is-warn { background: #d7ba7d; }
|
||||
#agent-ended { color: var(--ink-3); font-weight: 400; }
|
||||
#agent-ended, #agent-model { color: var(--ink-3); font-weight: 400; }
|
||||
#agent-model { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
#agent-bypass { flex: none; font-size: 11px; font-weight: 600; line-height: 1.3; padding: 0 7px; border-radius: 999px; border: 1px solid #d7ba7d; color: #d7ba7d; }
|
||||
#agent-none { color: var(--ink-3); }
|
||||
#agent-status { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 320px; }
|
||||
@@ -283,7 +284,7 @@
|
||||
<button id="project-menu-button" class="bar-menu" aria-haspopup="menu" aria-expanded="false" aria-controls="project-menu" hidden><span id="project-name"></span><span class="bar-caret" aria-hidden="true">▾</span></button>
|
||||
<!-- Whenever an agent exists, running or ended, just left of its menu. -->
|
||||
<button id="agent-restart" hidden>New Session</button>
|
||||
<button id="agent-menu-button" class="bar-menu" aria-haspopup="menu" aria-expanded="false" aria-controls="agent-menu" hidden><span id="agent-dot" class="agent-dot" aria-hidden="true"></span><span id="agent-name"></span><span id="agent-ended" hidden>ended</span><span id="agent-bypass" title="Permission checks are off: the agent runs commands and changes files without asking" hidden>checks off</span><span class="bar-caret" aria-hidden="true">▾</span></button>
|
||||
<button id="agent-menu-button" class="bar-menu" aria-haspopup="menu" aria-expanded="false" aria-controls="agent-menu" hidden><span id="agent-dot" class="agent-dot" aria-hidden="true"></span><span id="agent-name"></span><span id="agent-model" title="The model and effort this agent was started with" hidden></span><span id="agent-ended" hidden>ended</span><span id="agent-bypass" title="Permission checks are off: the agent runs commands and changes files without asking" hidden>checks off</span><span class="bar-caret" aria-hidden="true">▾</span></button>
|
||||
<span id="agent-none">No agent</span>
|
||||
<span id="agent-status" role="status"></span>
|
||||
<span id="bar-grow"></span>
|
||||
|
||||
Reference in new issue
Block a user