-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Open settings in new full tab similar to VSCode #8253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added new openSettingsInNewTab function to create dedicated webview panel for settings - Updated settings button click handler to open settings in new tab instead of within extension - Added localized 'Roo Code Settings' title for the new settings tab - Settings now open in a full VSCode tab with proper state management - All localization files updated with new tabTitle key
| "add": "Добавить заголовок", | ||
| "remove": "Удалить" | ||
| }, | ||
| "tabTitle": "Roo Code Settings", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新增了 'tabTitle' 键,其值为 "Roo Code Settings"。请确认是否有意保持此字符串不翻译,还是应提供俄语版本。
| "tabTitle": "Roo Code Settings", | |
| "tabTitle": "Настройки Roo Code", |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
| "add": "新增標頭", | ||
| "remove": "移除" | ||
| }, | ||
| "tabTitle": "Roo Code Settings", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在繁體中文文件中添加了 'tabTitle' 鍵,值為 "Roo Code Settings"。請確認這個英文字符串是否符合品牌策略,或是否需要翻譯成繁體中文。
| "tabTitle": "Roo Code Settings", | |
| "tabTitle": "Roo Code 設定", |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test review
| const settingsTitle = t("settings:tabTitle") || "Roo Code Settings" | ||
|
|
||
| const newPanel = vscode.window.createWebviewPanel( | ||
| "rooCodeSettings", // Unique ID for settings panel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a different viewType ("rooCodeSettings") breaks title bar menu conditions that check for the main panel type (ClineProvider.tabPanelId). This hides commands when the settings tab is active. Use the same type to retain consistent UX across tabs.
| "rooCodeSettings", // Unique ID for settings panel | |
| ClineProvider.tabPanelId, |
| await tabProvider.resolveWebviewView(newPanel) | ||
|
|
||
| // Immediately send a message to open the settings view | ||
| newPanel.webview.postMessage({ type: "action", action: "settingsButtonClicked" }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Send didBecomeVisible immediately to mirror the old behavior where both messages were posted to ensure reliable initial scroll/visibility handling.
| newPanel.webview.postMessage({ type: "action", action: "settingsButtonClicked" }) | |
| newPanel.webview.postMessage({ type: "action", action: "settingsButtonClicked" }) | |
| newPanel.webview.postMessage({ type: "action", action: "didBecomeVisible" }) |
| } | ||
|
|
||
| export const openSettingsInNewTab = async ({ context, outputChannel }: Omit<RegisterCommandOptions, "provider">) => { | ||
| const contextProxy = await ContextProxy.getInstance(context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with openClineInNewTab (which initializes CodeIndexManager), initialize it here as well to ensure any side effects or listeners are set up before resolving the webview.
| const contextProxy = await ContextProxy.getInstance(context) | |
| const contextProxy = await ContextProxy.getInstance(context) | |
| CodeIndexManager.getInstance(context) |
| const targetCol = hasVisibleEditors ? Math.max(lastCol + 1, 1) : vscode.ViewColumn.Two | ||
|
|
||
| // Get the localized title for the settings tab | ||
| const settingsTitle = t("settings:tabTitle") || "Roo Code Settings" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call t("settings:tabTitle") reads from src/i18n, but only webview-ui locales were updated. The title will not be localized in the extension host. Please add settings.json with tabTitle in src/i18n/locales/* to match, or update the implementation plan/description accordingly.
| ) | ||
|
|
||
| // Save as tab type panel. | ||
| setPanel(newPanel, "tab") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setPanel(newPanel, "tab") overwrites the global tabPanel reference. Commands that assume tabPanel points to the main chat panel will now target the settings panel. Consider tracking a separate settingsTabPanel ref (and corresponding focus logic) instead of reusing the global tab slot.
|
This breaks the settings, I can't seem to be able to save any setting with this |
Summary
This PR implements the requested feature to open Roo Code settings in a new, full tab similar to VSCode's own settings, instead of within the extension panel.
Changes
openSettingsInNewTabfunction to create a dedicated webview panel for settingstabTitlekeyImplementation Details
Testing
Related Slack Request
This implementation addresses the Slack request to make settings open in a new, full tab similar to VSCode's own settings, with everything else continuing to work the same way.
Important
This PR adds functionality to open settings in a new VSCode tab and updates localization for the new tab title.
openSettingsInNewTabfunction inregisterCommands.tsto open settings in a new VSCode tab.tabTitlekey with value 'Roo Code Settings' to localization files inwebview-ui/src/i18n/locales/ca/settings.json,webview-ui/src/i18n/locales/de/settings.json, andwebview-ui/src/i18n/locales/en/settings.json... and 18 other files.This description was created by
for d46cdca. You can customize this summary. It will automatically update as commits are pushed.