feat(ui): add one-click texts, file existence checks, clipboard copy (#15)

* feat(ui): add one-click texts, file existence checks, clipboard copy

* refactor(ui): remove unused clearCompleted and adjust card bg
This commit is contained in:
Nexmoe
2025-11-08 13:44:28 +08:00
committed by GitHub
parent 2f5776d1e0
commit 7c2e526c49
7 changed files with 138 additions and 92 deletions

View File

@@ -229,6 +229,25 @@ class FileSystemService extends IpcService {
.replace(/'/g, ''')
}
@IpcMethod()
async fileExists(_context: IpcContext, filePath: string): Promise<boolean> {
try {
if (!filePath) {
return false
}
const sanitizedPath = this.sanitizePath(filePath)
const normalizedPath = path.normalize(sanitizedPath)
const stats = await fs.stat(normalizedPath).catch(() => null)
return stats?.isFile() ?? false
} catch (error) {
console.error('Failed to check file existence:', error)
return false
}
}
@IpcMethod()
async deleteFile(_context: IpcContext, filePath: string): Promise<boolean> {
try {