feat(navigation): make log out discoverable from settings search and cmd+k#59236
Merged
Conversation
…cmd+k Add a synthetic "Log out" entry to the project Settings search index and to the global command palette (Cmd/Ctrl+K) so users searching for "logout", "log out", "sign out", or "signout" find it without hunting through Settings pages. Selecting the entry triggers userLogic.logout(); the canonical UI in the account menu (bottom-left) is unchanged. Also adds a short logout pointer to the Max chat agent system prompt so the assistant stops directing users to Settings pages that don't expose logout. Generated-By: PostHog Code Task-Id: 880762f0-9ea4-4452-b46a-22267790c9e6
Contributor
|
🎭 Playwright didn't run on this PR — your changes touch code that could affect E2E behavior, but Playwright is opt-in via label now to keep CI cost down. Add the Most PRs don't need this. Real regressions still get caught on master and fix-forward. |
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
frontend/src/scenes/settings/settingsLogic.ts:29
The `LOGOUT_SETTING_ID` constant is exported but is only ever used within this file (the `navigateToSetting` listener and the Fuse index builder). Per the simplicity rule "has no superfluous parts", removing the export keeps the module surface minimal. If tests need it in the future the export can be added then.
```suggestion
const LOGOUT_SETTING_ID = '__logout__' as SettingId
```
Reviews (1): Last reviewed commit: "feat(navigation): make log out discovera..." | Re-trigger Greptile |
Contributor
|
Size Change: -1.3 kB (0%) Total Size: 118 MB 📦 View Changed
ℹ️ View Unchanged
|
…ings entry Refactor in response to review: - Drop the synthetic Settings search entry — logout isn't a setting and shouldn't surface there. - Register a single global "Log out" entry in searchLogic's miscItems (alongside Exports / Alerts / Subscriptions), with searchKeywords so fuzzy match surfaces it for "logout" / "sign out" queries. - Add a generic `onSelect?: () => void` callback to SearchItem; Command.tsx invokes it before falling back to href navigation. This is the generic hook any future global action can use without bespoke Search.tsx logic. - Fix Max system prompt: the account menu is at the TOP of the left navigation sidebar (organization logo / project name), not bottom-left. Generated-By: PostHog Code Task-Id: 880762f0-9ea4-4452-b46a-22267790c9e6
rafaeelaudibert
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Users searching for the logout option were typing logout-related queries ("logout", "sign out", etc.) into Project/Account Settings and the command palette, getting no results, and asking Max — which gave incorrect Settings-based guidance because it had no canonical pointer to where logout lives. Log out is only exposed in the account menu (bottom-left avatar dropdown), and was completely missing from the Settings search index, the Cmd/Ctrl+K palette, and the assistant's knowledge.
Changes
Three small, additive discoverability surfaces — the canonical logout UI in the account menu is unchanged:
frontend/src/scenes/settings/settingsLogic.ts): adds a synthetic "Log out" entry to the Fuse.js search index (keywords: "log out logout sign out signout exit"). Selecting it short-circuits thenavigateToSettinglistener and callsuserLogic.actions.logout()instead of navigating to a real settings panel.frontend/src/lib/components/Search/Search.tsx): adds a synthetic "Log out" item when the search query contains a logout-related keyword, following the existingSETTINGS_THEME_ITEM_IDpattern. The handler intercepts the synthetic id and callslogout()instead of pushing an href.ee/hogai/chat_agent/prompts/base.py): appends one sentence toBASIC_FUNCTIONALITY_PROMPTtelling Max where logout lives (account menu, bottom-left) and that logout is NOT a setting page — so it stops directing users into Settings.No new tests; the changes are entry additions to existing indexes plus a small prompt addition.
How did you test this code?
I'm the PostHog Code agent. I did not run the app in a browser, and node_modules wasn't installed in this environment so I couldn't run
pnpm typescript:check(the errors that surfaced were missing-module errors forkea,react,@posthog/iconsacross all files, not introduced by this change). What I verified statically:navigateToSetting(sectionId, settingId)action; the listener intercepts onLOGOUT_SETTING_IDbefore the section lookup runs.SETTINGS_THEME_ITEM_ID), including the click-handler interception and dependency-array updates.userLogic.actions.logoutis signature-compatible with a no-arg call (defaultspreserveLocation = false), matching the existing call site inNewAccountMenu.tsx.Suggested manual checks for a reviewer:
Publish to changelog?
no
Docs update
No docs change needed.
🤖 Agent context
Authored by the PostHog Code agent in response to a signal report about users wasting time hunting for the logout option in Settings and getting incorrect guidance from Max.
The signal report proposed three discoverability surfaces (Settings search, command palette, Max prompt). I implemented all three with minimal changes:
LOGOUT_SETTING_IDintercepted in the existingnavigateToSettinglistener — additive, no new sidebar entry./logout) but logout requires a POST with CSRF, so an href won't work. The existing theme-shortcut pattern (SETTINGS_THEME_ITEM_IDsynthetic item + handler interception) is a clean precedent and I followed it directly.BASIC_FUNCTIONALITY_PROMPTto avoid bloating the prompt with UI-navigation trivia; the goal is just to stop the specific failure mode (Max directing users to Settings).This is agent-authored and requires human review.