Commit Graph

23 Commits

Author SHA1 Message Date
Haileyesus
d30d64ce93 refactor(useFileMentions): implement abort controller for fetch requests 2026-02-12 23:47:07 +03:00
Haileyesus
022ac21369 refactor(chat): exclude currentSessionId from dependency array to prevent unnecessary reloading of messages 2026-02-12 23:47:06 +03:00
Haileyesus
3c6f353716 refactor(chat): improve message handling by cloning state updates and improving structured message parsing 2026-02-12 23:47:06 +03:00
Haileyesus
553c534f35 refactor(todo): update TodoListContentProps to include optional id and priority fields that are used in TodoList.jsx 2026-02-12 23:47:06 +03:00
Haileyesus
e435e70a6b fix(chat): handle potential null content in message before splitting lines 2026-02-12 23:47:06 +03:00
Haileyesus
0b6b33c3cc refactor(chat): replace localStorage provider retrieval with prop usage in MessageComponent 2026-02-12 23:47:06 +03:00
Haileyesus
844602a4fe fix(chat): handle JSON parsing errors for saved chat messages 2026-02-12 23:47:06 +03:00
Haileyesus
fc1ad17ba8 fix(chat): escape command name in regex to prevent unintended matches 2026-02-12 23:47:06 +03:00
simosmik
d99c581179 refactor(tools): improve Task tool display formatting
Update Task tool config to show cleaner subagent information in the UI.
Simplifies the input display by showing only the prompt when no
optional fields are present, reducing visual clutter. Updates title
format to "Subagent / {type}" for better categorization. Enhances
result display to better handle complex agent response structures with
array content types, extracting text blocks for cleaner presentation.
2026-02-12 23:47:06 +03:00
simosmik
b8d80fdab7 refactor(tools): add agent category for Task tool
Add visual distinction for the Task tool (subagent invocation) by
introducing a new 'agent' category with purple border styling. This
separates subagent tasks from regular task management tools
(TaskCreate, TaskUpdate, etc.) for clearer user feedback.

Also refactor terminal command layout in OneLineDisplay to properly
nest flex containers, fixing copy button alignment issues.
2026-02-12 23:47:06 +03:00
Haileyesus
720a771b2a feat(chat): move thinking modes, token usage pie, and related logic into chat folder 2026-02-12 23:47:06 +03:00
Haileyesus
189b1533b2 refactor: reorganize chat view components and types 2026-02-12 23:47:06 +03:00
Haileyesus
7f45540dbe refactor: Restructure files and folders to better mimic feature-based architecture 2026-02-12 23:47:06 +03:00
Haileyesus
79d7934a4b refactor: replace individual provider logos with a unified SessionProviderLogo component 2026-02-12 23:47:05 +03:00
simosmik
d8e7a9e944 refactor: update readme and remove unusedfiles. 2026-02-12 23:47:05 +03:00
simosmik
5f0676bdb3 refactor(improvement):add memo on diffviewer, cleanup messsagecomponent 2026-02-12 23:47:05 +03:00
simosmik
905ae38bf5 refactor(design): change the design of tools and introduce todo list and task list. 2026-02-12 23:47:05 +03:00
simosmik
56a132d34e refactor(design): fix bash design and config 2026-02-12 23:47:05 +03:00
simosmik
060405c8d6 refactor(design): change the design of bash 2026-02-12 23:47:05 +03:00
simosmik
cbe4bd9adf fix: remove one-line logic from messagecomponent 2026-02-12 23:47:05 +03:00
simosmik
f9bd56c20f refactor: tool components 2026-02-12 23:47:05 +03:00
simosmik
c95aa04c85 refactor: tool components 2026-02-12 23:47:05 +03:00
Haileyesus
1d8b70f614 refactor(chat): split monolithic chat interface into typed modules and hooks
Replace the legacy monolithic ChatInterface.jsx implementation with a modular TypeScript architecture centered around a small orchestration component (ChatInterface.tsx).

Core architecture changes:
- Remove src/components/ChatInterface.jsx and add src/components/ChatInterface.tsx as a thin coordinator that wires provider state, session state, realtime WebSocket handlers, and composer behavior via dedicated hooks.
- Update src/components/MainContent.tsx to use typed ChatInterface directly (remove AnyChatInterface cast).

State ownership and hook extraction:
- Add src/hooks/chat/useChatProviderState.ts to centralize provider/model/permission-mode state, provider/session synchronization, cursor model bootstrap from backend config, and pending permission request scoping.
- Add src/hooks/chat/useChatSessionState.ts to own chat/session lifecycle state: session loading, cursor/claude/codex history loading, pagination, scroll restoration, visible-window slicing, token budget loading, persisted chat hydration, and processing-state restoration.
- Add src/hooks/chat/useChatRealtimeHandlers.ts to isolate WebSocket event processing for Claude/Cursor/Codex, including session filtering, streaming chunk buffering, session-created/pending-session transitions, permission request queueing/cancellation, completion/error handling, and session status updates.
- Add src/hooks/chat/useChatComposerState.ts to own composer-local state and interactions: input/draft persistence, textarea sizing and keyboard behavior, slash command execution, file mentions, image attachment/drop/paste workflow, submit/abort flows, permission decision responses, and transcript insertion.

UI modularization under src/components/chat:
- Add view/ChatMessagesPane.tsx for message list rendering, loading/empty states, pagination affordances, and thinking indicator.
- Add view/ChatComposer.tsx for composer shell layout and input area composition.
- Add view/ChatInputControls.tsx for mode toggles, token display, command launcher, clear-input, and scroll-to-bottom controls.
- Add view/PermissionRequestsBanner.tsx for explicit tool-permission review actions (allow once / allow & remember / deny).
- Add view/ProviderSelectionEmptyState.tsx for provider and model selection UX plus task starter integration.
- Add messages/MessageComponent.tsx and markdown/Markdown.tsx to isolate message rendering concerns, markdown/code rendering, and rich tool-output presentation.
- Add input/ImageAttachment.tsx for attachment previews/removal/progress/error overlay rendering.

Shared chat typing and utilities:
- Add src/components/chat/types.ts with shared types for providers, permission mode, message/tool payloads, pending permission requests, and ChatInterfaceProps.
- Add src/components/chat/utils/chatFormatting.ts for html decoding, code fence normalization, regex escaping, math-safe unescaping, and usage-limit text formatting.
- Add src/components/chat/utils/chatPermissions.ts for permission rule derivation, suggestion generation, and grant flow.
- Add src/components/chat/utils/chatStorage.ts for resilient localStorage access, quota handling, and normalized Claude settings retrieval.
- Add src/components/chat/utils/messageTransforms.ts for session message normalization (Claude/Codex/Cursor) and cached diff computation utilities.

Command/file input ergonomics:
- Add src/hooks/chat/useSlashCommands.ts for slash command fetching, usage-based ranking, fuzzy filtering, keyboard navigation, and command history persistence.
- Add src/hooks/chat/useFileMentions.tsx for project file flattening, @mention suggestions, mention highlighting, and keyboard/file insertion behavior.

TypeScript support additions:
- Add src/types/react-syntax-highlighter.d.ts module declarations to type-check markdown code highlighting imports.

Behavioral intent:
- Preserve existing chat behavior and provider flows while improving readability, separation of concerns, and future refactorability.
- Move state closer to the components/hooks that own it, reducing cross-cutting concerns in the top-level chat component.
2026-02-12 23:45:45 +03:00