Skip to content

Commit 35a219c

Browse files
committed
🐛 修复最近打开面板文件名称过长的bug
1 parent a09c865 commit 35a219c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

app/src/pages/_fixed_panel/_start_file_panel.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export default function StartFilePanel({ open = false }: { open: boolean }) {
229229
{isPanelTransparent ? <Eye /> : <EyeClosed />}
230230
</IconButton>
231231
</div>
232-
<table className="overflow-hidden rounded-lg border border-gray-600 bg-gray-700 shadow-lg">
232+
<table className="bg-panel-bg overflow-hidden rounded-lg border border-gray-600 shadow-lg">
233233
<thead>
234234
{/* <tr className="text-white">
235235
<th className="mx-4 py-2 text-left">状态</th>
@@ -240,15 +240,13 @@ export default function StartFilePanel({ open = false }: { open: boolean }) {
240240
</thead>
241241
<tbody>
242242
{startFiles.map((file) => (
243-
<tr key={file.path} className={cn("border-b border-gray-600 p-2 text-gray-200")}>
243+
<tr key={file.path} className={cn("text-panel-text border-icon-button-border border-b p-2")}>
244244
<td className="w-10 text-center">
245245
<div className="inline-block animate-bounce">{currentStartFile === file.path ? "📌" : ""}</div>
246246
</td>
247-
<td>
248-
<div className="flex flex-col">
249-
<span className={currentFile === file.path ? "text-green-400" : ""}>
250-
{PathString.absolute2file(file.path)}
251-
</span>
247+
<td className="">
248+
<div className="flex w-64 flex-col">
249+
<span className={cn("truncate")}>{PathString.absolute2file(file.path)}</span>
252250
{isShowAbsolutePath && <span className="text-xs text-gray-500">{file.path}</span>}
253251
</div>
254252
</td>
@@ -266,10 +264,12 @@ export default function StartFilePanel({ open = false }: { open: boolean }) {
266264
})}
267265
</td>
268266
)}
269-
<td className="flex justify-center">
270-
<button className="mx-0.5 px-2 py-1 hover:cursor-pointer" onClick={onLoadCurrentStartFile(file.path)}>
271-
<HardDriveDownload className="hover:cursor-pointer" />
272-
</button>
267+
<td className="flex justify-end">
268+
{currentFile !== file.path && (
269+
<button className="mx-0.5 px-2 py-1 hover:cursor-pointer" onClick={onLoadCurrentStartFile(file.path)}>
270+
<HardDriveDownload className="hover:cursor-pointer" />
271+
</button>
272+
)}
273273
<button className="mx-0.5 px-2 py-1 hover:cursor-pointer" onClick={onSetCurrentStartFile(file.path)}>
274274
{currentStartFile === file.path ? (
275275
<Pin className="hover:cursor-pointer" />

0 commit comments

Comments
 (0)