Skip to content

feat: Update to use new assistant ✨#2351

Merged
paultranvan merged 4 commits intomasterfrom
update-for-assistant
Mar 23, 2026
Merged

feat: Update to use new assistant ✨#2351
paultranvan merged 4 commits intomasterfrom
update-for-assistant

Conversation

@lethemanh
Copy link
Copy Markdown

@lethemanh lethemanh commented Feb 9, 2026

Needs:

linagora/cozy-libs#2925

linagora/cozy-libs#2937

cozy/cozy-ui#2902

Result:

Screen.Recording.2026-02-12.at.17.49.01.mov

Feature flags:

  • cozy.source-knowledge.enabled: Enable source knowledge.
  • cozy.search-conversation.enabled: Enable search conversation.
  • cozy.top-bar-in-assistant.enabled: Enable top bar in assistant view.

Summary by CodeRabbit

  • New Features

    • Added an assistant view with a route-driven full-height layout option.
  • UI/UX Improvements

    • Route-aware background, spacing, and elevation adjustments for assistant pages.
    • Hero/header hidden in assistant view; added topbar divider, small-screen layout tweaks, and full-height main-view styling.
  • Tests

    • Updated routing tests to use a hash-based router for assistant scenarios.
  • Chores

    • Removed an unused development dependency.

@lethemanh lethemanh self-assigned this Feb 9, 2026
@lethemanh lethemanh marked this pull request as draft February 9, 2026 03:46
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 9, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds an isFullHeight prop to MainView and conditionally applies the main-view--full-height modifier. App now detects an assistant route and feature flag to conditionally render AssistantView (or AssistantDialog), adjust layout and wrapper classes, toggle BackgroundContainer, hide HeroHeader, and pass isFullHeight to MainView. Styles add the .main-view--full-height modifier, a #coz-bar .topbar-border, and small-screen breakpoint rules. Tests wrap App with HashRouter. Removed devDependency git-directory-deploy.

Suggested reviewers

  • doubleface
  • JF-Cozy
  • zatteo
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: Update to use new assistant' is partially related to the changeset—it mentions the new assistant feature, but doesn't capture the main technical changes (new assistant view integration, conditional layouts, styling updates, and dependency removal).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-for-assistant

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/containers/App.jsx (1)

160-175: ⚠️ Potential issue | 🔴 Critical

Critical routing bug: AssistantView will not render due to missing <Outlet /> in the parent route's element.

In React Router v6, child routes render via the <Outlet /> component in the parent route's element. When isAssistantRoute is true, the /connected route's element evaluates to false (since !isAssistantRoute && <Home /> becomes false && <Home /> = false), so <Home> is never mounted. Since <Home> is the only component rendering the <Outlet /> for this route subtree, the nested assistant/:conversationId route's <AssistantView /> element has nowhere to render and will not display.

Restructure the route so the parent always renders an <Outlet />:

Suggested fix: render Outlet on assistant routes
 <Route
   path="/connected"
   element={
-    !isAssistantRoute && (
-      <Home
-        wrapper={contentWrapper}
-        shortcutsDirectories={shortcutsDirectories}
-      />
-    )
+    isAssistantRoute ? (
+      <Outlet />
+    ) : (
+      <Home
+        wrapper={contentWrapper}
+        shortcutsDirectories={shortcutsDirectories}
+      />
+    )
   }
 >

Import Outlet from react-router-dom.

🤖 Fix all issues with AI agents
In `@package.json`:
- Around line 34-35: The package.json currently lists dependencies
"@assistant-ui/react", "@radix-ui/react-slot", and "lucide-react" that have no
direct imports; either remove these entries or document why they remain (e.g.,
required peer/transitive deps for "cozy-search") by adding an inline comment in
package.json or README. Locate the dependency entries for "@assistant-ui/react",
"@radix-ui/react-slot", and "lucide-react" in package.json, confirm via a
repo-wide search that there are no direct imports, and if they are unnecessary
delete them from package.json and run npm/yarn install; if they are required as
peers/transitive dependencies, add a brief comment next to each dependency (or
in project docs) stating the owner package (e.g., "kept for cozy-search peer
deps") and why it must remain. Ensure package-lock.json / yarn.lock is updated
after the change.
🧹 Nitpick comments (2)
src/containers/App.jsx (2)

110-110: Consider a more robust route check.

pathname.startsWith('/connected/assistant/') requires a trailing slash, which means /connected/assistant (without trailing slash or conversation ID) won't match. If that's intentional, it's fine, but verify that this won't cause layout inconsistencies if users navigate to /connected/assistant without a conversation ID.


114-119: Template literal with ternary could use cx for consistency.

You're already importing and using cx elsewhere in this component. Consider using it here too for consistency.

Suggested change
-    <Layout
-      monoColumn
-      className={`${
-        isAssistantRoute ? 'u-bg-primaryBackgroundLight' : 'u-bg-white'
-      }`}
-    >
+    <Layout
+      monoColumn
+      className={cx({
+        'u-bg-primaryBackgroundLight': isAssistantRoute,
+        'u-bg-white': !isAssistantRoute
+      })}
+    >

Comment thread package.json Outdated
Comment thread package.json Outdated
@lethemanh lethemanh marked this pull request as ready for review February 11, 2026 08:58
@lethemanh lethemanh force-pushed the update-for-assistant branch from 368a7e9 to 619d870 Compare February 12, 2026 04:12
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/containers/App.jsx (1)

162-183: ⚠️ Potential issue | 🔴 Critical

Critical: /connected route prevents child route rendering when isNewAssistantView is true.

When isNewAssistantView is true, the /connected route's element evaluates to false (line 166). In React Router v6, a falsy element renders nothing and produces no <Outlet />. Since nested routes like assistant/:conversationId depend on the parent's <Outlet /> to render, they cannot mount in this state.

The Home component already imports and renders <Outlet />, but it's only rendered when isNewAssistantView is false. When true, child routes fail to render.

Render an <Outlet /> when the assistant view is active:

Proposed fix
               <Route
                  path="/connected"
                  element={
-                    !isNewAssistantView && (
+                    isNewAssistantView ? (
+                      <Outlet />
+                    ) : (
                       <Home
                         wrapper={contentWrapper}
                         shortcutsDirectories={shortcutsDirectories}
                       />
                     )
                   }
                 >

This requires importing Outlet from react-router-dom:

-import { Navigate, Route, useLocation } from 'react-router-dom'
+import { Navigate, Outlet, Route, useLocation } from 'react-router-dom'
🤖 Fix all issues with AI agents
In `@src/containers/App.spec.jsx`:
- Line 40: Prettier is failing because the mock functions defined for
useNavigate contain an extra space inside their empty function bodies (e.g., the
arrow mock useNavigate: () => () => { } ); update those to remove the inner
space so they are empty blocks without whitespace (e.g., change { } to {} ) for
the useNavigate mock instances found in App.spec.jsx (also apply the same change
to the other occurrences).
🧹 Nitpick comments (2)
src/containers/App.spec.jsx (1)

36-43: Note: mocking Routes but not Route may cause issues if the real Route interacts with the mocked Routes.

Routes is mocked as jest.fn() (returns undefined), so the entire route tree renders nothing. This is presumably intentional for these tests, but worth noting that these tests won't exercise any routing logic introduced in App.jsx. Consider adding dedicated tests for the assistant view route behavior if not covered elsewhere.

src/containers/App.jsx (1)

116-121: Template literal can be simplified.

The template literal wrapping a single ternary can be replaced with a plain ternary for readability.

Suggested simplification
-      className={`${
-        isNewAssistantView ? 'u-bg-primaryBackgroundLight' : 'u-bg-white'
-      }`}
+      className={isNewAssistantView ? 'u-bg-primaryBackgroundLight' : 'u-bg-white'}

Comment thread src/containers/App.spec.jsx Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/containers/App.jsx`:
- Around line 163-183: The parent Route for path "/connected" currently returns
false when isNewAssistantView is true, preventing its child routes (e.g., the
"assistant/:conversationId" route rendering AssistantView/AssistantDialog) from
mounting; update the element prop so that when isNewAssistantView is true you
still render a wrapper that includes an Outlet (instead of false) so child
routes can render — modify the element expression around Home (component name
Home) to conditionally render Home when !isNewAssistantView and otherwise render
a minimal wrapper component that imports and returns <Outlet /> (ensure Outlet
is imported from react-router-dom) so AssistantView and AssistantDialog can
mount.
🧹 Nitpick comments (1)
src/containers/App.jsx (1)

116-121: Nit: Consider using cx for consistency with the rest of the file.

You're already importing and using cx elsewhere. Using a template literal here is fine functionally, but cx would be more consistent.

Suggested change
     <Layout
       monoColumn
-      className={`${
-        isNewAssistantView ? 'u-bg-primaryBackgroundLight' : 'u-bg-white'
-      }`}
+      className={cx({
+        'u-bg-primaryBackgroundLight': isNewAssistantView,
+        'u-bg-white': !isNewAssistantView
+      })}
     >

Comment thread src/containers/App.jsx
Comment thread src/containers/App.jsx
>
<BarComponent
searchOptions={{ enabled: false }}
searchOptions={{ enabled: isNewAssistantView }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Keep false here. I think we will never want the search bar in home top bar.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

But I saw the search bar display in the figma, should we need a confirmation?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok right keep it like this

Comment thread src/containers/App.jsx
wrapper={contentWrapper}
shortcutsDirectories={shortcutsDirectories}
/>
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do you need to hide this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

If the Home did not hide, the assistant view will look like this

image

Comment thread src/containers/App.spec.jsx Outdated
@bundlemon
Copy link
Copy Markdown

bundlemon bot commented Mar 17, 2026

BundleMon

Files updated (12)
Status Path Size Limits
static/js/(chunkId).(hash).js
1.08MB (+97.29KB +9.69%) -
static/js/cozy.(hash).js
891.96KB (+2.41KB +0.27%) -
static/css/cozy.(hash).css
32.33KB (+956B +2.97%) -
services/cliskTimeout.js
259.79KB (+374B +0.14%) -
services/sourceAccountIdentifierNormalizer.js
260.34KB (+367B +0.14%) -
services/deleteAccounts.js
321.18KB (+360B +0.11%) -
services/updateAccounts.js
471.64KB (+340B +0.07%) -
services/sourceAccountIdentifierNormalizerHel
per.js
236.97KB (+293B +0.12%) -
services/softDeleteOrRestoreAccounts.js
472.84KB (+291B +0.06%) -
static/js/main.(hash).js
82.48KB (+214B +0.25%) -
services/myselfFromIdenties.js
236.78KB (+199B +0.08%) -
static/css/main.(hash).css
8.77KB (+152B +1.72%) -
Unchanged files (4)
Status Path Size Limits
services/polyfillFetch.js
97.16KB -
static/js/lib-react.(hash).js
43.88KB -
static/js/lib-router.(hash).js
26.7KB -
services/attributesHelpers.js
15.7KB -

Total files change +103.17KB +2.31%

Groups updated (3)
Status Path Size Limits
**/*.js
7.26MB (+95.42KB +1.3%) -
**/*.css
88.07KB (+1KB +1.15%) -
**/*.{png,svg,ico}
272.78KB (-4.09KB -1.48%) -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@lethemanh lethemanh force-pushed the update-for-assistant branch from dd379e5 to 290a3ae Compare March 18, 2026 12:35
@paultranvan paultranvan force-pushed the update-for-assistant branch from 38231fc to acfb047 Compare March 23, 2026 13:21
@paultranvan paultranvan merged commit 5f6aa64 into master Mar 23, 2026
5 checks passed
@paultranvan paultranvan deleted the update-for-assistant branch March 23, 2026 13:32
@coderabbitai coderabbitai bot mentioned this pull request Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants