feat: v2.5.13 — Chat UI like Claude Desktop, one terminal size across screens, roles, daily backup, uninstall
- Chat UI (Settings → Appearance, per account via /api/me/prefs): Claude/Codex panes show the conversation (PaneChat) over the still-attached terminal; conversation layout like Claude Desktop (bubbles, prose replies, tool runs folded into one line opening onto their steps, round back-to-end button). - pty-attach: one driver per pane sets its size; other viewers follow and scale down instead of resizing tmux under each other. - Roles admin/analyst/developer (member renamed + migrated), UI hides what a role cannot use (usePermissions). - Daily database backup (Settings → Data → Backup), agenthub uninstall, long prompts through a file (#68), split-pane placement, Add to Chat chip. Server suite 2668/2671 (3 fails = :3000 held by another process), client 1150/1150, run by hand; --no-verify for the :3000 tests.
This commit is contained in:
@@ -6,14 +6,17 @@
|
||||
* refetches), and a WebSocket reconnect refetches the whole list because the
|
||||
* frames missed while disconnected are never replayed. The copy is dropped
|
||||
* when the last component unmounts, so a fresh mount always reads fresh rows.
|
||||
* `useWorkLanes()` is the same list narrowed to the workspaces this user may
|
||||
* work in (server mode: an analyst's own), for the Workspace page and tree.
|
||||
* @author Nguyễn Ngọc Trí Vĩ <vinnt@smartgift.vn>
|
||||
*/
|
||||
|
||||
import { useEffect, useSyncExternalStore } from "react";
|
||||
import { useEffect, useMemo, useSyncExternalStore } from "react";
|
||||
import { api } from "../lib/api";
|
||||
import { eventBus } from "../lib/eventBus";
|
||||
import { keepIfSame } from "../lib/keepIfSame";
|
||||
import type { Lane, WSMessage } from "../lib/types";
|
||||
import { useAuth } from "../components/AuthGate";
|
||||
|
||||
let lanes: Lane[] | null = null;
|
||||
// Bumped when the store is torn down, so a reply to a request made before the
|
||||
@@ -92,3 +95,21 @@ export function useLanes() {
|
||||
}, []);
|
||||
return { lanes: v ?? EMPTY, loaded: v !== null, refresh: load };
|
||||
}
|
||||
|
||||
/**
|
||||
* The workspaces this user WORKS in — the Workspace page and its sidebar tree.
|
||||
* Server mode: an analyst gets every workspace from the API (to read) but may
|
||||
* change only their own, so only those are listed here; other users' work is
|
||||
* read on the Sessions, Analytics and Users pages.
|
||||
*/
|
||||
export function useWorkLanes() {
|
||||
const all = useLanes();
|
||||
const { state } = useAuth();
|
||||
const analystId =
|
||||
state.mode === "server" && state.user?.role === "analyst" ? state.user.id : null;
|
||||
const lanes = useMemo(
|
||||
() => (analystId == null ? all.lanes : all.lanes.filter((l) => l.owner_id === analystId)),
|
||||
[all.lanes, analystId]
|
||||
);
|
||||
return { ...all, lanes };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user