Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

Move suggested prompts below composer (#1437)

Eve Bouffard2a95a75ba7bd
diff --git a/plugins/web-ui/src/chat.ts b/plugins/web-ui/src/chat.ts
index 6384c9b03..b80ff16b8 100644
--- a/plugins/web-ui/src/chat.ts
+++ b/plugins/web-ui/src/chat.ts
@@ -1423,6 +1423,8 @@ export function createChatSurface(
</div>
</section>
<div class="chat-bottom-dock">
+ ${goalStrip(agent)} ${ctx.composer.queuedStrip(agent)} ${backgroundActivityStrip()}
+ ${ctx.composer.composerForm(agent)}
${
emptyChat &&
!editingApp &&
@@ -1443,8 +1445,6 @@ export function createChatSurface(
)
: nothing
}
- ${goalStrip(agent)} ${ctx.composer.queuedStrip(agent)} ${backgroundActivityStrip()}
- ${ctx.composer.composerForm(agent)}
</div>
</div>
`,
diff --git a/plugins/web-ui/src/shell.css b/plugins/web-ui/src/shell.css
index d4b6699b2..a58516b6d 100644
--- a/plugins/web-ui/src/shell.css
+++ b/plugins/web-ui/src/shell.css
@@ -2770,13 +2770,13 @@ qm-markdown .tok-in {
display: grid;
grid-template-rows: 1fr;
width: min(var(--content-w), calc(100% - 32px));
- margin: 0 auto 10px;
+ margin: 10px auto max(18px, calc(10px + env(safe-area-inset-bottom)));
padding: 0 2px;
opacity: 1;
visibility: visible;
transition:
grid-template-rows 220ms ease,
- margin-bottom 220ms ease,
+ margin-top 220ms ease,
opacity 160ms ease,
visibility 0s;
}
@@ -2786,16 +2786,19 @@ qm-markdown .tok-in {
}
.suggested-activities.is-collapsed {
grid-template-rows: 0fr;
- margin-bottom: 0;
+ margin-top: 0;
opacity: 0;
visibility: hidden;
pointer-events: none;
transition:
grid-template-rows 220ms ease,
- margin-bottom 220ms ease,
+ margin-top 220ms ease,
opacity 140ms ease,
visibility 0s 220ms;
}
+.empty-chat:has(.suggested-activities) .composer-wrap {
+ margin-bottom: 0;
+}
.empty-chat:has(.suggested-activities) .chat-cta {
transform: translateY(8px);
}
@@ -2856,7 +2859,7 @@ qm-markdown .tok-in {
@media (max-width: 860px) {
.suggested-activities {
padding: 0 2px;
- margin-bottom: 12px;
+ margin-top: 12px;
}
}
.custom-chat-shell:has(> .chat-scroll):not(.empty-chat) > .chat-bottom-dock {
diff --git a/plugins/web-ui/test/suggested-activities-ui.test.ts b/plugins/web-ui/test/suggested-activities-ui.test.ts
index 2e0596fe7..2fb54c963 100644
--- a/plugins/web-ui/test/suggested-activities-ui.test.ts
+++ b/plugins/web-ui/test/suggested-activities-ui.test.ts
@@ -1,4 +1,5 @@
import assert from "node:assert/strict";
+import { readFileSync } from "node:fs";
import test from "node:test";
import { JSDOM } from "jsdom";
import { createServer } from "vite";
@@ -6,6 +7,19 @@ import type { Agent } from "@earendil-works/pi-agent-core";
import type { ComposerSurface, ConvCtx } from "../src/conv-types.ts";
import type { SuggestedActivity } from "../../chassis/src/suggested-activities.ts";
+test("suggested prompts render below the composer", () => {
+ const chat = readFileSync(new URL("../src/chat.ts", import.meta.url), "utf8");
+ const dock = chat.slice(
+ chat.indexOf('<div class="chat-bottom-dock">'),
+ chat.indexOf("transcriptViewport.afterRender()"),
+ );
+ const composerIndex = dock.indexOf("ctx.composer.composerForm(agent)");
+ const suggestionsIndex = dock.indexOf("suggestedActivities(");
+ assert.notEqual(composerIndex, -1);
+ assert.notEqual(suggestionsIndex, -1);
+ assert.ok(composerIndex < suggestionsIndex);
+});
+
test("activity selection fills and persists an editable draft without sending or overwriting work", async () => {
const dom = new JSDOM('<!doctype html><div id="app"></div><main></main>', {
url: "http://localhost/",