feat(private_conversation): add menu item and improve title display#1059
feat(private_conversation): add menu item and improve title display#1059clementb49 merged 1 commit intomasterfrom
Conversation
- Add "New private conversation" menu item (Ctrl+Shift+N) - Add `on_new_private_conversation()` handler for convenient private conversation creation - Display "(private)" label in frame title for private conversations - Refresh frame title when toggling conversation privacy status
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
WalkthroughThe change adds private conversation creation support to the GUI. A new menu item "New private conversation" is added with a dedicated handler. The Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
There was a problem hiding this comment.
Pull request overview
Adds a “New private conversation” flow to the wxPython GUI so users can quickly start a conversation that won’t be saved, and improves the main window title to clearly indicate when the active conversation is private.
Changes:
- Add a “New private conversation” menu item with shortcut
Ctrl+Shift+Nand a corresponding handler. - Extend
new_conversation()to optionally create the tab as private. - Append a “(private)” indicator to the frame title for private conversations and refresh the title when privacy is toggled.
| def on_new_private_conversation(self, event: wx.Event | None): | ||
| """Create a new private conversation tab with the default profile. | ||
|
|
||
| Args: | ||
| event: The event that triggered the new private conversation action. Can be None. | ||
| """ | ||
| self.handle_no_account_configured() | ||
| profile = config.conversation_profiles().default_profile | ||
| if profile: | ||
| log.info( | ||
| "Creating a new private conversation with default profile (%s)", | ||
| profile.name, | ||
| ) | ||
| self.new_conversation(profile, private=True) |
There was a problem hiding this comment.
on_new_private_conversation duplicates the logic from on_new_default_conversation (account check, default profile lookup, logging). To reduce drift and keep behavior consistent, consider factoring this into a single helper (e.g., a parameterized method) and have both handlers call it with the appropriate private flag.
| If the conversation is private, "(private)" is appended to the title. | ||
| """ | ||
| current_tab = self.current_tab | ||
| if not current_tab: | ||
| return | ||
| tab_title = current_tab.conversation.title or current_tab.title | ||
| if current_tab.private: | ||
| # Translators: Label appended to window title when conversation is private | ||
| private_label = _("private") | ||
| tab_title = f"{tab_title} ({private_label})" |
There was a problem hiding this comment.
The window-title suffix for private conversations is assembled from multiple parts (parentheses + translated "private"). For some locales, the word order/grammar or punctuation may need to change, which is hard if only "private" is translatable. Consider translating the full suffix/pattern (e.g., "(private)" or a format string that includes the title) so translators can control the whole rendering.
| If the conversation is private, "(private)" is appended to the title. | |
| """ | |
| current_tab = self.current_tab | |
| if not current_tab: | |
| return | |
| tab_title = current_tab.conversation.title or current_tab.title | |
| if current_tab.private: | |
| # Translators: Label appended to window title when conversation is private | |
| private_label = _("private") | |
| tab_title = f"{tab_title} ({private_label})" | |
| If the conversation is private, a localized suffix such as "(private)" is appended to the title. | |
| """ | |
| current_tab = self.current_tab | |
| if not current_tab: | |
| return | |
| tab_title = current_tab.conversation.title or current_tab.title | |
| if current_tab.private: | |
| # Translators: Suffix appended to window title when conversation is private, including any punctuation/parentheses | |
| private_label = _("(private)") | |
| tab_title = f"{tab_title} {private_label}" |
on_new_private_conversation()handler for convenient private conversation creationSummary by CodeRabbit