Skip to content

Remove some flags that are not enabled by default#3772

Open
zatteo wants to merge 7 commits intomasterfrom
feat/remove-some-flags
Open

Remove some flags that are not enabled by default#3772
zatteo wants to merge 7 commits intomasterfrom
feat/remove-some-flags

Conversation

@zatteo
Copy link
Copy Markdown
Member

@zatteo zatteo commented Mar 30, 2026

Summary by CodeRabbit

  • New Features

    • Keyboard shortcuts enabled unconditionally
    • New-item highlighting always active
    • Folder personalization shown by default
    • Sort preferences saved automatically
    • Favicon updates applied when available
    • Health theme always listed
    • Click/selection behavior simplified for consistent item selection and interactions
  • Tests

    • Removed feature-flag mocking from tests to reflect always-on behaviors

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Walkthrough

This PR removes runtime feature-flag checks and related imports for multiple drive.* flags across hooks, components, providers, and tests. Flag-driven early returns and conditional branches were deleted so behaviors (keyboard shortcuts, new-item highlighting, save-sort persistence, double-click selection, favicon updates, folder personalization, icon decorations, scrolling to highlighted items, theme filtering, etc.) run unconditionally where previously gated. Tests and Jest mocks were simplified to remove cozy-flags control, and two flag registrations were removed from src/lib/flags.js.

Possibly related PRs

Suggested reviewers

  • lethemanh
  • JF-Cozy
  • doubleface
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove some flags that are not enabled by default' accurately describes the main change: removing feature flags (cozy-flags) that were not enabled by default across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ 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 feat/remove-some-flags

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.

codescene-delta-analysis[bot]

This comment was marked as 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.

Caution

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

⚠️ Outside diff range comments (1)
src/modules/views/Modal/QualifyFileView.jsx (1)

31-38: ⚠️ Potential issue | 🔴 Critical

Spread themesList to flatten the theme options array.

At line 37, themesList must be spread with ... to avoid creating a nested structure. Without spreading, themesWithNone becomes [noneTheme, themesList_array], and when the code iterates at line 41 and tries to access theme.items.map() at line 49, it will fail because the second element is an array without an items property.

Proposed fix
 const themesWithNone = [
   {
     id: 'none',
     items: [],
     label: t('Scan.none')
   },
-  themesList
+  ...themesList
 ]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/modules/views/Modal/QualifyFileView.jsx` around lines 31 - 38, The
themesWithNone array currently nests themesList as its second element causing
downstream code (e.g., iteration that accesses theme.items) to fail; change
construction of themesWithNone (where themesWithNone and themesList are defined)
to flatten themesList by using the spread operator so the array becomes
[noneTheme, ...themesList] instead of [noneTheme, themesList], ensuring each
element has an items property when iterating over themesWithNone.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/modules/views/Modal/QualifyFileView.jsx`:
- Around line 31-38: The themesWithNone array currently nests themesList as its
second element causing downstream code (e.g., iteration that accesses
theme.items) to fail; change construction of themesWithNone (where
themesWithNone and themesList are defined) to flatten themesList by using the
spread operator so the array becomes [noneTheme, ...themesList] instead of
[noneTheme, themesList], ensuring each element has an items property when
iterating over themesWithNone.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f0adc57d-5c00-423a-afb7-31b98966ceb0

📥 Commits

Reviewing files that changed from the base of the PR and between 7759304 and c490cd0.

📒 Files selected for processing (18)
  • jestHelpers/setup.js
  • src/hooks/useFolderSort/index.spec.jsx
  • src/hooks/useFolderSort/index.ts
  • src/hooks/useKeyboardShortcuts.spec.jsx
  • src/hooks/useKeyboardShortcuts.tsx
  • src/hooks/useOnLongPress/helpers.js
  • src/hooks/useUpdateFavicon/index.tsx
  • src/lib/flags.js
  • src/modules/actions/components/personalizeFolder.js
  • src/modules/drive/Toolbar/personalizeFolder/PersonalizeFolderItem.jsx
  • src/modules/filelist/icons/FileIconMime.jsx
  • src/modules/layout/Layout.jsx
  • src/modules/public/PublicLayout.jsx
  • src/modules/upload/NewItemHighlightProvider.jsx
  • src/modules/views/Folder/virtualized/useScrollToHighlightedItem.jsx
  • src/modules/views/Modal/QualifyFileView.jsx
  • src/modules/views/Public/PublicFolderView.jsx
  • test/components/AppLike.jsx
💤 Files with no reviewable changes (9)
  • src/lib/flags.js
  • src/modules/filelist/icons/FileIconMime.jsx
  • src/hooks/useKeyboardShortcuts.spec.jsx
  • src/modules/drive/Toolbar/personalizeFolder/PersonalizeFolderItem.jsx
  • src/hooks/useFolderSort/index.spec.jsx
  • src/modules/actions/components/personalizeFolder.js
  • src/hooks/useKeyboardShortcuts.tsx
  • src/modules/upload/NewItemHighlightProvider.jsx
  • src/hooks/useOnLongPress/helpers.js

Copy link
Copy Markdown
Contributor

@JF-Cozy JF-Cozy left a comment

Choose a reason for hiding this comment

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

don't forget to remove them from Notion after merging :)

Copy link
Copy Markdown
Contributor

@doubleface doubleface left a comment

Choose a reason for hiding this comment

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

Looks like there are still some unit tests to fix

@zatteo zatteo force-pushed the feat/remove-some-flags branch from c490cd0 to dfa6900 Compare March 30, 2026 13:36
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{"name":"HttpError","status":403,"request":{"method":"PATCH","url":"https://api.github.com/repos/linagora/twake-drive/issues/comments/4153367740","headers":{"accept":"application/vnd.github.v3+json","user-agent":"octokit.js/0.0.0-development octokit-core.js/7.0.6 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":{"body":"<!-- This is an auto-generated comment: summarize by coderabbit.ai -->\n<!-- This is an auto-generated comment: review in progress by coderabbit.ai -->\n\n> [!NOTE]\n> Currently processing new changes in this PR. This may take a few minutes, please wait...\n> \n> <details>\n> <summary>⚙️ Run configuration</summary>\n> \n> **Configuration used**: Organization UI\n> \n> **Review profile**: CHILL\n> \n> **Plan**: Pro\n> \n> **Run ID**: `5e973f17-c71c-4854-bec7-bd611a117257`\n> \n> </details>\n> \n> <details>\n> <summary>📥 Commits</summary>\n> \n> Reviewing files that changed from the base of the PR and between c490cd0154a12dbad2c699ee0fdf84a8c2245efb and dfa6900cb73d1433e667f83b8afb68b05b19dfdc.\n> \n> </details>\n> \n> <details>\n> <summary>📒 Files selected for processing (21)</summary>\n> \n> * `jestHelpers/setup.js`\n> * `src/hooks/useFolderSort/index.spec.jsx`\n> * `src/hooks/useFolderSort/index.ts`\n> * `src/hooks/useKeyboardShortcuts.spec.jsx`\n> * `src/hooks/useKeyboardShortcuts.tsx`\n> * `src/hooks/useOnLongPress/helpers.js`\n> * `src/hooks/useOnLongPress/helpers.spec.jsx`\n> * `src/hooks/useUpdateFavicon/index.spec.jsx`\n> * `src/hooks/useUpdateFavicon/index.tsx`\n> * `src/lib/flags.js`\n> * `src/modules/actions/components/personalizeFolder.js`\n> * `src/modules/drive/Toolbar/personalizeFolder/PersonalizeFolderItem.jsx`\n> * `src/modules/filelist/icons/FileIconMime.jsx`\n> * `src/modules/layout/Layout.jsx`\n> * `src/modules/public/PublicLayout.jsx`\n> * `src/modules/upload/NewItemHighlightProvider.jsx`\n> * `src/modules/views/Folder/virtualized/useScrollToHighlightedItem.jsx`\n> * `src/modules/views/Folder/virtualized/useScrollToHighlightedItem.spec.jsx`\n> * `src/modules/views/Modal/QualifyFileView.jsx`\n> * `src/modules/views/Public/PublicFolderView.jsx`\n> * `test/components/AppLike.jsx`\n> \n> </details>\n> \n> ```ascii\n>  _________________________________________\n> < Make it work, make it right, make it 🥕. >\n>  -----------------------------------------\n>   \\\n>    \\   \\\n>         \\ /\\\n>         ( )\n>       .( o ).\n> ```\n\n<!-- end of auto-generated comment: review in progress by coderabbit.ai -->\n\n<!-- walkthrough_start -->\n\n## Walkthrough\n\nThis PR removes feature flag dependencies from multiple components and hooks throughout the codebase. The changes eliminate conditional logic that previously gated functionality behind flags such as `drive.keyboard-shortcuts.enabled`, `drive.highlight-new-items.enabled`, `drive.save-sort-choice.enabled`, and others. Flag checks are removed from hooks, components, and test setups, while the `flagsList` registration is updated. Previously feature-flagged behaviors now execute unconditionally based on their existing conditions, and the mock setup in Jest configuration is simplified.\n\n## Possibly related PRs\n\n- linagora/twake-drive#3692: Removes flag-based gating for `drive.dynamic-selection.enabled` from click handling behavior, related to elimination of dynamic selection feature flag dependency.\n\n## Suggested reviewers\n\n- JF-Cozy\n- lethemanh\n- rezk2ll\n- doubleface\n\n<!-- walkthrough_end -->\n\n<!-- pre_merge_checks_walkthrough_start -->\n\n<details>\n<summary>🚥 Pre-merge checks | ✅ 3</summary>\n\n<details>\n<summary>✅ Passed checks (3 passed)</summary>\n\n|     Check name     | Status   | Explanation                                                                                                                                                                       |\n| :----------------: | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n|  Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled.                                                                                                                       |\n|     Title check    | ✅ Passed | The title accurately describes the main change: removal of feature flags that are not enabled by default. The changeset removes multiple flag dependencies across numerous files. |\n| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.                                                                        |\n\n</details>\n\n<sub>✏️ Tip: You can configure your own custom pre-merge checks in the settings.</sub>\n\n</details>\n\n<!-- pre_merge_checks_walkthrough_end -->\n\n<!-- finishing_touch_checkbox_start -->\n\n<details>\n<summary>✨ Finishing Touches</summary>\n\n<details>\n<summary>📝 Generate docstrings</summary>\n\n- [ ] <!-- {\"checkboxId\": \"7962f53c-55bc-4827-bfbf-6a18da830691\"} --> Create stacked PR\n- [ ] <!-- {\"checkboxId\": \"3e1879ae-f29b-4d0d-8e06-d12b7ba33d98\"} --> Commit on current branch\n\n</details>\n<details>\n<summary>🧪 Generate unit tests (beta)</summary>\n\n- [ ] <!-- {\"checkboxId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Create PR with unit tests\n- [ ] <!-- {\"checkboxId\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Commit unit tests in branch `feat/remove-some-flags`\n\n</details>\n\n</details>\n\n<!-- finishing_touch_checkbox_end -->\n\n<!-- tips_start -->\n\n---\n\nThanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=linagora/twake-drive&utm_content=3772)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.\n\n<details>\n<summary>❤️ Share</summary>\n\n- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)\n- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)\n- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)\n- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)\n\n</details>\n\n<sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub>\n\n<!-- tips_end -->\n\n<!-- internal state start -->\n\n\n<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS4AlEs3xTIiFiUgAzC2iLJcsaugUbhj4uJBkKlb0cpBK7mjYFrgGAHLYzAKUXADMAOy5AEwGAKo2ADJcsLi43IgcAPT1ROqw2AIaTMz1FvAY3vhU9bgA7mgA1iRgtBSSJPXciRb1eYUliFmQAF7UNPgGAMr42BQMbgJUGAywXO4k1PVBDlJgLmxgnt6IBtBoFKRh50wVy4zDQiBoFAOuGo2Dq/G4ZAMdgk8BIw0ocNoRwEVnipwANJAgpsxgULBZCVY/PZMLBCQApABiYAAwvhNrIDGUVCQLHCDCygtQ6OhOJACgAGAoANjAEuyYGyEugEoAHBwAKwajgSgCcAC0jPpjOAoGR6Ph3DgCMQyMoaPROmwMGLePxhKJxFIZPImEoqKp1FodMaTFA4KhUJhrYRSOQqA6FKx2FwqMNnOlQRR5DE/cpA5ptLowIYTaYDCJwQAJXkIiiIerrXDYbgaIR1AwAIm7BgAxL3IABBACStvjwvoiEzv3klsY/gwpC+xW4tAnkGpkAABkwOe8vD4t5B6dIwg4GGMuJvzxN6O5sJdxPgsCFIBZn6Q+GgGKduLhkGg24fEQKRoGwR6/EQ6TsOgGD0K+76LpQChweo8DPmg5LyEEzYUBgyBbrgFDYCQR7uAM27TLMGgIEQsA9HRuBgOQwxgOo9iIB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EgKoB266gBAMobGLkCqQMrVQaAAoNkDQDSgVZuQO4O4B1nMrsgOsgQO4EyDYxsg6MEgNjFODKzVQqsJYmWCgCv5vZlAUgFMX9l8zXZoYcWZTPwBTE8cAsQOcKEdXBzSwwxTsG0OLFu9BwuAZEIGjoAJzWCuANkDDjTkSh9V7sqADartUJB1gjqmgFMUtUlggAA=== -->\n\n<!-- internal state end -->\n<!-- usage_tips_start -->\n\n> [!TIP]\n> <details>\n> <summary>You can enable review details to help with troubleshooting, context usage and more.</summary>\n> \n> Enable the `reviews.review_details` setting to include review details such as the model used, the time taken for each step and more in the review comments.\n> \n> </details>\n\n<!-- usage_tips_end -->"},"request":{"retryCount":1,"signal":{}}},"response":{"url":"https://api.github.com/repos/linagora/twake-drive/issues/comments/4153367740","status":403,"headers":{"access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","content-encoding":"gzip","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Mon, 30 Mar 2026 13:37:48 GMT","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","transfer-encoding":"chunked","vary":"Accept-Encoding, Accept, X-Requested-With","x-accepted-github-permissions":"issues=write; pull_requests=write","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"810E:3B5DBF:474A5CA:11FB1CAF:69CA7CAA","x-ratelimit-limit":"10900","x-ratelimit-remaining":"10660","x-ratelimit-reset":"1774878733","x-ratelimit-resource":"core","x-ratelimit-used":"240","x-xss-protection":"0"},"data":{"message":"Resource not accessible by integration","documentation_url":"https://docs.github.com/rest/issues/comments#update-an-issue-comment","status":"403"}}}

Copy link
Copy Markdown

@codescene-delta-analysis codescene-delta-analysis 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 Health Improved (11 files improve in Code Health)

Gates Passed
3 Quality Gates Passed

See analysis details in CodeScene

View Improvements
File Code Health Impact Categories Improved
NewItemHighlightProvider.jsx 9.69 → 10.00 Complex Method
useScrollToHighlightedItem.jsx 9.55 → 9.58 Complex Method
useKeyboardShortcuts.spec.jsx 7.92 → 7.95 Complex Method
useKeyboardShortcuts.tsx 8.56 → 8.57 Complex Method
PublicFolderView.jsx 8.57 → 8.59 Complex Method
index.ts 9.26 → 9.58 Complex Method, Complex Conditional
index.spec.jsx 9.10 → 9.39 Code Duplication
index.tsx 9.69 → 10.00 Complex Conditional
PersonalizeFolderItem.jsx 9.54 → 9.69 Complex Conditional
FileIconMime.jsx 9.24 → 9.39 Complex Method, Complex Conditional
helpers.js 9.69 → 10.00 Complex Method

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.

@zatteo
Copy link
Copy Markdown
Member Author

zatteo commented Mar 30, 2026

I will check that all these flags are already enabled in every environments before merging.

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.

Caution

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

⚠️ Outside diff range comments (2)
src/hooks/useOnLongPress/helpers.spec.jsx (2)

77-99: ⚠️ Potential issue | 🟠 Major

Missing test coverage for single-click behavior.

The setSelectedItems mock is added (line 95) but no test verifies it's called. Per helpers.js lines 26-31, single-click triggers setSelectedItems({ [file._id]: file }). This is a primary code path that should be covered.

Additionally, toggle: mockToggle at line 92 is dead code—handleClick no longer uses a toggle parameter.

🧪 Proposed fix: Add single-click test and remove unused toggle
       params: {
         event,
         disabled,
         isRenaming,
         file,
         openLink: mockOpenLink,
-        toggle: mockToggle,
         lastClickTime,
         setLastClickTime: jest.fn(),
         setSelectedItems: jest.fn(),
         onInteractWithFile: jest.fn()
       }
     }
   }

Add a test for single-click behavior:

describe('for single click', () => {
  beforeEach(() => {
    MockDate.set('2025-01-01T12:00:01.000Z') // 1 second after first click (not a double-click)
  })

  it('should call setSelectedItems with file', () => {
    const file = { _id: 'test-file-id' }
    const { params } = setup({ file })
    handleClick(params)

    expect(params.setSelectedItems).toHaveBeenCalledWith({ [file._id]: file })
    expect(mockOpenLink).not.toHaveBeenCalled()
  })
})
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/hooks/useOnLongPress/helpers.spec.jsx` around lines 77 - 99, Add a unit
test covering the single-click path of handleClick: in the spec use setup(...)
to create params (with a file like { _id: 'test-file-id' }), set MockDate to one
second after the prior click so it is not treated as a double-click, call
handleClick(params), and assert params.setSelectedItems was called with {
[file._id]: file } and that mockOpenLink was not called; also remove the unused
mockToggle from the setup params and any references since handleClick no longer
consumes a toggle parameter.

138-138: ⚠️ Potential issue | 🟡 Minor

Typo in test description.

"renainming" should be "renaming".

✏️ Proposed fix
-    it('it should do nothing when renainming', () => {
+    it('it should do nothing when renaming', () => {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/hooks/useOnLongPress/helpers.spec.jsx` at line 138, Update the test case
description that currently reads "it should do nothing when renainming" to the
correct spelling "it should do nothing when renaming" in the it(...) call in the
useOnLongPress/helpers.spec.jsx test (the it block with the misspelled string
"it should do nothing when renainming").
🧹 Nitpick comments (2)
src/hooks/useOnLongPress/helpers.spec.jsx (1)

106-113: Remove or update the skipped test.

This xit test references mockToggle, which is no longer used by handleClick. Either delete this test or update it to verify setSelectedItems behavior per the new implementation.

♻️ Proposed fix
-  // should create a real life test to replace toggle by final func
-  xit('should only toggle by default', () => {
-    const { params } = setup({})
-    handleClick(params)
-
-    expect(mockToggle).toHaveBeenCalledWith(ev)
-    expect(mockOpenLink).not.toHaveBeenCalled()
-  })
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/hooks/useOnLongPress/helpers.spec.jsx` around lines 106 - 113, Update the
skipped test 'should only toggle by default' in useOnLongPress/helpers.spec.jsx:
remove references to mockToggle and instead assert the new behavior by calling
handleClick(params) (use setup to get params/ev) and verifying setSelectedItems
is called with the expected selection payload and that mockOpenLink is not
called; alternatively delete the entire xit block if this case is no longer
applicable. Ensure you reference handleClick, setup, setSelectedItems,
mockOpenLink and ev so the assertion matches the current implementation.
src/modules/views/Folder/virtualized/useScrollToHighlightedItem.jsx (1)

46-48: Pre-existing dead code: targetIndex === -1 check is unreachable.

Since Line 38 already guards with !indexById.has(targetItem._id), the Map.get() on Line 43 will always return a valid non-negative index. The targetIndex === -1 condition can never be true.

Consider simplifying in a follow-up:

♻️ Optional simplification
     const targetIndex = indexById.get(targetItem._id)
     const virtuosoHandle = virtuosoRef?.current
 
-    if (targetIndex === -1 || !virtuosoHandle) {
+    if (!virtuosoHandle) {
       return
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/modules/views/Folder/virtualized/useScrollToHighlightedItem.jsx` around
lines 46 - 48, The check for targetIndex === -1 in the
useScrollToHighlightedItem flow is dead code because
indexById.has(targetItem._id) already guarantees Map.get() yields a valid index;
remove the unreachable condition and simplify the early return to only test
virtuosoHandle (i.e., replace "if (targetIndex === -1 || !virtuosoHandle) {
return }" with "if (!virtuosoHandle) { return }"), keeping references to
targetIndex, virtuosoHandle, indexById, and targetItem._id so intent and
readability remain clear.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/hooks/useOnLongPress/helpers.spec.jsx`:
- Around line 77-99: Add a unit test covering the single-click path of
handleClick: in the spec use setup(...) to create params (with a file like {
_id: 'test-file-id' }), set MockDate to one second after the prior click so it
is not treated as a double-click, call handleClick(params), and assert
params.setSelectedItems was called with { [file._id]: file } and that
mockOpenLink was not called; also remove the unused mockToggle from the setup
params and any references since handleClick no longer consumes a toggle
parameter.
- Line 138: Update the test case description that currently reads "it should do
nothing when renainming" to the correct spelling "it should do nothing when
renaming" in the it(...) call in the useOnLongPress/helpers.spec.jsx test (the
it block with the misspelled string "it should do nothing when renainming").

---

Nitpick comments:
In `@src/hooks/useOnLongPress/helpers.spec.jsx`:
- Around line 106-113: Update the skipped test 'should only toggle by default'
in useOnLongPress/helpers.spec.jsx: remove references to mockToggle and instead
assert the new behavior by calling handleClick(params) (use setup to get
params/ev) and verifying setSelectedItems is called with the expected selection
payload and that mockOpenLink is not called; alternatively delete the entire xit
block if this case is no longer applicable. Ensure you reference handleClick,
setup, setSelectedItems, mockOpenLink and ev so the assertion matches the
current implementation.

In `@src/modules/views/Folder/virtualized/useScrollToHighlightedItem.jsx`:
- Around line 46-48: The check for targetIndex === -1 in the
useScrollToHighlightedItem flow is dead code because
indexById.has(targetItem._id) already guarantees Map.get() yields a valid index;
remove the unreachable condition and simplify the early return to only test
virtuosoHandle (i.e., replace "if (targetIndex === -1 || !virtuosoHandle) {
return }" with "if (!virtuosoHandle) { return }"), keeping references to
targetIndex, virtuosoHandle, indexById, and targetItem._id so intent and
readability remain clear.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5e973f17-c71c-4854-bec7-bd611a117257

📥 Commits

Reviewing files that changed from the base of the PR and between c490cd0 and dfa6900.

📒 Files selected for processing (21)
  • jestHelpers/setup.js
  • src/hooks/useFolderSort/index.spec.jsx
  • src/hooks/useFolderSort/index.ts
  • src/hooks/useKeyboardShortcuts.spec.jsx
  • src/hooks/useKeyboardShortcuts.tsx
  • src/hooks/useOnLongPress/helpers.js
  • src/hooks/useOnLongPress/helpers.spec.jsx
  • src/hooks/useUpdateFavicon/index.spec.jsx
  • src/hooks/useUpdateFavicon/index.tsx
  • src/lib/flags.js
  • src/modules/actions/components/personalizeFolder.js
  • src/modules/drive/Toolbar/personalizeFolder/PersonalizeFolderItem.jsx
  • src/modules/filelist/icons/FileIconMime.jsx
  • src/modules/layout/Layout.jsx
  • src/modules/public/PublicLayout.jsx
  • src/modules/upload/NewItemHighlightProvider.jsx
  • src/modules/views/Folder/virtualized/useScrollToHighlightedItem.jsx
  • src/modules/views/Folder/virtualized/useScrollToHighlightedItem.spec.jsx
  • src/modules/views/Modal/QualifyFileView.jsx
  • src/modules/views/Public/PublicFolderView.jsx
  • test/components/AppLike.jsx
💤 Files with no reviewable changes (10)
  • src/lib/flags.js
  • src/modules/views/Folder/virtualized/useScrollToHighlightedItem.spec.jsx
  • src/modules/actions/components/personalizeFolder.js
  • src/modules/filelist/icons/FileIconMime.jsx
  • src/hooks/useKeyboardShortcuts.tsx
  • src/hooks/useFolderSort/index.spec.jsx
  • src/modules/drive/Toolbar/personalizeFolder/PersonalizeFolderItem.jsx
  • src/hooks/useUpdateFavicon/index.spec.jsx
  • src/modules/upload/NewItemHighlightProvider.jsx
  • src/hooks/useOnLongPress/helpers.js
✅ Files skipped from review due to trivial changes (5)
  • src/modules/views/Modal/QualifyFileView.jsx
  • src/hooks/useFolderSort/index.ts
  • src/modules/public/PublicLayout.jsx
  • src/modules/layout/Layout.jsx
  • src/modules/views/Public/PublicFolderView.jsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/hooks/useUpdateFavicon/index.tsx
  • test/components/AppLike.jsx

@Crash--
Copy link
Copy Markdown
Contributor

Crash-- commented Apr 7, 2026

@zatteo Please, move forward with this PR. It's complicated to have Drive locally without the behavior we have in production because of the flags.

So yes, let's have this PR merged in some way :)

@zatteo
Copy link
Copy Markdown
Member Author

zatteo commented Apr 7, 2026

@zatteo Please, move forward with this PR. It's complicated to have Drive locally without the behavior we have in production because of the flags.

So yes, let's have this PR merged in some way :)

It's in progress. We found a production environment where we did not enabled these flags so we are trying to enable them smoothly before removing them totally in the code.

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.

5 participants