Skip to content

Integrate new AI assistant#3757

Merged
paultranvan merged 7 commits into
masterfrom
update-for-assistant
Jul 7, 2026
Merged

Integrate new AI assistant#3757
paultranvan merged 7 commits into
masterfrom
update-for-assistant

Conversation

@paultranvan

@paultranvan paultranvan commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

This is the equivalent of linagora/cozy-home#2351

Summary by CodeRabbit

  • New Features
    • Added a dedicated AI assistant page at assistant/:conversationId, with a new assistant layout, realtime updates for assistants/conversations, and a top bar featuring search.
    • Introduced assistant-specific UI styling (layout spacing and top bar divider).
  • Permissions
    • Updated AI assistant conversation permissions/verbs, added a new assistants permission, and refined realtime events permission text.
  • New Features
    • Added new document types for AI chat assistants and AI chat conversations.
  • Tests
    • Added Jest coverage to ensure assistant routing is mounted exactly once and avoids conflicting built-in navigation.
  • Chores
    • Improved Jest jsdom polyfills and updated development dependencies/mocks for test compatibility.

@coderabbitai

coderabbitai Bot commented Mar 23, 2026

Copy link
Copy Markdown

Review Change Stack

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4242e871-d7a3-4de5-9562-ee8a4fcba85e

📥 Commits

Reviewing files that changed from the base of the PR and between 9e9b224 and 86c66bc.

📒 Files selected for processing (6)
  • jestHelpers/setup.js
  • manifest.webapp
  • src/modules/navigation/AppRoute.jsx
  • src/modules/navigation/AppRoute.spec.jsx
  • src/modules/views/Assistant/AssistantLayout.jsx
  • src/modules/views/Assistant/assistant.styl
🚧 Files skipped from review as they are similar to previous changes (4)
  • manifest.webapp
  • src/modules/navigation/AppRoute.jsx
  • jestHelpers/setup.js
  • src/modules/navigation/AppRoute.spec.jsx

Walkthrough

The PR adds AI Assistant support across runtime setup, data contracts, permissions, dependency versions, and routing. It introduces assistant-related doctypes and manifest permissions, updates Jest globals and mocks for browser APIs and assistant components, adds a dedicated assistant/:conversationId route with a new AssistantLayout, and filters conflicting cozy-bar routes. A new test checks the assistant route path.

Suggested reviewers: doubleface, rezk2ll, JF-Cozy

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the PR’s main change: integrating a new AI assistant.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-for-assistant

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@paultranvan
paultranvan force-pushed the update-for-assistant branch from fe008cf to 356cfef Compare March 23, 2026 16:52
codescene-delta-analysis[bot]

This comment was marked as outdated.

@paultranvan
paultranvan force-pushed the update-for-assistant branch from 356cfef to f36c564 Compare March 23, 2026 17:04
codescene-delta-analysis[bot]

This comment was marked as outdated.

@bundlemon

bundlemon Bot commented Mar 23, 2026

Copy link
Copy Markdown

BundleMon

Files updated (9)
Status Path Size Limits
static/js/main.(hash).js
55.72KB (+598B +1.06%) -
static/css/cozy.(hash).css
29.85KB (+359B +1.19%) -
static/js/public.(hash).js
26.19KB (+311B +1.17%) -
static/css/main.(hash).css
11.98KB (+100B +0.82%) -
services/qualificationMigration.js
283.47KB (+73B +0.03%) -
services/dacc.js
263.22KB (+67B +0.02%) -
static/js/intents.(hash).js
7.04KB (+60B +0.84%) -
manifest.webapp
6.02KB (+57B +0.93%) -
static/js/cozy.(hash).js
973.68KB (-1.17KB -0.12%) -
Unchanged files (11)
Status Path Size Limits
static/resource/(hash).js
336.09KB -
static/js/(chunkId).(hash).js
59.9KB -
static/js/lib-react.(hash).js
43.88KB -
static/js/lib-polyfill.(hash).js
22.75KB -
static/js/lib-router.(hash).js
21.86KB -
static/js/async/(chunkId).(hash).js
7.5KB -
index.html
772B -
public/index.html
703B -
intents/index.html
619B -
static/css/public.(hash).css
331B -
assets/manifest.json
185B -

Total files change +420B +0.02%

Groups updated (2)
Status Path Size Limits
**/*.css
70.88KB (+459B +0.64%) -
**/*.js
6.17MB (-366B -0.01%) -
Unchanged groups (1)
Status Path Size Limits
**/*.{png,svg,ico}
2.16MB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@paultranvan
paultranvan force-pushed the update-for-assistant branch from f36c564 to ff5734b Compare March 24, 2026 08:00
codescene-delta-analysis[bot]

This comment was marked as outdated.

@paultranvan
paultranvan force-pushed the update-for-assistant branch from ff5734b to eb38118 Compare March 24, 2026 08:12
codescene-delta-analysis[bot]

This comment was marked as outdated.

@paultranvan
paultranvan force-pushed the update-for-assistant branch from eb38118 to 8aea7ad Compare March 24, 2026 08:14
@paultranvan paultranvan changed the title Update for assistant Integrate new AI assistant Mar 24, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

@paultranvan
paultranvan force-pushed the update-for-assistant branch from 8aea7ad to e27d0f8 Compare March 24, 2026 08:41
codescene-delta-analysis[bot]

This comment was marked as outdated.

@paultranvan
paultranvan force-pushed the update-for-assistant branch from e27d0f8 to 3df6b2e Compare March 24, 2026 16:36
codescene-delta-analysis[bot]

This comment was marked as outdated.

@paultranvan
paultranvan force-pushed the update-for-assistant branch from 3df6b2e to b9802b4 Compare March 24, 2026 16:39
codescene-delta-analysis[bot]

This comment was marked as outdated.

@paultranvan
paultranvan marked this pull request as ready for review March 24, 2026 16:41

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
src/modules/navigation/AppRoute.jsx (1)

58-60: Consider using a more robust route filtering approach.

The current filter relies on exact string matching of props.path. If BarRoutes elements don't consistently have a props.path property or if the path format changes, this could silently fail.

Consider extracting the path string to a constant for consistency:

♻️ Suggested improvement
+const ASSISTANT_ROUTE_PATH = 'assistant/:conversationId'
+
 const filteredBarRoutes = BarRoutes.filter(
-  r => r.props?.path !== 'assistant/:conversationId'
+  r => r.props?.path !== ASSISTANT_ROUTE_PATH
 )

Then reuse the constant in line 84:

-    <Route path="assistant/:conversationId" element={<AssistantLayout />} />
+    <Route path={ASSISTANT_ROUTE_PATH} element={<AssistantLayout />} />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/modules/navigation/AppRoute.jsx` around lines 58 - 60, The filter on
BarRoutes using r.props?.path !== 'assistant/:conversationId' is brittle;
extract the path string into a shared constant (e.g.,
ASSISTANT_CONVERSATION_PATH) and use that constant when filtering and elsewhere
(referenced in filteredBarRoutes and any other uses around line ~84) and
defensively handle missing path values by coercing to a string or using optional
chaining (e.g., const path = r.props?.path ?? '') before comparison so the
filter won't silently fail if props or path are absent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@jestHelpers/setup.js`:
- Line 7: Replace the minimal stubbed Response class (global.Response = class
Response {}) with a full fetch/Response polyfill; either import and invoke the
existing whatwg-fetch or undici fetch polyfill in jestHelpers/setup.js so
global.Response (and associated properties/methods like ok, status, json, text,
body) are provided instead of the empty class, ensuring any code that uses
Response (e.g., assistant-stream) gets the expected behavior.

In `@manifest.webapp`:
- Around line 217-226: Replace the broad verbs ["ALL"] on the permissions
objects chatConversations and assistants with least-privilege verb lists that
match actual usage (e.g., only read/create/update verbs such as GET, POST,
PUT/PATCH) so DELETE is not implicitly granted; update the "verbs" arrays on the
chatConversations and assistants entries to the minimal set required by the
feature, and only retain "DELETE" if the code explicitly requires conversation
deletion.

In `@src/lib/doctypes.js`:
- Around line 38-47: Replace the hardcoded doctype string in the
conversations.relationships.assistant block with the DOCTYPE_AI_CHAT_ASSISTANTS
constant: locate the conversations object (symbol DOCTYPE_AI_CHAT_CONVERSATIONS)
and update the assistant.relationships.type value that currently reads
'io.cozy.ai.chat.assistants' to reference DOCTYPE_AI_CHAT_ASSISTANTS so the
module uses the defined constant rather than a literal string.
- Around line 14-15: Add a schema entry for the assistants doctype so
cozy-client can normalize/cache assistant docs: create a schema object keyed by
DOCTYPE_AI_CHAT_ASSISTANTS (the same constant exported alongside
DOCTYPE_AI_CHAT_CONVERSATIONS) mirroring the pattern used for the conversations
schema (include id, relationships, and any necessary attributes) so
RealTimeQueries/AssistantLayout.jsx subscriptions and the conversations schema
relationship target are properly recognized and normalized by cozy-client.

In `@src/modules/views/Assistant/AssistantLayout.jsx`:
- Around line 16-36: AssistantLayout is not reading the route parameter
conversationId defined on the route; update AssistantLayout to import and call
useParams() to extract conversationId and pass it into <AssistantView
conversationId={conversationId} /> (or, if the route param is unnecessary,
remove conversationId from the route instead); specifically modify the
AssistantLayout function to const { conversationId } = useParams() and forward
that value to the AssistantView component (or coordinate route change if you
choose to remove the param).

---

Nitpick comments:
In `@src/modules/navigation/AppRoute.jsx`:
- Around line 58-60: The filter on BarRoutes using r.props?.path !==
'assistant/:conversationId' is brittle; extract the path string into a shared
constant (e.g., ASSISTANT_CONVERSATION_PATH) and use that constant when
filtering and elsewhere (referenced in filteredBarRoutes and any other uses
around line ~84) and defensively handle missing path values by coercing to a
string or using optional chaining (e.g., const path = r.props?.path ?? '')
before comparison so the filter won't silently fail if props or path are absent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d7127f15-5512-4d82-b30e-363abd05b8f5

📥 Commits

Reviewing files that changed from the base of the PR and between 21acc85 and b9802b4.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (7)
  • jestHelpers/setup.js
  • manifest.webapp
  • package.json
  • src/lib/doctypes.js
  • src/modules/navigation/AppRoute.jsx
  • src/modules/views/Assistant/AssistantLayout.jsx
  • src/modules/views/Assistant/assistant.styl

Comment thread jestHelpers/setup.js Outdated
Comment thread manifest.webapp
Comment on lines 217 to 226
"chatConversations": {
"description": "Required by the cozy Assistant",
"description": "Required by the AI Assistant to show conversations",
"type": "io.cozy.ai.chat.conversations",
"verbs": ["GET", "POST"]
"verbs": ["ALL"]
},
"assistants": {
"type": "io.cozy.ai.chat.assistants",
"verbs": ["ALL"],
"description": "Required to fetch, create and update AI assistants"
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Consider using least-privilege permissions instead of ["ALL"].

Both chatConversations and assistants permissions now use ["ALL"] verbs, which includes DELETE. Following the principle of least privilege, specify only the verbs actually needed by the feature.

If the assistant only needs to read, create, and update:

🛡️ Suggested restriction
     "chatConversations": {
       "description": "Required by the AI Assistant to show conversations",
       "type": "io.cozy.ai.chat.conversations",
-      "verbs": ["ALL"]
+      "verbs": ["GET", "POST", "PUT", "PATCH"]
     },
     "assistants": {
       "type": "io.cozy.ai.chat.assistants",
-      "verbs": ["ALL"],
+      "verbs": ["GET", "POST", "PUT", "PATCH"],
       "description": "Required to fetch, create and update AI assistants"
     },

If DELETE is genuinely required (e.g., for clearing conversation history), the current configuration is acceptable.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@manifest.webapp` around lines 217 - 226, Replace the broad verbs ["ALL"] on
the permissions objects chatConversations and assistants with least-privilege
verb lists that match actual usage (e.g., only read/create/update verbs such as
GET, POST, PUT/PATCH) so DELETE is not implicitly granted; update the "verbs"
arrays on the chatConversations and assistants entries to the minimal set
required by the feature, and only retain "DELETE" if the code explicitly
requires conversation deletion.

Comment thread src/lib/doctypes.js
Comment thread src/lib/doctypes.js
Comment on lines +16 to +36
const AssistantLayout = () => {
return (
<LayoutUI monoColumn>
<RealTimeQueries doctype={DOCTYPE_AI_CHAT_CONVERSATIONS} />
<RealTimeQueries doctype={DOCTYPE_AI_CHAT_ASSISTANTS} />
<BarComponent
searchOptions={{ enabled: true }}
appSlug="assistant"
disableInternalStore
componentsProps={{
Wrapper: {
className: cx('u-elevation-0', styles['assistant-topbar-border'])
}
}}
/>
<main className={styles['assistant-view']}>
<AssistantView />
</main>
</LayoutUI>
)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if AssistantView expects a conversationId prop or uses useParams internally
rg -n --type=js 'AssistantView' -A 10 -B 2
# Check cozy-search for AssistantView props
ast-grep --pattern 'export $_ AssistantView'

Repository: linagora/twake-drive

Length of output: 1702


🏁 Script executed:

# Find router/route configuration files
fd -type f -name "*route*" -o -name "*router*" | head -20

Repository: linagora/twake-drive

Length of output: 234


🏁 Script executed:

# Search for conversationId usage in the codebase
rg -n "conversationId" --type=js | head -20

Repository: linagora/twake-drive

Length of output: 271


🏁 Script executed:

# Search for useParams usage in Assistant-related files
rg -n "useParams" --type=js | grep -i assistant

Repository: linagora/twake-drive

Length of output: 46


🏁 Script executed:

# Check the file structure around AssistantLayout for route configuration
rg -n "assistant/:conversationId\|:/conversationId" --type=js

Repository: linagora/twake-drive

Length of output: 46


🏁 Script executed:

# Search for conversationId usage more carefully
rg "conversationId" -n

Repository: linagora/twake-drive

Length of output: 271


🏁 Script executed:

# Check the full AssistantLayout.jsx file
cat src/modules/views/Assistant/AssistantLayout.jsx

Repository: linagora/twake-drive

Length of output: 1072


🏁 Script executed:

# Look for any context providers or hooks that might handle conversationId
rg "useParams|useContext|useState.*conversation" -n --type jsx

Repository: linagora/twake-drive

Length of output: 91


🏁 Script executed:

# Check package.json for cozy-search version/documentation
rg "cozy-search" -n

Repository: linagora/twake-drive

Length of output: 374


🏁 Script executed:

# Look for other route patterns with parameters to see how they're handled
rg "useParams" -n

Repository: linagora/twake-drive

Length of output: 6074


🏁 Script executed:

# Check if there's any documentation or comments about AssistantView
rg -B3 -A3 "AssistantView" -n

Repository: linagora/twake-drive

Length of output: 1142


Extract conversationId from route parameters or remove the unused route parameter.

The route is defined as assistant/:conversationId, but AssistantLayout does not extract this parameter. All comparable route components in the codebase (FilesViewer, DriveFolderView, SharedDriveFolderView, etc.) consistently use useParams() to extract their route parameters. Either extract the parameter and pass it to AssistantView if needed, or remove it from the route definition.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/modules/views/Assistant/AssistantLayout.jsx` around lines 16 - 36,
AssistantLayout is not reading the route parameter conversationId defined on the
route; update AssistantLayout to import and call useParams() to extract
conversationId and pass it into <AssistantView conversationId={conversationId}
/> (or, if the route param is unnecessary, remove conversationId from the route
instead); specifically modify the AssistantLayout function to const {
conversationId } = useParams() and forward that value to the AssistantView
component (or coordinate route change if you choose to remove the param).


const filteredBarRoutes = BarRoutes.filter(
r => r.props?.path !== 'assistant/:conversationId'
)

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 we need to filter bar routes here?

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.

And why we did not have to do it in home? cc @lethemanh

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because the Bar exposes its own assistant route, coming from the time we used a Dialog to display the assistant inside Drive. So now we display the assistant in full layout inside Drive, we need to exclude Bar assistant routes to avoid conflict.

While Home does not use the Bar at all.

@zatteo
zatteo force-pushed the update-for-assistant branch from b9802b4 to 76acb67 Compare March 26, 2026 07:23
codescene-delta-analysis[bot]

This comment was marked as outdated.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/modules/navigation/AppRoute.jsx (1)

58-60: Consider adding a clarifying comment for the filtering logic.

The filtering prevents duplicate route definitions when BarRoutes from cozy-bar already includes the assistant route that's explicitly added at line 84. This addresses the question raised in previous reviews about why filtering is needed. A brief inline comment would help future maintainers understand the intent.

💡 Optional: Add clarifying comment
+// Filter out the assistant route from BarRoutes since it's explicitly defined above
+// to render outside the main Layout wrapper
 const filteredBarRoutes = BarRoutes.filter(
   r => r.props?.path !== 'assistant/:conversationId'
 )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/modules/navigation/AppRoute.jsx` around lines 58 - 60, Add a brief inline
comment above the filteredBarRoutes declaration explaining that BarRoutes may
include an 'assistant/:conversationId' route from cozy-bar and we filter it out
to avoid duplicate route definitions because the app adds the assistant route
explicitly elsewhere; reference the filteredBarRoutes constant and the path
'assistant/:conversationId' so future maintainers understand the intent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/modules/navigation/AppRoute.jsx`:
- Around line 58-60: Add a brief inline comment above the filteredBarRoutes
declaration explaining that BarRoutes may include an 'assistant/:conversationId'
route from cozy-bar and we filter it out to avoid duplicate route definitions
because the app adds the assistant route explicitly elsewhere; reference the
filteredBarRoutes constant and the path 'assistant/:conversationId' so future
maintainers understand the intent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 10e370cb-dd76-4ee6-8d06-18238c9a0bc8

📥 Commits

Reviewing files that changed from the base of the PR and between b9802b4 and 76acb67.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (7)
  • jestHelpers/setup.js
  • manifest.webapp
  • package.json
  • src/lib/doctypes.js
  • src/modules/navigation/AppRoute.jsx
  • src/modules/views/Assistant/AssistantLayout.jsx
  • src/modules/views/Assistant/assistant.styl
✅ Files skipped from review due to trivial changes (2)
  • package.json
  • src/lib/doctypes.js
🚧 Files skipped from review as they are similar to previous changes (3)
  • jestHelpers/setup.js
  • src/modules/views/Assistant/AssistantLayout.jsx
  • manifest.webapp

@zatteo

zatteo commented Mar 26, 2026

Copy link
Copy Markdown
Member

It display a white screen when we try to close it from the AI button in search bar.

@paultranvan
paultranvan force-pushed the update-for-assistant branch from 76acb67 to 5326a50 Compare July 6, 2026 15:50
codescene-delta-analysis[bot]

This comment was marked as outdated.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Line 109: Add a real integration/smoke test for the assistant route because
the current mock of cozy-search in jestHelpers/setup.js prevents the
AssistantLayout import of AiText and AssistantView from being exercised against
the actual v2 exports and prop contracts. Update or complement the existing test
setup so one test renders the assistant route using the real cozy-search
components, then verify the AssistantLayout path still mounts successfully with
the expected props and basic UI behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 86f36369-4c3e-47dc-8f9f-59555a3139df

📥 Commits

Reviewing files that changed from the base of the PR and between 76acb67 and 5326a50.

📒 Files selected for processing (6)
  • jestHelpers/setup.js
  • manifest.webapp
  • package.json
  • src/lib/doctypes.js
  • src/modules/navigation/AppRoute.jsx
  • src/modules/navigation/AppRoute.spec.jsx
✅ Files skipped from review due to trivial changes (1)
  • src/modules/navigation/AppRoute.spec.jsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/modules/navigation/AppRoute.jsx
  • manifest.webapp

Comment thread package.json Outdated
@paultranvan
paultranvan force-pushed the update-for-assistant branch from 5326a50 to b9802b4 Compare July 6, 2026 21:15
codescene-delta-analysis[bot]

This comment was marked as outdated.

@paultranvan
paultranvan force-pushed the update-for-assistant branch from b9802b4 to 5326a50 Compare July 6, 2026 21:18
codescene-delta-analysis[bot]

This comment was marked as outdated.

cozy-search 2.x is API-compatible with 0.25 (AiText/AssistantView are
unchanged); the majors only raised peer requirements, all already
satisfied by Drive. Jest gets Web Streams and a real undici Response
because assistant-stream builds Response objects around byte streams.
@paultranvan
paultranvan force-pushed the update-for-assistant branch from 5326a50 to 9e9b224 Compare July 6, 2026 21:32
codescene-delta-analysis[bot]

This comment was marked as outdated.

paultranvan and others added 5 commits July 7, 2026 09:57
Replace the appSlug="home" hack (which made the app switcher highlight
Home as current app) and the unsupported disableInternalStore prop with a
BarLeft link back to the Drive root, following cozy-home's pattern.
The jest mock now exports AssistantView/AiText used by AssistantLayout.
The new spec fails loudly if cozy-bar renames its internal assistant
route, which would otherwise silently break the BarRoutes filter.
@paultranvan
paultranvan force-pushed the update-for-assistant branch from 9e9b224 to 86c66bc Compare July 7, 2026 08:04

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gates Failed
Prevent hotspot decline (1 hotspot with Large Method)

Our agent can fix these. Install it.

Gates Passed
2 Quality Gates Passed

Reason for failure
Prevent hotspot decline Violations Code Health Impact
AppRoute.jsx 1 rule in this hotspot 9.22 → 9.21 Suppress

See analysis details in CodeScene

Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

Comment on lines +147 to +150
<Route element={<AssistantLayout />}>
<Route path={ASSISTANT_ROUTE_PATH} element={<AssistantView />} />
</Route>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

❌ Getting worse: Large Method
AppRoute increases from 142 to 145 lines of code, threshold = 120

Suppress

@paultranvan

Copy link
Copy Markdown
Contributor Author

It display a white screen when we try to close it from the AI button in search bar.

Good catch, the path was incorrect in this case, I fixed it: https://github.com/linagora/twake-drive/pull/3757/changes#diff-077ae2905e9d891fd0fc4b5e640117787bca634f1b215602c2dcb7399de06c47R147

@paultranvan
paultranvan merged commit 24d036f into master Jul 7, 2026
6 of 7 checks passed
@paultranvan
paultranvan deleted the update-for-assistant branch July 7, 2026 15:15
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.

3 participants