Skip to content

Improvement/frontend#463

Merged
Zochory merged 14 commits intomainfrom
improvement/frontend
Dec 22, 2025
Merged

Improvement/frontend#463
Zochory merged 14 commits intomainfrom
improvement/frontend

Conversation

@Zochory
Copy link
Member

@Zochory Zochory commented Dec 20, 2025

restructure frontend architecture with pages/stores pattern

  • Move chatStore to top-level stores/ directory
  • Add pages/ directory with ChatPage and DashboardPage
  • Create root/App.tsx as main entry point
  • Extract workflow utilities to components/workflow/utils.ts
  • Add WorkflowRequestResponder component
  • Add new hooks: use-mobile, use-prompt-input, use-sidebar
  • Split CSS into modular files (animations, sidebar, theme)
  • Update tests for new import paths
  • Add comprehensive test utilities (factories, render helpers)
  • Add new component tests for chat-messages, prompt-input, chain-of-thought
  • Clean up deprecated features/chat and features/dashboard directories
  • Update optimization API tests for new endpoints"

…es pattern

- Move chatStore to top-level stores/ directory
- Add pages/ directory with ChatPage and DashboardPage
- Create root/App.tsx as main entry point
- Extract workflow utilities to components/workflow/utils.ts
- Add WorkflowRequestResponder component
- Add new hooks: use-mobile, use-prompt-input, use-sidebar
- Split CSS into modular files (animations, sidebar, theme)
- Update tests for new import paths
- Add comprehensive test utilities (factories, render helpers)
- Add new component tests for chat-messages, prompt-input, chain-of-thought
- Clean up deprecated features/chat and features/dashboard directories
- Update optimization API tests for new endpoints
@Zochory Zochory added this to the v0.6.96 milestone Dec 20, 2025
Copilot AI review requested due to automatic review settings December 20, 2025 05:11
@github-project-automation github-project-automation bot moved this to Backlog in AgenticFleet Dec 20, 2025
@github-actions github-actions bot added area: config Configuration system type: documentation Improvements or additions to documentation github-actions GitHub Actions workflow changes labels Dec 20, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 20, 2025

Dependency Review

The following issues were found:

  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 3 package(s) with unknown licenses.
  • ⚠️ 35 packages with OpenSSF Scorecard issues.

View full job summary

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 20, 2025

Caution

Review failed

Failed to post review comments

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • New sidebar with paginated conversations and a right-side panel for workflow/trace details.
    • Chat input controls: execution mode selector and toggles for GEPA, trace, and raw reasoning.
    • Live streaming text renderer and improved markdown/code rendering.
  • Improvements

    • Optimization/self‑improvement unified into job-based flows with updated UI status handling.
    • Concurrent-execution detection with a clear terminate action and refined UX feedback.
  • Documentation & Tests

    • Expanded testing utilities and updated developer docs for frontend workflows.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Reorganizes the frontend into component-centric modules, consolidates self-improvement into an /optimization/jobs flow, introduces a provider-based Sidebar and new Chat/Dashboard pages, replaces markdown rendering with Streamdown and adds streaming UI/hooks, expands tests and test utilities, and adds design-system CSS and workflow/docs.

Changes

Cohort / File(s) Summary
Workflow & Docs
​.github/workflows/q.md, .fleet/AgenticFleet_Synthesis.md, .fleet/technical.md, CLAUDE.md, src/frontend/AGENTS.md
Adds agentic workflow optimizer spec and AgenticFleet whitepapers; updates frontend architecture and development guidance.
Repo config & CI
.gitignore, .codex/config.toml, .github/workflows/ci-doctor*.yml/md, src/frontend/biome.json, src/frontend/vite.config.ts
Adds ignore patterns and Codex config, BIOME file, CI pre-check steps, and tailwind plugin integration in Vite.
API surface & types
src/frontend/src/api/* (client.ts, hooks.ts, index.ts, types.ts)
Consolidates self-improvement into optimization jobs (/optimization/jobs), updates request/result shapes, removes useTriggerSelfImprove, and adds conversation list params.
Deps & manifests
src/frontend/package.json, src/frontend/components.json
Updates versions, adds streamdown dependency and registers new component registry.
App entry & routing
src/frontend/src/main.tsx, src/frontend/src/root/App.tsx, src/frontend/src/app/App.tsx
Moves App implementation to src/root, mounts SidebarProvider, and routes between ChatPage and DashboardPage; deletes old App.
Pages
src/frontend/src/pages/* (chat-page.tsx, dashboard-page.tsx, index.ts)
Adds ChatPage and DashboardPage and re-exports pages.
Chat UI: components & barrels
src/frontend/src/components/chat/*, .../chat/index.ts
Adds ChatInputArea, ChatInputControls, ExecutionModeSelector, ToggleButton, ConcurrentErrorAlert; centralizes chat exports; tweaks ChatMessages rendering and copy behavior.
Layout & sidebar
src/frontend/src/components/layout/*, src/frontend/src/components/ui/sidebar.tsx, src/frontend/src/hooks/use-sidebar.ts, src/frontend/src/hooks/index.ts
Adds ChatHeader, SidebarLeft/Right, RightPanel; replaces sidebar with provider-based system, cookie persistence, keyboard shortcut, and exposes useSidebar.
Prompt input & hooks
src/frontend/src/components/chat/prompt-input.tsx, src/frontend/src/hooks/use-prompt-input.ts
Moves prompt input state to a hook/context pair and syncs controlled/uncontrolled values.
UI primitives & variants
src/frontend/src/components/ui/* (button, button-variants, input, separator, sheet, tooltip, alert, index, skeleton, etc.)
Extracts buttonVariants, converts components to forwardRef, simplifies tooltip primitives, reorganizes sheet exports, adds Alert and other primitives, expands UI barrel.
Streaming & rendering utilities
src/frontend/src/components/ui/response-stream.tsx, src/frontend/src/components/ui/markdown.tsx, src/frontend/src/components/message/markdown.tsx, src/frontend/src/components/message/reasoning.tsx
Adds useTextStream/ResponseStream, introduces Streamdown-based Markdown, and provides backward-compatible reasoning re-exports.
Message & code block changes
src/frontend/src/components/message/code-block.tsx, src/frontend/src/components/message/message.tsx
Adds copy timeout cleanup in code blocks; warns when markdown mode receives non-string children.
Store changes
src/frontend/src/stores/chatStore.ts
Adds pagination (conversationsOffset, hasMore), loadMoreConversations, concurrent-error detection, enhanced streaming event handling and logging.
Feature removal / reorg
src/frontend/src/features/** (chat, dashboard feature barrels)
Removes legacy feature-based components and re-exports in favor of the new component-centered structure.
Styling & theme
src/frontend/src/index.css, src/frontend/src/styles/* (theme.css, animations.css, sidebar.css, variables-semantic.css)
Reworks CSS into modular design-system imports, adds theme tokens and animations, and tweaks semantic variables.
Testing: utils & suites
src/frontend/TESTING.md, src/frontend/src/tests/utils/*, src/frontend/src/tests/**/*
Adds TESTING.md, test factories, render helpers, many new/updated tests (components, pages, API, SSE, markdown, reasoning).
Small UI tweaks & fixes
assorted small files (chat-container, chat-messages, scroll-button, etc.)
Minor style/import adjustments, content-stringification and copy fixes, and refactorings (forwardRef, default props).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ChatPage
    participant SidebarProvider
    participant ChatContent
    participant ChatStore
    participant API
    participant RightPanel

    User->>ChatPage: Open page (mount)
    ChatPage->>SidebarProvider: Wrap UI
    ChatPage->>ChatStore: loadConversations(reset=true)
    ChatStore->>API: GET /conversations?limit=25&offset=0
    API-->>ChatStore: conversations[]
    ChatStore-->>ChatPage: state updated

    User->>ChatContent: Submit message
    ChatContent->>ChatStore: sendMessage()
    ChatStore->>API: POST /messages (streaming/SSE)
    API-->>ChatStore: SSE/stream events (reasoning/log/delta)
    loop stream events
        ChatStore->>ChatStore: merge delta, attach workflowPhase/steps
        ChatStore-->>ChatContent: new assistant content
        ChatContent->>RightPanel: provide latest message for trace view
    end

    User->>RightPanel: Toggle open/close
    RightPanel-->>ChatPage: reflect open state
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Areas needing focused review:

  • API/type changes and removal of self-improve paths (src/frontend/src/api/*)
  • Chat store pagination, streaming event handling, and concurrent-error logic (src/frontend/src/stores/chatStore.ts)
  • Sidebar provider, persistence, and keyboard shortcut interactions (src/frontend/src/components/ui/sidebar.tsx, src/frontend/src/hooks/use-sidebar.ts)
  • Streamdown markdown integration, ResponseStream behavior, and rendering performance (src/frontend/src/components/*/markdown.tsx, src/frontend/src/components/ui/response-stream.tsx)
  • Import/path migrations, barrels and re-exports, and feature → component reorg (many src/frontend/src/* files)
  • Test changes aligning mocks and new providers (tests under src/frontend/src/tests/**)

Possibly related PRs

"I hopped through lines of code and dirt,
Pushed tiny carrots into docs and skirt,
New panels, streams, and tests to munch —
A jittery tail, a celebratory crunch 🥕
— your rabbit reviewer, bounding with a cluck!"

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Improvement/frontend' is vague and generic, using a non-descriptive prefix that doesn't convey the actual nature of the changeset. Provide a more specific title that captures the main change, such as 'Refactor frontend architecture to pages/stores pattern' or 'Restructure frontend with page and store organization'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description covers key changes but lacks several required template sections including explicit Type of Change, Related Issues link, and detailed Testing/Documentation checklists completion.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch improvement/frontend

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Zochory, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant overhaul of the frontend architecture, transitioning to a more scalable and maintainable 'pages/stores' pattern. The changes involve a comprehensive reorganization of directories, refactoring of UI components and hooks, and updates to API interactions and state management. The goal is to streamline development, improve code clarity, and enhance the overall user experience through a more robust and modular design. This foundational work sets the stage for future feature development and easier maintenance.

Highlights

  • Frontend Architecture Restructuring: The frontend has been significantly reorganized from a feature-based structure to a 'pages/stores' pattern, centralizing common components and separating page-level logic.
  • New Directory Structure: Introduced new pages/ and root/ directories, with ChatPage and DashboardPage as main views and App.tsx as the primary entry point. Existing feature-specific directories (features/chat, features/dashboard) have been cleaned up.
  • Component and Hook Refactoring: Many UI components (e.g., ChatContainer, ChatMessages, PromptInput, ChainOfThoughtTrace) have been moved and reorganized into new components/chat and components/workflow directories. New hooks (use-mobile, use-prompt-input, use-sidebar) have been added to support modularity.
  • API and State Management Updates: The optimizationApi endpoints have been updated, and the improvementApi has been deprecated, consolidating self-improvement logic. The chatStore now supports conversation pagination and includes state for handling concurrent execution errors.
  • Enhanced UI Components: New UI components like ChatInputArea, ChatInputControls, ExecutionModeSelector, ToggleButton, ConcurrentErrorAlert, ChatHeader, SidebarLeft, SidebarRight, and RightPanel have been added or significantly refactored, along with updates to core UI elements like Button, Input, Separator, Sheet, and Tooltip.
  • Improved Testing Infrastructure: The testing suite has been expanded with comprehensive test utilities (factories, render helpers) and new component tests for chat-messages, prompt-input, and chain-of-thought, ensuring better coverage for the new architecture.
  • Modular CSS Styling: CSS has been split into modular files (animations.css, sidebar.css, theme.css) for better organization and maintainability, replacing a monolithic index.css.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/q.lock.yml
    • .github/workflows/q.md
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restructures the frontend architecture from a feature-based structure to a pages/stores pattern with improved separation of concerns.

Key Changes

  • Reorganizes code from features/ to domain-organized components/, pages/, and top-level stores/
  • Splits CSS into modular files (animations.css, sidebar.css, theme.css)
  • Updates optimization API endpoints from /optimize to /optimization/jobs
  • Adds pagination support for conversations with infinite scroll
  • Adds comprehensive test utilities and new component tests
  • Implements concurrent execution error handling

Reviewed changes

Copilot reviewed 70 out of 83 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
src/frontend/tsconfig.app.json Removes baseUrl configuration (potential path resolution issue)
src/frontend/src/tests/utils/render.tsx Adds test rendering utilities with provider wrappers
src/frontend/src/tests/utils/factories.ts Adds mock data factories for testing
src/frontend/src/tests/pages/*.test.tsx New page-level tests for ChatPage and DashboardPage
src/frontend/src/tests/components/**/*.test.tsx New component tests with updated import paths
src/frontend/src/root/App.tsx New app entry point with view routing
src/frontend/src/pages/*.tsx New page components (ChatPage, DashboardPage)
src/frontend/src/stores/chatStore.ts Adds pagination and concurrent error handling
src/frontend/src/hooks/*.ts New custom hooks (use-mobile, use-prompt-input, use-sidebar)
src/frontend/src/components/**/*.tsx Reorganized components by domain
src/frontend/src/styles/*.css Split into modular CSS files
src/frontend/src/api/client.ts Updated optimization API endpoints
src/frontend/src/api/types.ts Updated OptimizationRequest and OptimizationResult types
src/frontend/package.json Dependency updates (@radix-ui/react-separator, shadcn)
Files not reviewed (1)
  • src/frontend/package-lock.json: Language not supported

Comment on lines +195 to +214
it("does not submit when loading", async () => {
mockChatStore.isLoading = true;
const user = userEvent.setup();
render(<ChatPage />);

const textarea = screen.getByPlaceholderText("Ask anything...");
await user.type(textarea, "Test message");

// When loading, the submit button should be disabled or replaced with stop button
// Check that sendMessage is not called
const buttons = screen.getAllByRole("button");
const submitButton = buttons.find((b) =>
b.textContent?.match(/send|submit/i),
);
if (submitButton) {
await user.click(submitButton);
}

expect(mockChatStore.sendMessage).not.toHaveBeenCalled();
});
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test title says "does not submit when loading" but the test doesn't actually verify that sendMessage is not called when isLoading is true. The test only checks for the absence of a submit button or that it doesn't call sendMessage, but the logic is unclear. Consider making the assertion more explicit by checking that the submit button is either disabled or missing when isLoading=true.

Copilot uses AI. Check for mistakes.
"skipLibCheck": true,
"noEmit": true,
"baseUrl": ".",
"paths": {
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing baseUrl while keeping paths configuration may cause path resolution issues. When using path aliases like @/*, TypeScript typically requires either baseUrl set to "." or the paths to be absolute. Consider keeping baseUrl: "." or verify that path resolution works correctly without it in your TypeScript version.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is an excellent and comprehensive refactoring of the frontend architecture. The move to a pages/stores pattern, organizing components by domain, and modularizing CSS and hooks significantly improves the codebase's structure, maintainability, and scalability. The updated API client, hooks, and types are consistent with the backend changes. The addition of extensive testing utilities, new component tests, and detailed documentation in TESTING.md and CLAUDE.md is a huge win for the project's quality and developer experience. I have one suggestion to improve type safety.

@coderabbitai coderabbitai bot added the type: test Test-related changes label Dec 20, 2025
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Zachary BENSALEM <zachary@qredence.ai>
Copilot AI review requested due to automatic review settings December 21, 2025 01:15
@github-project-automation github-project-automation bot moved this from Backlog to In review in AgenticFleet Dec 21, 2025
@github-actions github-actions bot removed the type: test Test-related changes label Dec 21, 2025
@Zochory
Copy link
Member Author

Zochory commented Dec 21, 2025

/q

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 84 out of 94 changed files in this pull request and generated 6 comments.

Files not reviewed (1)
  • src/frontend/package-lock.json: Language not supported

@Zochory
Copy link
Member Author

Zochory commented Dec 21, 2025

@copilot open a new pull request to apply changes based on the comments in this thread

Copilot AI review requested due to automatic review settings December 22, 2025 01:51
@github-actions github-actions bot removed dependencies Dependency updates type: test Test-related changes labels Dec 22, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 88 out of 97 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • src/frontend/package-lock.json: Language not supported

@coderabbitai coderabbitai bot added dependencies Dependency updates type: test Test-related changes labels Dec 22, 2025
@Zochory
Copy link
Member Author

Zochory commented Dec 22, 2025

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Dec 22, 2025

@Zochory I've opened a new pull request, #469, to work on those changes. Once the pull request is ready, I'll request review from you.

@Zochory Zochory modified the milestones: v0.6.96, v0.7.0 Dec 22, 2025
* Initial plan

* fix: address PR review comments - fix tests, typos, and config

Co-authored-by: Zochory <60674042+Zochory@users.noreply.github.com>

* chore: fix code formatting with Prettier

Co-authored-by: Zochory <60674042+Zochory@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Zochory <60674042+Zochory@users.noreply.github.com>
@github-actions github-actions bot removed dependencies Dependency updates type: test Test-related changes labels Dec 22, 2025
Copilot AI review requested due to automatic review settings December 22, 2025 02:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 87 out of 96 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • src/frontend/package-lock.json: Language not supported

- Added a step in the GitHub workflow to ensure the log directory and file are created, along with a listing of the directory contents.
- Modified several test cases in chat-page.test.tsx to remove async/await as they were not necessary, improving readability and performance.
Copilot AI review requested due to automatic review settings December 22, 2025 04:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 93 out of 101 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • src/frontend/package-lock.json: Language not supported

@Zochory Zochory merged commit 69cdd78 into main Dec 22, 2025
27 of 30 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in AgenticFleet Dec 22, 2025
@Zochory Zochory deleted the improvement/frontend branch December 22, 2025 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: config Configuration system github-actions GitHub Actions workflow changes type: documentation Improvements or additions to documentation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants