feat: update "Show in Folder" label based on platform in ManageWorkspace, Collection, CollectionItem, and WorkspaceHome components (#6623)

* feat: update "Show in Folder" label based on platform in ManageWorkspace, Collection, CollectionItem, and WorkspaceHome components

* refactor: remove duplicate "Rename" item push in CollectionItem component
This commit is contained in:
Abhishek S Lal
2026-01-02 20:57:51 +05:30
committed by GitHub
parent 902d9ff968
commit d758645144
5 changed files with 22 additions and 9 deletions

View File

@@ -14,6 +14,7 @@ import DeleteWorkspace from './DeleteWorkspace';
import StyledWrapper from './StyledWrapper';
import MenuDropdown from 'ui/MenuDropdown/index';
import Button from 'ui/Button';
import { getRevealInFolderLabel } from 'utils/common/platform';
const ManageWorkspace = () => {
const dispatch = useDispatch();
@@ -133,7 +134,7 @@ const ManageWorkspace = () => {
onClick={() => handleShowInFolder(workspace)}
>
<IconFolder size={14} strokeWidth={1.5} />
<span>Show in folder</span>
<span>{getRevealInFolderLabel()}</span>
</button>
)}
{!isDefault && (

View File

@@ -49,6 +49,7 @@ import { isTabForItemActive as isTabForItemActiveSelector, isTabForItemPresent a
import { isEqual } from 'lodash';
import { calculateDraggedItemNewPathname, getInitialExampleName, findParentItemInCollection } from 'utils/collections/index';
import { sortByNameThenSequence } from 'utils/common/index';
import { getRevealInFolderLabel } from 'utils/common/platform';
import CreateExampleModal from 'components/ResponseExample/CreateExampleModal';
import { openDevtoolsAndSwitchToTerminal } from 'utils/terminal';
import ActionIcon from 'ui/ActionIcon';
@@ -345,12 +346,6 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText })
leftSection: IconEdit,
label: 'Rename',
onClick: () => setRenameItemModalOpen(true)
},
{
id: 'show-in-folder',
leftSection: IconFolder,
label: 'Show in Folder',
onClick: handleShowInFolder
}
);
if (!isFolder && isItemARequest(item) && !(item.type === 'http-request' || item.type === 'graphql-request')) {
@@ -382,6 +377,15 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText })
});
}
items.push(
{
id: 'show-in-folder',
leftSection: IconFolder,
label: getRevealInFolderLabel(),
onClick: handleShowInFolder
}
);
items.push({ id: 'separator-1', type: 'divider' });
items.push({

View File

@@ -44,6 +44,7 @@ import ShareCollection from 'components/ShareCollection/index';
import GenerateDocumentation from './GenerateDocumentation';
import { CollectionItemDragPreview } from './CollectionItem/CollectionItemDragPreview/index';
import { sortByNameThenSequence } from 'utils/common/index';
import { getRevealInFolderLabel } from 'utils/common/platform';
import { openDevtoolsAndSwitchToTerminal } from 'utils/terminal';
import ActionIcon from 'ui/ActionIcon';
import MenuDropdown from 'ui/MenuDropdown';
@@ -360,7 +361,7 @@ const Collection = ({ collection, searchText }) => {
{
id: 'show-in-folder',
leftSection: IconFolder,
label: 'Show in File Explorer',
label: getRevealInFolderLabel(),
onClick: handleShowInFolder
},
{

View File

@@ -10,6 +10,7 @@ import WorkspaceEnvironments from './WorkspaceEnvironments';
import WorkspaceTabs from 'components/WorkspaceTabs';
import StyledWrapper from './StyledWrapper';
import Dropdown from 'components/Dropdown';
import { getRevealInFolderLabel } from 'utils/common/platform';
const WorkspaceHome = () => {
const dispatch = useDispatch();
@@ -225,7 +226,7 @@ const WorkspaceHome = () => {
</div>
<div className="dropdown-item" onClick={handleShowInFolder}>
<IconFolder size={16} strokeWidth={1.5} />
<span>Show in Folder</span>
<span>{getRevealInFolderLabel()}</span>
</div>
<div className="dropdown-item" onClick={handleExportWorkspace}>
<IconUpload size={16} strokeWidth={1.5} />

View File

@@ -40,6 +40,12 @@ export const isLinuxOS = () => {
return osFamily.includes('linux') || osFamily.includes('ubuntu') || osFamily.includes('debian') || osFamily.includes('fedora') || osFamily.includes('centos') || osFamily.includes('arch');
};
export const getRevealInFolderLabel = () => {
if (isMacOS()) return 'Reveal in Finder';
if (isWindowsOS()) return 'Reveal in File Explorer';
return 'Reveal in File Manager';
};
export const getAppInstallDate = () => {
let dateString = localStorage.getItem('bruno.installedOn');