fix: type onDragOver event param in WorkspaceTab#3403
Conversation
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (3)**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.spec.ts📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.spec.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (2)📚 Learning: 2026-05-19T20:49:24.859ZApplied to files:
📚 Learning: 2026-05-19T20:49:24.859ZApplied to files:
🛑 Comments failed to post (1)
Walkthrough
ChangesWorkspaceTab Type Fix
Reducer Test Update
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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
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. Comment |
…ragover-event-type
There was a problem hiding this comment.
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 `@src/ui/reducers/__tests__/stateGroups.spec.ts`:
- Line 90: The test title in stateGroups.spec.ts is stale because it still
mentions the removed DOWNLOADS_BACK_BUTTON_CLICKED case. Update the it
description for the stateGroups reducer test so it matches the remaining
assertions around side-bar remove and servers loaded, using the existing test
name near the stateGroups spec block to locate it.
🪄 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: 0aeb03e6-f65a-4fb0-ad09-afd1ca7a0f50
📒 Files selected for processing (1)
src/ui/reducers/__tests__/stateGroups.spec.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Use TypeScript for all new code unless explicitly told otherwise.
Use Fuselage components for all UI work; only create custom components when Fuselage does not provide what is needed.
Import UI components from@rocket.chat/fuselage.
CheckTheme.d.tsfor valid color tokens before using Fuselage theme colors.
Use optional chaining with fallbacks for platform-specific APIs, especially Linux-only process APIs likeprocess.getuid(),process.getgid(),process.geteuid(), andprocess.getegid().
Only mock platform-specific APIs when defensive coding is not possible.
Use TypeScript strict mode.
Use React functional components with hooks.
Redux actions must follow the Flux Standard Action (FSA) pattern.
Use camelCase for file names and PascalCase for components.
**/*.{ts,tsx}: Use TypeScript for new code unless explicitly told otherwise.
Use Fuselage components from@rocket.chat/fuselagefor UI work unless the design requires something Fuselage does not provide.
CheckTheme.d.tsfor valid color tokens before using Fuselage colors.
Verify library props, APIs, and tokens against official docs or local.d.tsfiles instead of assuming.
Use React functional components with hooks.
Redux actions follow FSA shape.
Use camelCase for file names and PascalCase for components.
Prefer clear names over unnecessary comments.
Prefer editing existing files over creating new abstractions unless the new abstraction removes real complexity or matches an existing pattern.
Files:
src/ui/reducers/__tests__/stateGroups.spec.ts
**/*.spec.ts
📄 CodeRabbit inference engine (CLAUDE.md)
Use
*.spec.tsfor renderer process tests.
Files:
src/ui/reducers/__tests__/stateGroups.spec.ts
**/*.spec.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Renderer specs use
*.spec.ts/*.spec.tsx.
Files:
src/ui/reducers/__tests__/stateGroups.spec.ts
🧠 Learnings (2)
📚 Learning: 2026-05-19T20:49:24.859Z
Learnt from: nazabucciarelli
Repo: RocketChat/Rocket.Chat.Electron PR: 3329
File: src/ui/reducers/e2ePdfPreviewSizeLimit.ts:14-16
Timestamp: 2026-05-19T20:49:24.859Z
Learning: In Rocket.Chat.Electron’s reducer files under src/ui/reducers/, reducers should not re-implement validation for action payloads. Assume the caller (UI component or dispatch site) has already validated the action payload and type/shape; reducers should trust the payload and update state directly. If validation is needed, add it at the dispatch site/caller rather than inside the reducer.
Applied to files:
src/ui/reducers/__tests__/stateGroups.spec.ts
📚 Learning: 2026-05-19T20:49:24.859Z
Learnt from: nazabucciarelli
Repo: RocketChat/Rocket.Chat.Electron PR: 3329
File: src/ui/reducers/e2ePdfPreviewSizeLimit.ts:14-16
Timestamp: 2026-05-19T20:49:24.859Z
Learning: In the Rocket.Chat.Electron UI reducers under src/ui/reducers/, do not add/repeat input validation for action payloads inside reducers. Follow the existing codebase pattern: validate the action payload in the caller (e.g., the UI component or dispatch site) before dispatching. Reducers should trust the incoming payload and apply it directly to state. If adding/updating a reducer, ensure the corresponding caller performs the necessary validation (e.g., check numeric constraints like !isNaN(value) && value > 0 before dispatching the action).
Applied to files:
src/ui/reducers/__tests__/stateGroups.spec.ts
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
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 `@src/ui/reducers/__tests__/stateGroups.spec.ts`:
- Line 90: The test title in stateGroups.spec.ts is stale because it still
mentions the removed DOWNLOADS_BACK_BUTTON_CLICKED case. Update the it
description for the stateGroups reducer test so it matches the remaining
assertions around side-bar remove and servers loaded, using the existing test
name near the stateGroups spec block to locate it.
🪄 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: 0aeb03e6-f65a-4fb0-ad09-afd1ca7a0f50
📒 Files selected for processing (1)
src/ui/reducers/__tests__/stateGroups.spec.ts
🛑 Comments failed to post (1)
src/ui/reducers/__tests__/stateGroups.spec.ts (1)
90-90: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Update the test description to remove the stale "downloads back button" reference.
The
ittitle at line 90 still says "handles side-bar remove, downloads back button, and servers loaded" but theDOWNLOADS_BACK_BUTTON_CLICKEDassertion was removed. The description no longer matches the test body.♻️ Proposed fix
- it('handles side-bar remove, downloads back button, and servers loaded', () => { + it('handles side-bar remove, downloads button, and servers loaded', () => {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.it('handles side-bar remove, downloads button, and servers loaded', () => {🤖 Prompt for 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. In `@src/ui/reducers/__tests__/stateGroups.spec.ts` at line 90, The test title in stateGroups.spec.ts is stale because it still mentions the removed DOWNLOADS_BACK_BUTTON_CLICKED case. Update the it description for the stateGroups reducer test so it matches the remaining assertions around side-bar remove and servers loaded, using the existing test name near the stateGroups spec block to locate it.
What
Adds the missing `DragEvent` type to the inline `onDragOver` handler in `WorkspaceTab.tsx`.
Why
Master fails `yarn lint` with `TS7006: Parameter 'event' implicitly has an 'any' type` at `WorkspaceTab.tsx:127` since #3394 merged. The PR's CI ran against an older merge ref, and lint does not run on master pushes, so the error only surfaces on new PR branches (first seen on #3393).
How
One-line change — `DragEvent` was already imported from `react` for the other drag handlers.
Summary by CodeRabbit