feat: v2.6.0 — Chat UI composer (+ menu, project files, activity panel, permission mode, Stop), git on a workspace's extra folders (#70), long paste as a file (#68), S3 server mode (experimental)
Chat UI: - Each Claude/Codex session keeps its own chat/terminal view; Settings only sets how new sessions open. - Composer + menu: upload, project files and folders (#54, also dragged from the Files/Changes tree), context files, recent uploads, skills, plugins. - Activity side panel (progress, outputs, files read, uploads, memory, skills, connectors) with a file preview; edited-file counts per turn. - Permission-mode chip (Shift+Tab steps, read back from the pane: server/lib/pane-mode.js, GET|POST /api/run/:id/permission-mode). - Stop (Esc) while the main agent works; the status is checked per agent (with session_id /api/agents ignores its status filter) and re-read every 5 s while Stop shows. - Dropped images shown in the conversation (GET /api/run/drop/:name, the requester's own drop dir), full-size viewer. - A plain-text paste over 5,000 characters is attached as pasted-text.txt, so no prompt reaches tmux/argv limits (#68). Changes panel: every /api/lanes/:id/git* route takes ?source=<lane_sources id> (sourceFolder; ENOSOURCE otherwise) and a folder picker switches the whole panel to a workspace's extra folder (#70). Server mode S3 (one Linux user per account) — experimental, verified with fake sudo plus a P6 managed-settings spike on a test account: - member tmux listing runs in the background (cached, 15 s => unknown); - transcript snapshot copy is async, chunked, temp file + rename; - Express Layer patch only on Express 4; - tmux capturePane/sendKey go to the member's own server. Docs: the multi-user design moved in as docs/plans/server-mode/README.md (the AgentHub-Server repo is gone); S3-PLAN P6 result; LANES/API/openapi.
This commit is contained in:
@@ -7,11 +7,15 @@
|
||||
* themselves are CSS-variable blocks in `index.css`. State is never cached in
|
||||
* the module — every instance reads storage + `matchMedia` through
|
||||
* `useSyncExternalStore`, so the Sidebar and Settings can never disagree, and
|
||||
* another tab's change arrives through the `storage` event.
|
||||
* another tab's change arrives through the `storage` event. Every change is also
|
||||
* saved to the account (`/api/me/prefs`, same keys); a sign-in loads it back
|
||||
* through `lib/userPrefs.ts` (`hydrate`), while the login page wears the OS's
|
||||
* light/dark (`applySystemTheme`) because nobody has chosen yet.
|
||||
* @author Nguyễn Ngọc Trí Vĩ <vinnt@smartgift.vn>
|
||||
*/
|
||||
|
||||
import { useCallback, useLayoutEffect, useSyncExternalStore } from "react";
|
||||
import { api } from "../lib/api";
|
||||
|
||||
export type Theme = "dark" | "light";
|
||||
export type ThemeMode = Theme | "system";
|
||||
@@ -19,7 +23,7 @@ export type ThemeMode = Theme | "system";
|
||||
/** Named themes per mode, in picker order. `default` is the stock palette. */
|
||||
export const THEMES = {
|
||||
dark: ["default", "darcula", "apple-dark", "orca-dark"],
|
||||
light: ["default", "apple-light", "canvas", "orca-light"],
|
||||
light: ["default", "canvas", "apple-light", "orca-light"],
|
||||
} as const satisfies Record<Theme, readonly string[]>;
|
||||
|
||||
const MODE_KEY = "theme";
|
||||
@@ -35,13 +39,20 @@ function read(key: string): string | null {
|
||||
}
|
||||
}
|
||||
|
||||
function write(key: string, value: string): void {
|
||||
function store(key: string, value: string): void {
|
||||
try {
|
||||
localStorage.setItem(key, value);
|
||||
} catch {
|
||||
/* ignore quota / disabled storage */
|
||||
}
|
||||
}
|
||||
|
||||
/** A user's own choice: this browser, every reader, and the account. */
|
||||
function write(key: string, value: string): void {
|
||||
store(key, value);
|
||||
window.dispatchEvent(new Event(CHANGE_EVENT));
|
||||
// This browser keeps it even when the save fails (offline, signed out).
|
||||
api.me.savePrefs({ [key]: value }).catch(() => {});
|
||||
}
|
||||
|
||||
function systemQuery(): MediaQueryList | undefined {
|
||||
@@ -86,6 +97,17 @@ function apply(resolved: Theme, name: string): void {
|
||||
else root.dataset.theme = name;
|
||||
}
|
||||
|
||||
/** Paint what this browser stores (index.html's job at page load). */
|
||||
export function applyStoredTheme(): void {
|
||||
const [, resolved, dark, light] = getSnapshot().split("|") as [ThemeMode, Theme, string, string];
|
||||
apply(resolved, resolved === "dark" ? dark : light);
|
||||
}
|
||||
|
||||
/** The login page: the OS's light/dark in the stock palette. */
|
||||
export function applySystemTheme(): void {
|
||||
apply(systemQuery()?.matches === false ? "light" : "dark", "default");
|
||||
}
|
||||
|
||||
/**
|
||||
* Read/write the dashboard's appearance.
|
||||
* @returns `theme` — the RESOLVED mode (`system` already answered); `mode` — what
|
||||
|
||||
Reference in New Issue
Block a user