Skip to content

fix: Hide AI sidebar if AI feature is not enabled#4502

Merged
Rockyy174 merged 1 commit into
operately:mainfrom
Rockyy174:hide-ai-sidebar
May 19, 2026
Merged

fix: Hide AI sidebar if AI feature is not enabled#4502
Rockyy174 merged 1 commit into
operately:mainfrom
Rockyy174:hide-ai-sidebar

Conversation

@Rockyy174

Copy link
Copy Markdown
Collaborator

No description provided.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Both AiSidebar and useSidebarState call useAiAvailability, which duplicates the availability computation and company lookup; consider computing availability once at the top level and passing it down to avoid divergence and redundant work.
  • In useAvailableActions and the callbacks inside useSidebarState, the dependency arrays use conversationContext directly; narrowing these dependencies to stable fields like conversationContext?.type (and any IDs you rely on) will reduce unnecessary memo/callback recalculations when the object identity changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Both `AiSidebar` and `useSidebarState` call `useAiAvailability`, which duplicates the availability computation and company lookup; consider computing availability once at the top level and passing it down to avoid divergence and redundant work.
- In `useAvailableActions` and the callbacks inside `useSidebarState`, the dependency arrays use `conversationContext` directly; narrowing these dependencies to stable fields like `conversationContext?.type` (and any IDs you rely on) will reduce unnecessary memo/callback recalculations when the object identity changes.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Signed-off-by: Adriano Lazzaretti <lazzaretti136@gmail.com>
@Rockyy174
Rockyy174 merged commit d849ba6 into operately:main May 19, 2026
3 checks passed
@Rockyy174
Rockyy174 deleted the hide-ai-sidebar branch May 19, 2026 16:01
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.

1 participant