diff --git a/ui/src/base/api.js b/ui/src/base/api.jsx similarity index 99% rename from ui/src/base/api.js rename to ui/src/base/api.jsx index 81f7b8340..540892b8a 100644 --- a/ui/src/base/api.js +++ b/ui/src/base/api.jsx @@ -1,6 +1,6 @@ // Single place that knows how to talk to archied. Every feature folder goes // through this, so auth handling and error shape live in one file. -import { randomUUID } from "./uuid.js"; +import { randomUUID } from "./uuid.jsx"; async function req(path) { // A daemon that accepts the connection but never answers would otherwise diff --git a/ui/src/base/dom.js b/ui/src/base/dom.jsx similarity index 98% rename from ui/src/base/dom.js rename to ui/src/base/dom.jsx index ca69a88d7..2a2117335 100644 --- a/ui/src/base/dom.js +++ b/ui/src/base/dom.jsx @@ -55,7 +55,7 @@ export function pill(text, kind = "idle") { // Re-exported from task-meta.js so the pill severity vocabulary has a single // source (the server catalog). Importers that pull statusKind from dom.js -- // e.g. dashboard.js -- keep working, and the hardcoded switch is gone. -export { statusKind } from "./task-meta.js"; +export { statusKind } from "./task-meta.jsx"; /** Humanised relative time: "2 min ago". Raw timestamps make people do maths. */ export function ago(value) { diff --git a/ui/src/base/gauge.js b/ui/src/base/gauge.jsx similarity index 98% rename from ui/src/base/gauge.js rename to ui/src/base/gauge.jsx index 9ff739989..3e24b9bcd 100644 --- a/ui/src/base/gauge.js +++ b/ui/src/base/gauge.jsx @@ -1,4 +1,4 @@ -import { el } from "./dom.js"; +import { el } from "./dom.jsx"; /** * Arc gauge for a single headline percentage. diff --git a/ui/src/base/icons.js b/ui/src/base/icons.jsx similarity index 100% rename from ui/src/base/icons.js rename to ui/src/base/icons.jsx diff --git a/ui/src/base/log-row.js b/ui/src/base/log-row.jsx similarity index 97% rename from ui/src/base/log-row.js rename to ui/src/base/log-row.jsx index d11df815f..9b5c8b634 100644 --- a/ui/src/base/log-row.js +++ b/ui/src/base/log-row.jsx @@ -1,4 +1,4 @@ -import { el } from "./dom.js"; +import { el } from "./dom.jsx"; /** * Shared log-entry rendering. Both the daemon-wide log page diff --git a/ui/src/base/statTile.js b/ui/src/base/statTile.jsx similarity index 96% rename from ui/src/base/statTile.js rename to ui/src/base/statTile.jsx index 7f7a60c61..80f4970c7 100644 --- a/ui/src/base/statTile.js +++ b/ui/src/base/statTile.jsx @@ -1,5 +1,5 @@ -import { el } from "./dom.js"; -import { icon } from "./icons.js"; +import { el } from "./dom.jsx"; +import { icon } from "./icons.jsx"; /** * A KPI tile: label, big value, trend against a stated comparison window, and diff --git a/ui/src/base/task-meta.js b/ui/src/base/task-meta.jsx similarity index 99% rename from ui/src/base/task-meta.js rename to ui/src/base/task-meta.jsx index 21666a31f..2da84a502 100644 --- a/ui/src/base/task-meta.js +++ b/ui/src/base/task-meta.jsx @@ -8,7 +8,7 @@ // keep working when archied is unreachable; loadTaskMeta() replaces them with // the live catalog as soon as it arrives. They must match the backend catalog // so drawing the page never flashes a stale label. -import { api } from "./api.js"; +import { api } from "./api.jsx"; const DEFAULT_STATUSES = [ { id: "queued", label: "Queued", kind: "idle" }, diff --git a/ui/src/base/uuid.js b/ui/src/base/uuid.jsx similarity index 100% rename from ui/src/base/uuid.js rename to ui/src/base/uuid.jsx diff --git a/ui/src/captures/capture-row.js b/ui/src/captures/capture-row.jsx similarity index 97% rename from ui/src/captures/capture-row.js rename to ui/src/captures/capture-row.jsx index 74b12b710..dbc817a85 100644 --- a/ui/src/captures/capture-row.js +++ b/ui/src/captures/capture-row.jsx @@ -1,4 +1,4 @@ -import { ago, el, pill } from "../base/dom.js"; +import { ago, el, pill } from "../base/dom.jsx"; /** * One captured event's summary row, plus its expandable detail row when diff --git a/ui/src/captures/captures.js b/ui/src/captures/captures.jsx similarity index 95% rename from ui/src/captures/captures.js rename to ui/src/captures/captures.jsx index 566028f19..ef4b5116b 100644 --- a/ui/src/captures/captures.js +++ b/ui/src/captures/captures.jsx @@ -1,7 +1,7 @@ import "./captures.css"; -import { api, subscribeEvents } from "../base/api.js"; -import { el, empty, mount, pill } from "../base/dom.js"; -import { captureRow } from "./capture-row.js"; +import { api, subscribeEvents } from "../base/api.jsx"; +import { el, empty, mount, pill } from "../base/dom.jsx"; +import { captureRow } from "./capture-row.jsx"; /** * Event inspector (t2db.2): the operator-facing half of capture. Recent diff --git a/ui/src/channels/channels.js b/ui/src/channels/channels.jsx similarity index 96% rename from ui/src/channels/channels.js rename to ui/src/channels/channels.jsx index 3c2316e08..3398b4f96 100644 --- a/ui/src/channels/channels.js +++ b/ui/src/channels/channels.jsx @@ -1,6 +1,6 @@ import "./channels.css"; -import { api } from "../base/api.js"; -import { el, empty, mount, pill } from "../base/dom.js"; +import { api } from "../base/api.jsx"; +import { el, empty, mount, pill } from "../base/dom.jsx"; /** * How you reach Archie. Backed by GET /api/channels, which derives from diff --git a/ui/src/chat/chat-catalog.js b/ui/src/chat/chat-catalog.jsx similarity index 96% rename from ui/src/chat/chat-catalog.js rename to ui/src/chat/chat-catalog.jsx index 4b29f6f10..de57e4b7e 100644 --- a/ui/src/chat/chat-catalog.js +++ b/ui/src/chat/chat-catalog.jsx @@ -1,5 +1,5 @@ -import { el } from "../base/dom.js"; -import { sessionTitle } from "./chat-render.js"; +import { el } from "../base/dom.jsx"; +import { sessionTitle } from "./chat-render.jsx"; export function renderSessions({ sessionList, sessionTools, sessions, currentSession, onSelect }) { sessionList.replaceChildren(); diff --git a/ui/src/chat/chat-panels.js b/ui/src/chat/chat-panels.jsx similarity index 98% rename from ui/src/chat/chat-panels.js rename to ui/src/chat/chat-panels.jsx index a63999a7c..cff0de6e2 100644 --- a/ui/src/chat/chat-panels.js +++ b/ui/src/chat/chat-panels.jsx @@ -1,4 +1,4 @@ -import { el } from "../base/dom.js"; +import { el } from "../base/dom.jsx"; export function renderUpdate(panel, data, { onDefer, onInstall }) { panel.replaceChildren(); diff --git a/ui/src/chat/chat-render.js b/ui/src/chat/chat-render.jsx similarity index 95% rename from ui/src/chat/chat-render.js rename to ui/src/chat/chat-render.jsx index 5948148c0..137e71bdf 100644 --- a/ui/src/chat/chat-render.js +++ b/ui/src/chat/chat-render.jsx @@ -1,5 +1,5 @@ -import { el } from "../base/dom.js"; -import { renderMarkdown } from "./markdown.js"; +import { el } from "../base/dom.jsx"; +import { renderMarkdown } from "./markdown.jsx"; export function sessionTitle(session) { return session.title || session.branch_name || `Conversation ${session.session_id.slice(0, 8)}`; diff --git a/ui/src/chat/chat-retry.js b/ui/src/chat/chat-retry.jsx similarity index 95% rename from ui/src/chat/chat-retry.js rename to ui/src/chat/chat-retry.jsx index ee3a733b5..93b217926 100644 --- a/ui/src/chat/chat-retry.js +++ b/ui/src/chat/chat-retry.jsx @@ -1,4 +1,4 @@ -import { randomUUID } from "../base/uuid.js"; +import { randomUUID } from "../base/uuid.jsx"; export function newChatTurn(text) { return { text, sourceID: randomUUID() }; diff --git a/ui/src/chat/chat-state.js b/ui/src/chat/chat-state.jsx similarity index 82% rename from ui/src/chat/chat-state.js rename to ui/src/chat/chat-state.jsx index a8955a0eb..272ad8226 100644 --- a/ui/src/chat/chat-state.js +++ b/ui/src/chat/chat-state.jsx @@ -1,4 +1,4 @@ -import { randomUUID } from "../base/uuid.js"; +import { randomUUID } from "../base/uuid.jsx"; const CHANNEL_KEY = "archie.web.chat.channel"; diff --git a/ui/src/chat/chat-stream.js b/ui/src/chat/chat-stream.jsx similarity index 84% rename from ui/src/chat/chat-stream.js rename to ui/src/chat/chat-stream.jsx index 2826b2a39..cb061c47f 100644 --- a/ui/src/chat/chat-stream.js +++ b/ui/src/chat/chat-stream.jsx @@ -1,4 +1,4 @@ -import { renderMarkdown } from "./markdown.js"; +import { renderMarkdown } from "./markdown.jsx"; export function updateStreamingReply(current, text) { const next = renderMarkdown(text); diff --git a/ui/src/chat/chat-tools.js b/ui/src/chat/chat-tools.jsx similarity index 98% rename from ui/src/chat/chat-tools.js rename to ui/src/chat/chat-tools.jsx index ea3bec036..c713e6c1e 100644 --- a/ui/src/chat/chat-tools.js +++ b/ui/src/chat/chat-tools.jsx @@ -1,4 +1,4 @@ -import { el } from "../base/dom.js"; +import { el } from "../base/dom.jsx"; // Tool activity is rendered into its own list inside the assistant bubble // rather than folded into the reply text: the text node is replaced wholesale diff --git a/ui/src/chat/chat-update-status.js b/ui/src/chat/chat-update-status.jsx similarity index 100% rename from ui/src/chat/chat-update-status.js rename to ui/src/chat/chat-update-status.jsx diff --git a/ui/src/chat/chat-view.js b/ui/src/chat/chat-view.jsx similarity index 100% rename from ui/src/chat/chat-view.js rename to ui/src/chat/chat-view.jsx diff --git a/ui/src/chat/chat.js b/ui/src/chat/chat.jsx similarity index 97% rename from ui/src/chat/chat.js rename to ui/src/chat/chat.jsx index 1c141001d..935941c28 100644 --- a/ui/src/chat/chat.js +++ b/ui/src/chat/chat.jsx @@ -1,14 +1,14 @@ -import { el } from "../base/dom.js"; -import { api } from "../base/api.js"; -import { createChatView } from "./chat-view.js"; -import { assistantBubble, chatBubble } from "./chat-render.js"; -import { updateStreamingReply } from "./chat-stream.js"; -import { appendToolCall, appendNavigateChip } from "./chat-tools.js"; -import { channelID } from "./chat-state.js"; -import { retryChatTurn, resolveTurn } from "./chat-retry.js"; -import { renderCommands, renderModels, renderSelectors, renderSessions } from "./chat-catalog.js"; -import { renderDangerous, renderUpdate } from "./chat-panels.js"; -import { updateUnavailableMessage } from "./chat-update-status.js"; +import { el } from "../base/dom.jsx"; +import { api } from "../base/api.jsx"; +import { createChatView } from "./chat-view.jsx"; +import { assistantBubble, chatBubble } from "./chat-render.jsx"; +import { updateStreamingReply } from "./chat-stream.jsx"; +import { appendToolCall, appendNavigateChip } from "./chat-tools.jsx"; +import { channelID } from "./chat-state.jsx"; +import { retryChatTurn, resolveTurn } from "./chat-retry.jsx"; +import { renderCommands, renderModels, renderSelectors, renderSessions } from "./chat-catalog.jsx"; +import { renderDangerous, renderUpdate } from "./chat-panels.jsx"; +import { updateUnavailableMessage } from "./chat-update-status.jsx"; import "./chat.css"; diff --git a/ui/src/chat/markdown.js b/ui/src/chat/markdown.jsx similarity index 99% rename from ui/src/chat/markdown.js rename to ui/src/chat/markdown.jsx index f5de10504..263696151 100644 --- a/ui/src/chat/markdown.js +++ b/ui/src/chat/markdown.jsx @@ -1,4 +1,4 @@ -import { el } from "../base/dom.js"; +import { el } from "../base/dom.jsx"; function inlineMarkdown(text) { const fragment = document.createDocumentFragment(); diff --git a/ui/src/curators/curators.js b/ui/src/curators/curators.jsx similarity index 96% rename from ui/src/curators/curators.js rename to ui/src/curators/curators.jsx index e28d380d7..3ff24b148 100644 --- a/ui/src/curators/curators.js +++ b/ui/src/curators/curators.jsx @@ -1,6 +1,6 @@ import "./curators.css"; -import { api } from "../base/api.js"; -import { el, empty, mount, pill, ago } from "../base/dom.js"; +import { api } from "../base/api.jsx"; +import { el, empty, mount, pill, ago } from "../base/dom.jsx"; /** * Curator observability (archie-core-1786637489932-6). Backed by GET diff --git a/ui/src/logs/logs.js b/ui/src/logs/logs.jsx similarity index 97% rename from ui/src/logs/logs.js rename to ui/src/logs/logs.jsx index 4669e82e4..cfb0df23f 100644 --- a/ui/src/logs/logs.js +++ b/ui/src/logs/logs.jsx @@ -1,7 +1,7 @@ import "./logs.css"; -import { api, subscribeLogs } from "../base/api.js"; -import { el, empty, mount, pill } from "../base/dom.js"; -import { logRow } from "../base/log-row.js"; +import { api, subscribeLogs } from "../base/api.jsx"; +import { el, empty, mount, pill } from "../base/dom.jsx"; +import { logRow } from "../base/log-row.jsx"; /** * The log view: history from the file on disk, then live lines appended from diff --git a/ui/src/main.js b/ui/src/main.js deleted file mode 100644 index c42947c56..000000000 --- a/ui/src/main.js +++ /dev/null @@ -1,253 +0,0 @@ -import "./css/_main.css"; -import { el, mount } from "./base/dom.js"; -import { icon } from "./base/icons.js"; -import { dashboardPage } from "./dashboard/dashboard.js"; -import { tasksPage } from "./tasks/tasks.js"; -import { skillsPage } from "./skills/skills.js"; -import { workflowsPage } from "./workflows/workflows.js"; -import { channelsPage } from "./channels/channels.js"; -import { curatorsPage } from "./curators/curators.js"; -import { settingsPage } from "./settings/settings.js"; -import { logsPage } from "./logs/logs.js"; -import { capturesPage } from "./captures/captures.js"; -import { mappingsPage } from "./mappings/mappings.js"; -import { memoryPage } from "./memory/memory.js"; -import { chatPage } from "./chat/chat.js"; - -/** - * Routes are declared once here. Adding a section means adding a feature - * folder and one entry -- there is no switch statement to hunt for. - * - * `soon: true` sections are deliberately visible before they are built: a - * greyed, labelled entry tells you the capability exists and is coming, which - * is more honest than hiding it and more useful than a 404. - */ -const routes = [ - { path: "/", label: "Dashboard", icon: "dashboard", view: dashboardPage }, - { path: "/chat", label: "Chat", icon: "chat", view: chatPage }, - { path: "/tasks", label: "Tasks", icon: "tasks", view: tasksPage }, - { path: "/logs", label: "Logs", icon: "logs", view: logsPage }, - { path: "/captures", label: "Event inspector", icon: "captures", view: capturesPage }, - { path: "/mappings", label: "Field mappings", icon: "mappings", view: mappingsPage }, - { path: "/skills", label: "Skills", icon: "skills", view: skillsPage }, - { path: "/workflows", label: "Workflows", icon: "workflows", view: workflowsPage }, - { path: "/memory", label: "Memory", icon: "memory", view: memoryPage }, - { path: "/curators", label: "Curators", icon: "curators", view: curatorsPage }, - { path: "/channels", label: "Channels", icon: "channels", view: channelsPage }, - { path: "/settings", label: "Configuration", icon: "settings", view: settingsPage }, -]; - -const THEME_KEY = "archie.theme"; - -function applyTheme(theme) { - document.documentElement.dataset.theme = theme; - localStorage.setItem(THEME_KEY, theme); -} - -function currentTheme() { - return localStorage.getItem(THEME_KEY) || "dark"; -} - -function commandBar(onNavigate, onToggleChat) { - const items = new Map(); - - const nav = el( - "nav.nav", - ...[null].flatMap(() => [ - ...routes - .map((route) => { - const item = el( - "a.nav-item", - { - href: `#${route.path}`, - onclick: (e) => { - if (route.soon) e.preventDefault(); - else onNavigate(route.path); - }, - "aria-disabled": route.soon || undefined, - title: route.soon ? "Coming soon" : undefined, - }, - icon(route.icon), - el("span.nav-label", route.label), - route.soon && el("span.nav-soon", "soon"), - ); - items.set(route.path, item); - return item; - }), - ]), - ); - - const themeBtn = el("button.icon-btn", { - title: "Toggle light and dark", - "aria-label": "Toggle light and dark", - onclick: () => { - applyTheme(currentTheme() === "dark" ? "light" : "dark"); - mount(themeBtn, icon(currentTheme() === "dark" ? "moon" : "sun")); - }, - }); - mount(themeBtn, icon(currentTheme() === "dark" ? "moon" : "sun")); - - // Search jumps between sections. It is deliberately not a data search: the - // sections own their own filtering, and a second search that means something - // different in each place is worse than none. - let searchWrap; - const closeMobileSearch = () => { - searchWrap?.classList.remove("is-open"); - searchToggle.setAttribute("aria-expanded", "false"); - }; - const searchToggle = el( - "button.icon-btn.mobile-search-toggle", - { - type: "button", - "aria-label": "Open Jump to navigation", - "aria-expanded": "false", - onclick: () => { - searchWrap.classList.add("is-open"); - searchToggle.setAttribute("aria-expanded", "true"); - search.focus(); - }, - }, - icon("search", { size: 15 }), - ); - const search = el("input", { - type: "search", - placeholder: "Jump to\u2026", - "aria-label": "Jump to a section", - onkeydown: (e) => { - if (e.key === "Escape") { - // preventDefault so the window-level handler (chat drawer close) does - // not also fire: dismissing the search should not dismiss the drawer. - e.preventDefault(); - closeMobileSearch(); - e.target.blur(); - return; - } - if (e.key !== "Enter") return; - const q = e.target.value.trim().toLowerCase(); - const hit = routes.find((r) => !r.soon && r.label.toLowerCase().startsWith(q)); - if (hit) { - onNavigate(hit.path); - e.target.value = ""; - e.target.blur(); - closeMobileSearch(); - } - }, - }); - searchWrap = el( - "div.topbar-search", - el("span.topbar-search-icon", { "aria-hidden": "true" }, icon("search", { size: 15 })), - searchToggle, - search, - ); - - return { - node: el( - "header.topbar", - el("div.brand", el("span.brand-mark", "A"), "Archie"), - nav, - el( - "div.topbar-end", - searchWrap, - el("button.icon-btn.icon-btn-chat", { - "aria-label": "Open chat", - title: "Chat with Archie", - "aria-expanded": "false", - onclick: () => onToggleChat?.(), - }, icon("chat")), - el("button.icon-btn", { title: "Documentation", "aria-label": "Documentation" }, icon("help")), - themeBtn, - el("div.avatar", { title: "Signed in locally" }, "A"), - ), - ), - highlight(path) { - for (const [p, node] of items) { - if (p === path) node.setAttribute("aria-current", "page"); - else node.removeAttribute("aria-current"); - } - }, - }; -} - -function start() { - applyTheme(currentTheme()); - - const outlet = el("main.main"); - // The chat drawer lives beside the outlet, mounted once. It is closed by - // default and opened from the topbar launcher; because it is a slide-over - // rather than a route, the operator can talk to Archie from any page - // without leaving the work that prompted the question. It hosts a single - // chatPage() instance, so session state and the stream survive navigation - // and are not duplicated per page. - const chatDrawer = el("aside.chat-drawer", { "aria-label": "Chat with Archie" }); - const chatClose = el("button.icon-btn.chat-drawer-close", { - "aria-label": "Close chat", - title: "Close chat", - onclick: () => toggleChat(false), - }, icon("close")); - const drawerHead = el("div.chat-drawer-head", el("strong", "Archie"), chatClose); - chatDrawer.append(el("div.chat-drawer-panel", drawerHead, chatPage()), - el("div.chat-scrim", { onclick: () => toggleChat(false) })); - const bar = commandBar(navigate, () => toggleChat()); - const shell = el("div.shell", bar.node, outlet, chatDrawer); - mount(document.getElementById("app"), shell); - - function toggleChat(open) { - const shouldOpen = open === undefined ? !chatDrawer.classList.contains("is-open") : open; - chatDrawer.classList.toggle("is-open", shouldOpen); - document.body.classList.toggle("chat-open", shouldOpen); - const btn = shell.querySelector(".icon-btn-chat"); - if (btn) btn.setAttribute("aria-expanded", String(shouldOpen)); - } - window.__archieToggleChat = toggleChat; - - function navigate(path) { - if (location.hash !== '#' + path) location.hash = path; - else show(path); - } - - function show(rawPath) { - // Let a page release its subscriptions before it is replaced, so the SSE - // stream does not leak a connection per navigation. - outlet.firstElementChild?.dispatchEvent(new CustomEvent("archie:teardown")); - const [path, query = ""] = rawPath.split("?", 2); - const route = routes.find((r) => r.path === path) || routes[0]; - bar.highlight(route.path); - // The chat is a drawer, not a page: /chat opens it rather than mounting a - // second chatPage() (which would duplicate session state and the stream). - if (route.path === "/chat") { - mount(outlet); - toggleChat(true); - return; - } - mount(outlet, route.view ? route.view(new URLSearchParams(query)) : comingSoon(route)); - // Navigating to a page dismisses the chat drawer; the operator has moved on. - toggleChat(false); - } - - window.addEventListener("hashchange", () => show(location.hash.slice(1) || "/")); - window.addEventListener("keydown", (e) => { - // A focused control (the composer dismissing its command menu, or the - // topbar search) already handled Escape via preventDefault; closing the - // drawer too would make the menu impossible to dismiss alone. - if (e.defaultPrevented) return; - if (e.key === "Escape" && chatDrawer.classList.contains("is-open")) toggleChat(false); - }); - show(location.hash.slice(1) || "/"); -} - -function comingSoon(route) { - return el( - "div", - el("div.page-head", el("div", el("h1.page-title", route.label))), - el( - "div.card", - el( - "div.empty", - el("div.empty-title", `${route.label} is not built yet`), - el("div", "This section is next up. Nothing is broken."), - ), - ), - ); -} - -start(); diff --git a/ui/src/main.jsx b/ui/src/main.jsx index 96910f794..4375c5dc3 100644 --- a/ui/src/main.jsx +++ b/ui/src/main.jsx @@ -209,31 +209,19 @@ function start() { // Let a page release its subscriptions before it is replaced, so the SSE // stream does not leak a connection per navigation. outlet.firstElementChild?.dispatchEvent(new CustomEvent("archie:teardown")); - - // Unmount Preact cleanly if a Preact component was mounted here - import("preact").then(({ render, isValidElement }) => { - render(null, outlet); - - const [path, query = ""] = rawPath.split("?", 2); - const route = routes.find((r) => r.path === path) || routes[0]; - bar.highlight(route.path); - // The chat is a drawer, not a page: /chat opens it rather than mounting a - // second chatPage() (which would duplicate session state and the stream). - if (route.path === "/chat") { - mount(outlet); - toggleChat(true); - return; - } - - const viewContent = route.view ? route.view(new URLSearchParams(query)) : comingSoon(route); - if (isValidElement(viewContent)) { - render(viewContent, outlet); - } else { - mount(outlet, viewContent); - } - // Navigating to a page dismisses the chat drawer; the operator has moved on. - toggleChat(false); - }); + const [path, query = ""] = rawPath.split("?", 2); + const route = routes.find((r) => r.path === path) || routes[0]; + bar.highlight(route.path); + // The chat is a drawer, not a page: /chat opens it rather than mounting a + // second chatPage() (which would duplicate session state and the stream). + if (route.path === "/chat") { + mount(outlet); + toggleChat(true); + return; + } + mount(outlet, route.view ? route.view(new URLSearchParams(query)) : comingSoon(route)); + // Navigating to a page dismisses the chat drawer; the operator has moved on. + toggleChat(false); } window.addEventListener("hashchange", () => show(location.hash.slice(1) || "/")); diff --git a/ui/src/mappings/mapping-editor.js b/ui/src/mappings/mapping-editor.jsx similarity index 99% rename from ui/src/mappings/mapping-editor.js rename to ui/src/mappings/mapping-editor.jsx index 26140106f..31bdc92c0 100644 --- a/ui/src/mappings/mapping-editor.js +++ b/ui/src/mappings/mapping-editor.jsx @@ -1,4 +1,4 @@ -import { el, pill } from "../base/dom.js"; +import { el, pill } from "../base/dom.jsx"; /** * Pure rendering + path/type logic for the mapping editor, split out from diff --git a/ui/src/mappings/mappings.js b/ui/src/mappings/mappings.jsx similarity index 98% rename from ui/src/mappings/mappings.js rename to ui/src/mappings/mappings.jsx index ddc44af22..7c86ded4f 100644 --- a/ui/src/mappings/mappings.js +++ b/ui/src/mappings/mappings.jsx @@ -1,7 +1,7 @@ import "./mappings.css"; -import { api } from "../base/api.js"; -import { el, empty, mount } from "../base/dom.js"; -import { fieldsTable, mappingRow, payloadTree } from "./mapping-editor.js"; +import { api } from "../base/api.jsx"; +import { el, empty, mount } from "../base/dom.jsx"; +import { fieldsTable, mappingRow, payloadTree } from "./mapping-editor.jsx"; /** * Payload field mapping (t2db.3): bind named fields to JSON paths inside a diff --git a/ui/src/memory/memory.js b/ui/src/memory/memory.jsx similarity index 95% rename from ui/src/memory/memory.js rename to ui/src/memory/memory.jsx index c8417fff0..6f147c358 100644 --- a/ui/src/memory/memory.js +++ b/ui/src/memory/memory.jsx @@ -1,7 +1,7 @@ import "./memory.css"; -import { api } from "../base/api.js"; -import { el, empty, mount, pill } from "../base/dom.js"; -import { icon } from "../base/icons.js"; +import { api } from "../base/api.jsx"; +import { el, empty, mount, pill } from "../base/dom.jsx"; +import { icon } from "../base/icons.jsx"; /** * Memory: what Archie can recall, and with what. diff --git a/ui/src/settings/config-row.js b/ui/src/settings/config-row.jsx similarity index 98% rename from ui/src/settings/config-row.js rename to ui/src/settings/config-row.jsx index 79a9e0653..137cf0b00 100644 --- a/ui/src/settings/config-row.js +++ b/ui/src/settings/config-row.jsx @@ -1,5 +1,5 @@ -import { api } from "../base/api.js"; -import { el, mount } from "../base/dom.js"; +import { api } from "../base/api.jsx"; +import { el, mount } from "../base/dom.jsx"; /** * One key/value row on the Configuration page, and its inline edit flow. diff --git a/ui/src/settings/settings.js b/ui/src/settings/settings.jsx similarity index 98% rename from ui/src/settings/settings.js rename to ui/src/settings/settings.jsx index 836e878a6..71dc04123 100644 --- a/ui/src/settings/settings.js +++ b/ui/src/settings/settings.jsx @@ -1,9 +1,9 @@ import "./settings.css"; -import { api } from "../base/api.js"; -import { el, empty, mount, pill } from "../base/dom.js"; -import { statusKind, statusLabel } from "../base/task-meta.js"; -import { row } from "./config-row.js"; -import { updateStatusCard } from "./update-status.js"; +import { api } from "../base/api.jsx"; +import { el, empty, mount, pill } from "../base/dom.jsx"; +import { statusKind, statusLabel } from "../base/task-meta.jsx"; +import { row } from "./config-row.jsx"; +import { updateStatusCard } from "./update-status.jsx"; /** * A view of the config archied is actually running with, grouped by @@ -272,7 +272,7 @@ function repositoriesCard(repos, onSaved) { // repoBoolCell renders an immediately-autosaving checkbox, PATCHing // api.configRepoUpdate on change and reverting the toggle if the save -// fails (archie-core-b6ew.6). A table cell doesn't fit config-row.js's +// fails (archie-core-b6ew.6). A table cell doesn't fit config-row.jsx's // label/value/actions Edit-then-Save flow, and a checkbox is the more // natural control for a boolean in a table anyway. function repoBoolCell(r, field, onSaved) { diff --git a/ui/src/settings/update-status.js b/ui/src/settings/update-status.jsx similarity index 98% rename from ui/src/settings/update-status.js rename to ui/src/settings/update-status.jsx index b23699cbd..3a0d5632c 100644 --- a/ui/src/settings/update-status.js +++ b/ui/src/settings/update-status.jsx @@ -1,4 +1,4 @@ -import { el, empty, pill } from "../base/dom.js"; +import { el, empty, pill } from "../base/dom.jsx"; const STATUS_LABELS = { ok: "OK", diff --git a/ui/src/skills/skills.js b/ui/src/skills/skills.jsx similarity index 97% rename from ui/src/skills/skills.js rename to ui/src/skills/skills.jsx index 08514a005..918d79b01 100644 --- a/ui/src/skills/skills.js +++ b/ui/src/skills/skills.jsx @@ -1,6 +1,6 @@ import "./skills.css"; -import { api } from "../base/api.js"; -import { el, empty, mount } from "../base/dom.js"; +import { api } from "../base/api.jsx"; +import { el, empty, mount } from "../base/dom.jsx"; /** * What Archie can actually do, beyond what is in the source. Backed by diff --git a/ui/src/tasks/task-filters.js b/ui/src/tasks/task-filters.jsx similarity index 99% rename from ui/src/tasks/task-filters.js rename to ui/src/tasks/task-filters.jsx index e1dafbc49..61187a668 100644 --- a/ui/src/tasks/task-filters.js +++ b/ui/src/tasks/task-filters.jsx @@ -1,4 +1,4 @@ -import { attentionStatusIds, statusIds } from "../base/task-meta.js"; +import { attentionStatusIds, statusIds } from "../base/task-meta.jsx"; // The vocabulary is the server catalog, not a hand-synced copy: the "needs // you" grouping and the set of known statuses come straight from task-meta so diff --git a/ui/src/tasks/task-logs.js b/ui/src/tasks/task-logs.jsx similarity index 94% rename from ui/src/tasks/task-logs.js rename to ui/src/tasks/task-logs.jsx index 6a57cd68b..924d483b9 100644 --- a/ui/src/tasks/task-logs.js +++ b/ui/src/tasks/task-logs.jsx @@ -1,5 +1,5 @@ -import { el, empty } from "../base/dom.js"; -import { logRow } from "../base/log-row.js"; +import { el, empty } from "../base/dom.jsx"; +import { logRow } from "../base/log-row.jsx"; /** * Renders one task's persisted attempt log (GET /api/tasks/:id/logs) -- diff --git a/ui/src/tasks/task-row.js b/ui/src/tasks/task-row.jsx similarity index 100% rename from ui/src/tasks/task-row.js rename to ui/src/tasks/task-row.jsx diff --git a/ui/src/tasks/tasks.js b/ui/src/tasks/tasks.jsx similarity index 97% rename from ui/src/tasks/tasks.js rename to ui/src/tasks/tasks.jsx index 3b3e2d8f9..1b5af46c2 100644 --- a/ui/src/tasks/tasks.js +++ b/ui/src/tasks/tasks.jsx @@ -1,12 +1,12 @@ import "./tasks.css"; -import { api } from "../base/api.js"; -import { ago, el, empty, mount, pill } from "../base/dom.js"; -import { statTile } from "../base/statTile.js"; -import { taskRowA11y } from "./task-row.js"; -import { initialTaskFilter, taskMatchesStatus } from "./task-filters.js"; -import { describeTimelineEvent } from "./timeline-event.js"; -import { taskLogPanel } from "./task-logs.js"; -import { actionFor, statusIds, statusKind, statusLabel } from "../base/task-meta.js"; +import { api } from "../base/api.jsx"; +import { ago, el, empty, mount, pill } from "../base/dom.jsx"; +import { statTile } from "../base/statTile.jsx"; +import { taskRowA11y } from "./task-row.jsx"; +import { initialTaskFilter, taskMatchesStatus } from "./task-filters.jsx"; +import { describeTimelineEvent } from "./timeline-event.jsx"; +import { taskLogPanel } from "./task-logs.jsx"; +import { actionFor, statusIds, statusKind, statusLabel } from "../base/task-meta.jsx"; /** * The work board: every task archied knows about, filterable by status and diff --git a/ui/src/tasks/timeline-event.js b/ui/src/tasks/timeline-event.jsx similarity index 100% rename from ui/src/tasks/timeline-event.js rename to ui/src/tasks/timeline-event.jsx diff --git a/ui/src/workflows/workflows.js b/ui/src/workflows/workflows.jsx similarity index 98% rename from ui/src/workflows/workflows.js rename to ui/src/workflows/workflows.jsx index 097149932..f0a23be64 100644 --- a/ui/src/workflows/workflows.js +++ b/ui/src/workflows/workflows.jsx @@ -1,6 +1,6 @@ import "./workflows.css"; -import { api } from "../base/api.js"; -import { el, empty, mount } from "../base/dom.js"; +import { api } from "../base/api.jsx"; +import { el, empty, mount } from "../base/dom.jsx"; /** * Plain-language workflow names. Falls back to a title-cased version of the