Skip to content

workspace: Hide "View AI Settings" when AI is disabled#50941

Merged
MrSubidubi merged 5 commits intozed-industries:mainfrom
OmChillure:fix-ai-settings
Mar 9, 2026
Merged

workspace: Hide "View AI Settings" when AI is disabled#50941
MrSubidubi merged 5 commits intozed-industries:mainfrom
OmChillure:fix-ai-settings

Conversation

@OmChillure
Copy link
Copy Markdown
Contributor

@OmChillure OmChillure commented Mar 6, 2026

Fixes #50835

Problem :

The "View AI Settings" button on the Welcome page was always rendered regardless of the disable_ai setting. This made it visible (and non-functional) for users who had AI disabled, which was confusing.

Fix :

  • Adds an optional visibility: Option<fn(&App) -> bool> predicate field to SectionEntry
  • At render time, Section::render uses filter_map to skip entries whose predicate returns false.
  • The "View AI Settings" entry is given a predicate that checks !DisableAiSettings::get_global(cx).disable_ai, matching the same pattern used in title_bar.rs and quick_action_bar.rs.
  • All other entries have visibility: None, meaning they are always shown — no behaviour change for them.

Video :

Screencast.from.2026-03-06.20-18-43.webm

Release Notes:

  • Fixed the "View AI Settings" button being visible on the Welcome page despite AI features being disabled in settings.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 6, 2026
@maxdeviant maxdeviant changed the title fix aview ai settings visible or not visible workspace: Hide "View AI Settings" when AI is disabled Mar 6, 2026
Copy link
Copy Markdown
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

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

Makes sense and looks good overall! Two minor nits and we should be good

@MrSubidubi MrSubidubi self-assigned this Mar 6, 2026
@OmChillure
Copy link
Copy Markdown
Contributor Author

@MrSubidubi did those changes

  • added a enum much cleaner from prevous .
  • added a helper fucntion , so Section render stays a clean one-liner instead of doing an inline match.
  • changed visiblity to visibility_guard.

Copy link
Copy Markdown
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

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

Yup, this looks much better now. Thanks!

@MrSubidubi MrSubidubi merged commit 503741d into zed-industries:main Mar 9, 2026
29 checks passed
@zelenenka zelenenka added the guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions label Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"View AI Settings" link is visible on the "Welcome back to Zed" page even though "Disable AI" is turned on

3 participants