Compare commits

..
3 Commits
Author SHA1 Message Date
Lncvrt c339436d4c Add a way to open the item if it is a file 2026-04-15 15:11:29 -07:00
Lncvrt 72962af606 Add titles to delete/show item buttons 2026-04-15 15:10:02 -07:00
Lncvrt 13037f1e59 Fix dir/file type detection 2026-04-15 15:09:38 -07:00
3 changed files with 22 additions and 8 deletions

No files matched your search

+10 -4
View File
@@ -2,13 +2,19 @@
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": [
"main"
],
"windows": ["main"],
"permissions": [
"core:default",
"shell:default",
"dialog:default",
"opener:default"
"opener:default",
{
"identifier": "opener:allow-open-path",
"allow": [
{
"path": "**"
}
]
}
]
}
+1 -1
View File
@@ -102,7 +102,7 @@ fn stream(node: &serde_json::Value, parent: &str, map: &mut HashMap<String, Vec<
format!("{}/{}", parent, name)
};
let is_dir = children.as_ref().map(|c| !c.is_empty()).unwrap_or(false);
let is_dir = PathBuf::from(&path).is_dir();
map.entry(parent.to_string()).or_default().push(FileInfo {
name: name.to_string(),
+11 -3
View File
@@ -12,7 +12,7 @@ import {
import { v5 as uuidv5 } from 'uuid'
import prettyBytes from 'pretty-bytes'
import { ask, message, open } from '@tauri-apps/plugin-dialog'
import { revealItemInDir } from '@tauri-apps/plugin-opener'
import { openPath, revealItemInDir } from '@tauri-apps/plugin-opener'
interface Disk {
name: string
@@ -186,7 +186,9 @@ export default function App () {
className='flex justify-between px-2 py-1 cursor-pointer bg-(--col2)/50 hover:bg-(--col4)/50 border border-(--col4)/50 hover:border-(--col6)/50 transition-colors rounded-lg'
onClick={() => {
if (f.is_dir) setCurrentPath(f.path)
else openPath(f.path)
}}
title={f.is_dir ? undefined : 'Click to open the file'}
>
<p>
<FontAwesomeIcon
@@ -196,7 +198,10 @@ export default function App () {
{f.name}
</p>
<div className='flex flex-row gap-2 items-center'>
<div className='w-4 h-6 flex justify-center items-center'>
<div
className='w-4 h-6 flex justify-center items-center'
title={'Click to show the ' + f.is_dir ? 'folder' : 'file'}
>
<FontAwesomeIcon
icon={faFolderOpen}
className='text-white/60 hover:text-white/75 transition-all hover:scale-110'
@@ -206,7 +211,10 @@ export default function App () {
}}
/>
</div>
<div className='w-4 h-6 flex justify-center items-center'>
<div
className='w-4 h-6 flex justify-center items-center'
title={'Click to delete the ' + f.is_dir ? 'folder' : 'file'}
>
<FontAwesomeIcon
icon={faTrashCan}
className='text-red-500/60 hover:text-red-500/75 transition-all hover:scale-110'