polish: refine structured composer
This commit is contained in:
@@ -104,7 +104,9 @@ export function createStructuredConnection(
|
||||
</button>
|
||||
<div class="structured-config-menu" role="group" aria-label="Session settings" hidden></div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary structured-send">Send</button>
|
||||
<button type="submit" class="btn btn-primary structured-send"><span>Send</span>
|
||||
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="m7 5 5 5-5 5M12 10H3"/></svg>
|
||||
</button>
|
||||
<button type="button" class="btn structured-cancel" hidden>Cancel turn</button>
|
||||
</form>
|
||||
</div>
|
||||
@@ -478,9 +480,11 @@ export function createStructuredConnection(
|
||||
|
||||
function renderComposerState(): void {
|
||||
const active = state.turn.responding || state.turn.thinking || awaitingBeginGeneration !== null;
|
||||
const projectedActive = state.turn.responding || state.turn.thinking;
|
||||
input.disabled = active;
|
||||
sendBtn.disabled = active;
|
||||
cancelBtn.hidden = !state.turn.responding && !state.turn.thinking;
|
||||
sendBtn.hidden = projectedActive;
|
||||
cancelBtn.hidden = !projectedActive;
|
||||
if (active) closeCommandMenu();
|
||||
renderActivity();
|
||||
}
|
||||
@@ -696,7 +700,9 @@ export function createStructuredConnection(
|
||||
function autoResize(): void {
|
||||
updateTranscriptLayout(() => {
|
||||
input.style.height = "auto";
|
||||
input.style.overflowY = "hidden";
|
||||
input.style.height = `${Math.min(input.scrollHeight, 160)}px`;
|
||||
if (input.scrollHeight > 160) input.style.overflowY = "auto";
|
||||
});
|
||||
}
|
||||
input.addEventListener("input", () => {
|
||||
|
||||
Reference in New Issue
Block a user