@firstpick/pi-package-webui 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -9
- package/bin/pi-webui.mjs +1039 -33
- package/index.ts +136 -29
- package/package.json +3 -2
- package/public/app.js +2419 -132
- package/public/index.html +13 -3
- package/public/service-worker.js +13 -1
- package/public/styles.css +669 -124
- package/tests/mobile-static.test.mjs +202 -2
package/public/index.html
CHANGED
|
@@ -31,7 +31,13 @@
|
|
|
31
31
|
</div>
|
|
32
32
|
</header>
|
|
33
33
|
<div id="widgetArea" class="widget-area"></div>
|
|
34
|
-
<div id="chat" class="chat" aria-live="polite"
|
|
34
|
+
<div id="chat" class="chat" aria-live="polite">
|
|
35
|
+
<button id="stickyUserPromptButton" class="sticky-user-prompt-button" type="button" aria-controls="chat" hidden></button>
|
|
36
|
+
</div>
|
|
37
|
+
<div id="feedbackTray" class="feedback-tray" aria-live="polite" hidden>
|
|
38
|
+
<span id="feedbackTraySummary">No action feedback queued.</span>
|
|
39
|
+
<button id="sendFeedbackButton" type="button">Send & create LEARNING</button>
|
|
40
|
+
</div>
|
|
35
41
|
<button id="jumpToLatestButton" class="jump-to-latest-button" type="button" hidden>Latest ↓</button>
|
|
36
42
|
<div id="statusBar" class="statusbar" aria-live="polite"></div>
|
|
37
43
|
<section id="gitWorkflowPanel" class="git-workflow-panel" aria-live="polite" hidden>
|
|
@@ -48,8 +54,8 @@
|
|
|
48
54
|
<div id="gitWorkflowActions" class="git-workflow-actions"></div>
|
|
49
55
|
</section>
|
|
50
56
|
<form id="composer" class="composer">
|
|
51
|
-
<textarea id="promptInput" rows="1" enterkeyhint="enter" placeholder="Ask Pi…"></textarea>
|
|
52
|
-
<div id="commandSuggest" class="command-suggest" role="listbox" aria-label="Command suggestions" hidden></div>
|
|
57
|
+
<textarea id="promptInput" rows="1" enterkeyhint="enter" placeholder="Ask Pi…" autofocus></textarea>
|
|
58
|
+
<div id="commandSuggest" class="command-suggest" role="listbox" aria-label="Command and path suggestions" hidden></div>
|
|
53
59
|
<div class="composer-row">
|
|
54
60
|
<button id="composerActionsButton" class="composer-actions-button" type="button" aria-controls="composerActionsPanel" aria-expanded="false">Actions</button>
|
|
55
61
|
<div id="composerActionsPanel" class="composer-actions-panel" aria-label="Composer actions">
|
|
@@ -126,6 +132,10 @@
|
|
|
126
132
|
</select>
|
|
127
133
|
<button id="setThinkingButton" type="button">Set thinking</button>
|
|
128
134
|
</div>
|
|
135
|
+
<div class="control-field">
|
|
136
|
+
<label for="themeSelect">Theme</label>
|
|
137
|
+
<select id="themeSelect" title="Theme"></select>
|
|
138
|
+
</div>
|
|
129
139
|
<div class="control-field network-control-field">
|
|
130
140
|
<label>Network</label>
|
|
131
141
|
<div id="networkStatus" class="network-status closed">Local only</div>
|
package/public/service-worker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const CACHE_NAME = "pi-webui-pwa-
|
|
1
|
+
const CACHE_NAME = "pi-webui-pwa-v6";
|
|
2
2
|
const APP_SHELL = [
|
|
3
3
|
"/",
|
|
4
4
|
"/index.html",
|
|
@@ -23,6 +23,18 @@ self.addEventListener("activate", (event) => {
|
|
|
23
23
|
);
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
+
self.addEventListener("notificationclick", (event) => {
|
|
27
|
+
event.notification.close();
|
|
28
|
+
const targetUrl = event.notification.data?.url || `${self.location.origin}/`;
|
|
29
|
+
event.waitUntil(
|
|
30
|
+
self.clients.matchAll({ type: "window", includeUncontrolled: true }).then((clients) => {
|
|
31
|
+
const webuiClient = clients.find((client) => client.url.startsWith(self.location.origin));
|
|
32
|
+
if (webuiClient) return webuiClient.focus();
|
|
33
|
+
return self.clients.openWindow?.(targetUrl);
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
|
|
26
38
|
self.addEventListener("fetch", (event) => {
|
|
27
39
|
const { request } = event;
|
|
28
40
|
if (request.method !== "GET") return;
|