batch4.1-5.1: dedup audit, archive 400 fix, sidebar Delete, landing-page enrichment, auto-name tool-call fix
- Fastify global empty-JSON-body parser fixes archive/unarchive/stop 400s - Removed redundant local sessionEvents.emit at all 5+2 sites with server-side WS publishers; added dedupe guards in useSidebar/Workspace/Project handlers - Sidebar session right-click adds Delete (destructive) with confirm Dialog - Session.tsx navigates away on session_deleted/session_archived for the active session - SessionLandingPage chat rows show message_count, effective_context_tokens, last_message_preview via LATERAL joins on GET /api/sessions/:id/chats - Workspace.tsx pane drag-to-reorder using native HTML5 events (no new deps) - CompactCard: Copy toast, Send-to-chat with target chat name, empty-state in share popover, Re-run button - auto_name.ts: filter count gate and assistant-fetch by content <> '' so tool-call assistant rows don't trip the once-and-only-once guard - Adds CLAUDE.md and apps/web/src/lib/format.ts Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -52,6 +52,7 @@ function load(): Promise<void> {
|
||||
function applyEvent(prev: SidebarResponse, event: import('./sessionEvents').SessionEvent): SidebarResponse {
|
||||
switch (event.type) {
|
||||
case 'project_created': {
|
||||
if (prev.projects.some((p) => p.id === event.project.id)) return prev;
|
||||
const fresh: SidebarProject = {
|
||||
id: event.project.id,
|
||||
name: event.project.name,
|
||||
@@ -69,6 +70,7 @@ function applyEvent(prev: SidebarResponse, event: import('./sessionEvents').Sess
|
||||
let changed = false;
|
||||
const projects = prev.projects.map((p) => {
|
||||
if (p.id !== event.project_id) return p;
|
||||
if (p.recent_sessions.some((s) => s.id === event.session.id)) return p;
|
||||
changed = true;
|
||||
const fresh: SidebarSession = {
|
||||
id: event.session.id,
|
||||
@@ -89,8 +91,10 @@ function applyEvent(prev: SidebarResponse, event: import('./sessionEvents').Sess
|
||||
let changed = false;
|
||||
const projects = prev.projects.map((p) => {
|
||||
if (p.id !== event.project_id) return p;
|
||||
changed = true;
|
||||
const recent = p.recent_sessions.filter((s) => s.id !== event.session_id);
|
||||
const wasPresent = recent.length !== p.recent_sessions.length;
|
||||
if (!wasPresent) return p;
|
||||
changed = true;
|
||||
return {
|
||||
...p,
|
||||
recent_sessions: recent,
|
||||
|
||||
Reference in New Issue
Block a user