Skip to content

Commit 8716944

Browse files
committed
fixed layout to match across miller and grid layout
1 parent e84bd6b commit 8716944

File tree

7 files changed

+226
-291
lines changed

7 files changed

+226
-291
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "filedime",
3-
"version": "0.9.52",
3+
"version": "0.9.53",
44
"private": true,
55
"engines": {
66
"node": "20.x"

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "filedime"
3-
version = "0.9.52"
3+
version = "0.9.53"
44
description = "rust based file explorer."
55
authors = ["visnk"]
66
license = ""

src-tauri/tauri.conf.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"withGlobalTauri": true
88
},
99
"package": {
10-
"productName": "filedime",
11-
"version": "0.9.52"
10+
"productName": "filedime"
1211
},
1312
"tauri": {
1413
"allowlist": {

src/components/greet.tsx

Lines changed: 3 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ import { ToastAction } from "./ui/toast";
8585
import Link from "next/link";
8686
import MillerCol from "./millercol";
8787
import GPTchatinterface from "./gptchatinterface";
88-
let supportedfiles = [
88+
import EachFromGrid from "./grideach";
89+
export let supportedfiles = [
8990
"csv",
9091
"xlsx",
9192
"xls",
@@ -2080,162 +2081,7 @@ export default function Greet() {
20802081
.slice(currentpage*perpage,((currentpage)+1)*perpage)
20812082
.map((message, index) => (
20822083
<div key={index} className="m-3 flex flex-row">
2083-
<Button size={"none"} variant={"outline"} className="relative m-0 h-full w-full flex justify-start overflow-hidden focus:bg-gray-200 focus:dark:bg-gray-700">
2084-
2085-
<ContextMenu >
2086-
<ContextMenuTrigger className="h-full w-full overflow-hidden">
2087-
<HoverCard >
2088-
<HoverCardTrigger className="h-full w-full">
2089-
<span className="flex justify-items-center w-full h-full p-6 overflow-hidden" onDoubleClick={
2090-
()=>
2091-
{
2092-
goto(message)
2093-
}
2094-
}>
2095-
<div className="w-full">
2096-
<div className={`w-full ${showthumbnail?"":"hidden"}`}>
2097-
{![...IMAGE_TYPES,...VIDEO_TYPES].some(type => message.name.includes(type))?<div
2098-
className={`flex bg-gray-200 dark:bg-slate-500 w-full place-items-center h-[200px] overflow-${scrollorauto}`}
2099-
></div>:""}
2100-
{IMAGE_TYPES.some(type => message.name.includes(type))?(
2101-
<div
2102-
className={`flex bg-gray-200 dark:bg-slate-500 w-full place-items-center h-[200px] overflow-${scrollorauto}`}
2103-
>
2104-
<LazyLoadImage
2105-
className="w-full object-fill"
2106-
src={`${convertFileSrc(message.path)}`}/></div>
2107-
2108-
):""}
2109-
{VIDEO_TYPES.some(type => message.name.includes(type))?(
2110-
<VideoComponent path={message.path} hoverplay={true}/>):""}
2111-
</div>
2112-
<div className="flex flex-row justify-start gap-3 items-center">
2113-
2114-
<div className="overflow-visible">
2115-
2116-
{message.is_dir?<Folder className="h-6 w-6" />:<FileIcon className="h-6 w-6" />}
2117-
</div>
2118-
<div className="w-full flex justify-between overflow-hidden">
2119-
2120-
<span className="font-medium text-lg overflow-hidden">{message.name}{message.foldercon>0 ? "(" + message.foldercon + ")" : ""}</span>
2121-
2122-
</div>
2123-
</div>
2124-
</div>
2125-
</span>
2126-
2127-
</HoverCardTrigger>
2128-
<HoverCardContent className={`${setcolorpertheme} flex flex-col text-center`} >
2129-
{message.name}
2130-
<br/>
2131-
{message.path}
2132-
<br/>
2133-
{`${message.foldercon>0?`Contains ${message.foldercon} ${message.is_dir?"files":"lines"}`:""}`}
2134-
<br/>
2135-
{converttstodt(message.timestamp)}
2136-
<FRc location={message.path} size={message.size} rawsize={message.rawfs}/>
2137-
<br/>
2138-
{<button onClick={()=>{
2139-
let fi:FileItem={
2140-
name: "",
2141-
path: message.parent,
2142-
is_dir: true,
2143-
size: 0,
2144-
rawfs: 0,
2145-
lmdate: 0,
2146-
timestamp: 0,
2147-
foldercon: 0,
2148-
ftype: "",
2149-
parent: "",
2150-
}
2151-
goto(fi)
2152-
}}>Open file location</button>}
2153-
</HoverCardContent>
2154-
</HoverCard>
2155-
2156-
2157-
</ContextMenuTrigger>
2158-
<ContextMenuContent className=''>
2159-
<p className='text-sm'>{message.path}</p>
2160-
<ContextMenuItem onSelect={(e)=>{
2161-
invoke("newwindow",
2162-
{
2163-
path: message.path,
2164-
ff:""
2165-
});
2166-
2167-
}}>Open in new window</ContextMenuItem>
2168-
<ContextMenuItem onSelect={(e)=>{
2169-
newtab(message.path)
2170-
}}>Open in new tab</ContextMenuItem>
2171-
<ContextMenuItem onSelect={()=>{
2172-
invoke(
2173-
"addmark",
2174-
{
2175-
windowname:appWindow?.label,
2176-
path: message.path,
2177-
id:new Date().getTime().toString()
2178-
}
2179-
);
2180-
}}>Add bookmark</ContextMenuItem>
2181-
<ContextMenuItem onSelect={(e)=>{
2182-
useEffect(() => {
2183-
if (typeof window !== 'undefined'){
2184-
2185-
try {
2186-
navigator.clipboard.writeText(message.path);
2187-
console.log('Content copied to clipboard');
2188-
} catch (err) {
2189-
console.error('Failed to copy: ', err);
2190-
}
2191-
}
2192-
},[])}}
2193-
>Copy path to clipboard</ContextMenuItem>
2194-
<ContextMenuItem onSelect={(e)=>{
2195-
setfos((old)=>[...old,message.path])
2196-
}}>Copy</ContextMenuItem>
2197-
</ContextMenuContent>
2198-
</ContextMenu>
2199-
<div className="absolute end-0 ">
2200-
2201-
{!message.is_dir
2202-
// &&
2203-
// [...MARKDOWN_TYPES,...PLAIN_TEXT,...IMAGE_TYPES,...].some(type => message.path.includes(type))
2204-
// &&(message.name.includes(".pdf")||IMAGE_TYPES.some(type => message.name.includes(type))||HTML_TYPE.some(type => message.name.includes(type))||AUDIO_TYPES.some(type => message.name.includes(type)))
2205-
?(
2206-
<Sheet modal={false}>
2207-
<SheetTrigger className="h-full px-3 p-4 focus:bg-gray-200 focus:dark:bg-gray-700">
2208-
<HoverCard>
2209-
<HoverCardTrigger>
2210-
<EyeIcon className="h-4 w-4 "/>
2211-
</HoverCardTrigger>
2212-
<HoverCardContent className={`${setcolorpertheme}`}>
2213-
Preview
2214-
</HoverCardContent>
2215-
</HoverCard>
2216-
</SheetTrigger>
2217-
<SheetContent
2218-
className={`${setcolorpertheme} h-[90%] overflow-hidden`} side={"right"} onPointerDownOutside={(e) => e.preventDefault()} onInteractOutside={(e) => e.preventDefault()}>
2219-
<ReadFileComp message={message}/>
2220-
</SheetContent>
2221-
</Sheet>):(
2222-
<div className="">
2223-
<HoverCard>
2224-
2225-
<HoverCardTrigger>
2226-
<Button className="h-full p-4 px-3 focus:bg-gray-200 focus:dark:bg-gray-700" size={"none"} variant={"ghost"} onClick={()=>{
2227-
2228-
populatesearchlist(message.path)
2229-
}}><ScanSearchIcon className="h-4 w-4"/></Button>
2230-
</HoverCardTrigger>
2231-
<HoverCardContent className={`${setcolorpertheme}`}>
2232-
Load folder contents to search
2233-
</HoverCardContent>
2234-
</HoverCard>
2235-
</div>
2236-
)}
2237-
</div>
2238-
</Button>
2084+
<EachFromGrid message={message} goto={goto} populatesearchlist={populatesearchlist} newtab={newtab} setfos={setfos} showthumbnail={showthumbnail} appWindow={appWindow}/>
22392085
</div>
22402086

22412087
))}

0 commit comments

Comments
 (0)