Skip to content

Comments

Added delete feature and text viewer functionality#131

Open
dayal18 wants to merge 1 commit intomifi:masterfrom
dayal18:feature/file-delete-and-text-file-viewer
Open

Added delete feature and text viewer functionality#131
dayal18 wants to merge 1 commit intomifi:masterfrom
dayal18:feature/file-delete-and-text-file-viewer

Conversation

@dayal18
Copy link

@dayal18 dayal18 commented Feb 13, 2026

This PR introduces two major features to improve file management and usability.

🚀 New Features

  1. File Deletion

Backend: Added a new DELETE /api/delete endpoint in packages/lib that securely removes files using fs.unlink. It includes path validation to prevent directory traversal attacks.

Frontend: Added a generic onDelete prop to the FileRow component in web/src/routes/dir/$dirId.tsx.

UI: A "Delete" (Trash) icon now appears next to files in the browser list. Clicking it triggers a confirmation prompt before deletion.

  1. Text File Viewer

Detection: Added mightBeText utility in web/src/util.ts to detect common text/code extensions (.txt, .md, .json, .js, etc.).

UI: Text files are now clickable in the file browser.

Viewer: The file viewer modal (web/src/routes/dir/$dirId/file.tsx) now supports fetching and displaying text content in a scrollable, dark-themed code block.

UX: Added user-select: text and proper zIndex handling to ensure text content is selectable and copyable, fixing issues with overlapping UI controls.

@dayal18
Copy link
Author

dayal18 commented Feb 13, 2026

#130

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant