-
-
Notifications
You must be signed in to change notification settings - Fork 350
feat: implement tab close functionality with i18n support #2049
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
base: main
Are you sure you want to change the base?
Conversation
losingle
commented
Apr 17, 2025
- Add right-click close functionality for tabs
- Add 'Close tab' translations for multiple languages including:
- English
- Chinese (Simplified & Traditional)
- Japanese
- Korean
- French
- Spanish
- German
- Russian
- Improve UI button text (simplify Home/Back/Switch buttons) - Refine Experitest related translations - Update refresh source related text to be more intuitive - Keep data center names in English (US-West/East, EU-Central) - Improve clarity and consistency of translations
- Add right-click close functionality for tabs - Add 'Close tab' translations for multiple languages including: - English - Chinese (Simplified & Traditional) - Japanese - Korean - French - Spanish - German - Russian
| "Key": "Key", | ||
| "Secret": "Secret" | ||
| "Secret": "Secret", | ||
| "Close tab": "Close 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.
It is enough to only add English resources. localized resources are synchronized automatically to crowdin as soon as the PR is merged and should not be changed manually.
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.
I only kept English resources
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.
First of all, thank you for the PR!
It looks like you are mixing up two different sets of tabs - one is used for switching between server types (Appium server & any cloud providers), and the other is used for session builder tabs (session builder, saved sets, attach to session). I would suggest only including changes for the former in this PR.
I do think the added functionality is useful, but a) it changes the regular right-click behavior that applies elsewhere in the app, and b) it may be less hacky to implement antd's own tab close button functionality.
| const [activeTab, setActiveTab] = useState(SESSION_BUILDER_TABS.CAPS_BUILDER); | ||
|
|
||
| const isAttaching = tabKey === 'attach'; | ||
| const isAttaching = serverType === 'attach'; |
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.
Not sure why this was changed. tabKey is used for session builder tabs, but serverType is used for the server type tabs.
| bindWindowClose(); | ||
| switchTabs(SESSION_BUILDER_TABS.CAPS_BUILDER); | ||
| await getSavedSessions(); | ||
| await setVisibleProviders(); |
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.
Is there a reason why this was removed?
| } = props; | ||
|
|
||
| const navigate = useNavigate(); | ||
| const [activeTab, setActiveTab] = useState(SESSION_BUILDER_TABS.CAPS_BUILDER); |
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.
I don't quite see the reason in adding this, along with handleTabChange and handleSwitchTabs. Switching session builder tabs is also not related to the server type tab closing functionality.
| tabKey, | ||
| switchTabs, | ||
| serverType, | ||
| setServerType, |
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.
No such function exists. You probably wanted to use changeServerType
| { | ||
| key: 'closeTab', | ||
| label: t('Close tab'), | ||
| onClick: () => handleCloseTab(tabKey), |
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.
Unfortunately this action will also trigger handleSelectServerTab, which will try to select the same tab that was just removed