Skip to content

Commit

Permalink
Address issues from QA
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFlashAccount committed Dec 25, 2024
1 parent 62febdd commit ab9c645
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/common/src/text/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@
"enableVersionCheckerDescription": "Show a dialog if the current version of the desktop app does not match the latest version.",
"disableAnimations": "Disable animations",
"disableAnimationsDescription": "Disable all animations in the app.",
"removeTheLocalDirectoryXFromFavorites": "remove the local folder '$0' from your favorites",
"removeTheLocalDirectoryXFromFavorites": "remove the local folder '$0' from your sidebar",
"changeLocalRootDirectoryInSettings": "Change the root folder",
"localStorage": "Local Storage",
"addLocalDirectory": "Add Folder",
Expand Down
19 changes: 10 additions & 9 deletions app/gui/src/dashboard/components/Devtools/EnsoDevtools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ export function EnsoDevtools() {
return (
<Portal>
<ariaComponents.DialogTrigger>
<ariaComponents.Button
icon={DevtoolsLogo}
aria-label={getText('ensoDevtoolsButtonLabel')}
variant="icon"
rounded="full"
size="hero"
className="fixed bottom-16 right-3 z-50"
data-ignore-click-outside
/>
<ariaComponents.Underlay className="fixed bottom-16 right-3 z-50 rounded-full">
<ariaComponents.Button
icon={DevtoolsLogo}
aria-label={getText('ensoDevtoolsButtonLabel')}
variant="icon"
rounded="full"
size="hero"
data-ignore-click-outside
/>
</ariaComponents.Underlay>

<Popover>
<Text.Heading disableLineHeightCompensation>
Expand Down
3 changes: 3 additions & 0 deletions app/gui/src/dashboard/layouts/CategorySwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ function CategorySwitcher(props: CategorySwitcherProps) {
buttonLabel={getText('localCategoryButtonLabel')}
dropZoneLabel={getText('localCategoryDropZoneLabel')}
/>

<ariaComponents.DialogTrigger>
<ariaComponents.Button
size="medium"
Expand All @@ -370,6 +371,7 @@ function CategorySwitcher(props: CategorySwitcherProps) {
aria-label={getText('removeDirectoryFromFavorites')}
className="hidden group-hover:block"
/>

<ConfirmDeleteModal
actionText={getText('removeTheLocalDirectoryXFromFavorites', directory.label)}
actionButtonLabel={getText('remove')}
Expand All @@ -380,6 +382,7 @@ function CategorySwitcher(props: CategorySwitcherProps) {
</ariaComponents.DialogTrigger>
</div>
))}

{directories != null && window.fileBrowserApi && (
<div className="flex">
<div className="ml-[15px] mr-1.5 rounded-full border-r border-primary/20" />
Expand Down
2 changes: 1 addition & 1 deletion app/gui/src/dashboard/layouts/Drive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ function DriveAssetsView(props: DriveAssetsViewProps) {
/>

<div className="flex flex-1 gap-drive overflow-hidden">
<div className="flex w-36 flex-none flex-col gap-drive-sidebar overflow-y-auto overflow-x-hidden py-drive-sidebar-y">
<div className="flex w-40 flex-none flex-col gap-drive-sidebar overflow-y-auto overflow-x-hidden py-drive-sidebar-y">
<CategorySwitcher category={category} setCategoryId={setCategory} />

{isCloud && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,12 @@ export function useLocalCategoryList() {
setLocalRootDirectories([...localRootDirectories, directory])
})

const removeDirectory = useEventCallback((directory: string) => {
setLocalRootDirectories(localRootDirectories.filter((d) => d !== directory))
const removeDirectory = useEventCallback((directory: DirectoryId) => {
const category = getCategoryById(directory)

if (category != null && category.type === 'local-directory') {
setLocalRootDirectories(localRootDirectories.filter((d) => d !== category.rootPath))
}
})

const getCategoryById = useEventCallback((id: CategoryId) => {
Expand Down
3 changes: 2 additions & 1 deletion app/gui/src/dashboard/modals/ConfirmDeleteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ export default function ConfirmDeleteModal(props: ConfirmDeleteModalProps) {
<Text className="relative">{getText('confirmPrompt', actionText)}</Text>

<ButtonGroup>
<Form.Submit variant="delete" className="relative">
<Form.Submit variant="delete" className="relative" autoFocus>
{actionButtonLabel}
</Form.Submit>

<DialogDismiss />
</ButtonGroup>
</Form>
Expand Down

0 comments on commit ab9c645

Please sign in to comment.