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 23 additions and 9 deletions

No files matched your search

+11 -5
View File
@@ -2,13 +2,19 @@
"$schema": "../gen/schemas/desktop-schema.json", "$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default", "identifier": "default",
"description": "Capability for the main window", "description": "Capability for the main window",
"windows": [ "windows": ["main"],
"main"
],
"permissions": [ "permissions": [
"core:default", "core:default",
"shell:default", "shell:default",
"dialog: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) 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 { map.entry(parent.to_string()).or_default().push(FileInfo {
name: name.to_string(), name: name.to_string(),
+11 -3
View File
@@ -12,7 +12,7 @@ import {
import { v5 as uuidv5 } from 'uuid' import { v5 as uuidv5 } from 'uuid'
import prettyBytes from 'pretty-bytes' import prettyBytes from 'pretty-bytes'
import { ask, message, open } from '@tauri-apps/plugin-dialog' 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 { interface Disk {
name: string 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' 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={() => { onClick={() => {
if (f.is_dir) setCurrentPath(f.path) if (f.is_dir) setCurrentPath(f.path)
else openPath(f.path)
}} }}
title={f.is_dir ? undefined : 'Click to open the file'}
> >
<p> <p>
<FontAwesomeIcon <FontAwesomeIcon
@@ -196,7 +198,10 @@ export default function App () {
{f.name} {f.name}
</p> </p>
<div className='flex flex-row gap-2 items-center'> <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 <FontAwesomeIcon
icon={faFolderOpen} icon={faFolderOpen}
className='text-white/60 hover:text-white/75 transition-all hover:scale-110' className='text-white/60 hover:text-white/75 transition-all hover:scale-110'
@@ -206,7 +211,10 @@ export default function App () {
}} }}
/> />
</div> </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 <FontAwesomeIcon
icon={faTrashCan} icon={faTrashCan}
className='text-red-500/60 hover:text-red-500/75 transition-all hover:scale-110' className='text-red-500/60 hover:text-red-500/75 transition-all hover:scale-110'