diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 66ad231..c5178b9 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -14,7 +14,7 @@ {"id":"smartfiles-9n1","title":"Inconsistent null handling in archive operations","description":"Some methods check for null (e.g., deleteDocument line 116), while others don't (e.g., addTag line 87, updateDescription line 97). If an invalid UUID is passed, these will throw NPE.\n\n**File:** ArchiveServiceImpl.java (lines 87, 97)\n\n**Fix:** Add consistent null checks or use Optional pattern across all archive operations.","status":"open","priority":2,"issue_type":"bug","created_at":"2026-01-15T22:36:29.026652+01:00","created_by":"abedurftig","updated_at":"2026-01-15T22:36:29.026652+01:00"} {"id":"smartfiles-a16","title":"File copy failures provide no user feedback","description":"In ArchiveServiceImpl.manageFiles() (lines 50-58), IOExceptions during file copy are caught and re-thrown as RuntimeException. This crashes the entire operation for multiple files if one fails, and provides no user-friendly error handling.\n\n**Fix:** \n1. Continue processing remaining files if one fails\n2. Collect failures and report them to user\n3. Consider publishing an error event for the UI to display","status":"open","priority":2,"issue_type":"bug","created_at":"2026-01-15T22:35:42.875305+01:00","created_by":"abedurftig","updated_at":"2026-01-15T22:35:42.875305+01:00"} {"id":"smartfiles-blx","title":"FileAlreadyExistsException when importing duplicate filenames","description":"In ArchiveServiceImpl.manageFiles() (line 52), Files.copy() is called without specifying behavior for existing files. If a file with the same name already exists in the archive, this will throw FileAlreadyExistsException.\n\n**Fix:** Either:\n1. Use REPLACE_EXISTING option\n2. Generate unique filename (add suffix)\n3. Prompt user for action","status":"open","priority":2,"issue_type":"bug","created_at":"2026-01-15T22:36:23.292807+01:00","created_by":"abedurftig","updated_at":"2026-01-15T22:36:23.292807+01:00"} -{"id":"smartfiles-bvs","title":"Path separator hardcoded breaks Windows compatibility","description":"ArchiveEntry.of() (line 29) uses hardcoded '/' to extract filename: absolutePath.substring(absolutePath.lastIndexOf('/') + 1). This will fail on Windows where paths use backslashes.\n\nMeanwhile, SmartFilesConfiguration.java correctly uses FileSystems.getDefault().getSeparator().\n\n**Fix:** Use File.separator or Path.getFileName() instead of hardcoded '/'.","status":"open","priority":2,"issue_type":"bug","created_at":"2026-01-15T22:36:11.37771+01:00","created_by":"abedurftig","updated_at":"2026-01-15T22:36:11.37771+01:00"} +{"id":"smartfiles-bvs","title":"Path separator hardcoded breaks Windows compatibility","description":"ArchiveEntry.of() (line 29) uses hardcoded '/' to extract filename: absolutePath.substring(absolutePath.lastIndexOf('/') + 1). This will fail on Windows where paths use backslashes.\n\nMeanwhile, SmartFilesConfiguration.java correctly uses FileSystems.getDefault().getSeparator().\n\n**Fix:** Use File.separator or Path.getFileName() instead of hardcoded '/'.","status":"in_progress","priority":2,"issue_type":"bug","created_at":"2026-01-15T22:36:11.37771+01:00","created_by":"abedurftig","updated_at":"2026-01-16T21:19:08.195676+01:00"} {"id":"smartfiles-djt","title":"Missing test coverage for UI components","description":"There are no tests for:\n- ApplicationViewBuilder\n- ApplicationInteractor\n- DocumentView\n- PdfImageRenderer\n- TagFilterView\n- WrappingListView\n- DocumentListCell\n- TagListCell\n\nWhile UI testing can be complex, at minimum the ApplicationInteractor event handling logic should be unit tested.\n\n**Fix:** Add unit tests for ApplicationInteractor event handling. Consider TestFX for UI component tests.","status":"open","priority":3,"issue_type":"task","created_at":"2026-01-15T22:37:10.739326+01:00","created_by":"abedurftig","updated_at":"2026-01-15T22:37:10.739326+01:00"} {"id":"smartfiles-h74","title":"PDDocument resources never closed causing memory leak","description":"In PdfImageRenderer.java, PDDocument objects are loaded but never closed. The renderers HashMap in DocumentView.java caches PdfImageRenderer instances indefinitely. \n\nPDFBox documents hold native resources that should be explicitly closed to prevent memory leaks, especially when opening many different PDFs.\n\n**Files:**\n- PdfImageRenderer.java (line 22-25)\n- DocumentView.java (line 26)\n\n**Fix:** Implement proper resource lifecycle management. Consider:\n1. Closing PDDocument when switching documents\n2. Implementing a cache eviction strategy\n3. Using try-with-resources or explicit close on application exit","status":"closed","priority":1,"issue_type":"bug","created_at":"2026-01-15T22:32:53.008106+01:00","created_by":"abedurftig","updated_at":"2026-01-16T21:14:06.002691+01:00","closed_at":"2026-01-16T21:14:06.002691+01:00","close_reason":"Closed"} {"id":"smartfiles-hj5","title":"Display the dateCreated and dateLastModified of the archive itself","description":"Create a footer area across the full width and display the dateCreated and dateLastModified of the Archive itself","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-01-07T21:33:33.098999+01:00","created_by":"abedurftig","updated_at":"2026-01-07T21:53:02.388736+01:00","closed_at":"2026-01-07T21:53:02.38875+01:00"} diff --git a/src/main/java/dev/arne/smartfiles/core/model/ArchiveEntry.java b/src/main/java/dev/arne/smartfiles/core/model/ArchiveEntry.java index da49d62..9ef4c32 100644 --- a/src/main/java/dev/arne/smartfiles/core/model/ArchiveEntry.java +++ b/src/main/java/dev/arne/smartfiles/core/model/ArchiveEntry.java @@ -1,5 +1,6 @@ package dev.arne.smartfiles.core.model; +import java.nio.file.Path; import java.time.LocalDateTime; import java.util.HashSet; import java.util.Set; @@ -27,7 +28,7 @@ public class ArchiveEntry { private LocalDateTime dateLastModified; public static ArchiveEntry of(String name, String absolutePath, String originalPath) { - var path = absolutePath.substring(absolutePath.lastIndexOf("/") + 1); + var path = Path.of(absolutePath).getFileName().toString(); var timeStamp = LocalDateTime.now(); return new ArchiveEntry(UUID.randomUUID(), name, "Not available yet", path, absolutePath, originalPath, new HashSet<>(), timeStamp, timeStamp); }