Skip to content

VPS-96/Allowed renaming of resources in edit view#413

Open
kmck133 wants to merge 2 commits into
masterfrom
VPS-96/change-resource-name
Open

VPS-96/Allowed renaming of resources in edit view#413
kmck133 wants to merge 2 commits into
masterfrom
VPS-96/change-resource-name

Conversation

@kmck133
Copy link
Copy Markdown
Contributor

@kmck133 kmck133 commented May 26, 2026

Issue

After uploading a resource, there was no way to rename it. Users were stuck with the original filename even if it was unclear or incorrect.

Solution

Added the ability to rename uploaded resources from the collections sidebar in the manage resources view. A pencil icon appears next to each file; clicking it replaces the filename with an inline input field. The user can confirm with Enter or the checkmark button, or cancel with Escape or the X button.
This required a new PATCH /api/files/:fileId endpoint on the backend that validates and updates the name field on StoredFile. The frontend calls this endpoint, then updates both the sidebar list and the active preview panel (if the renamed file is currently selected) without a page reload.

Risk

  • Low. Renaming a resource updates the display name in StoredFile but not the filename stored in GridFS. This is intentional, as the application always resolves filenames through StoredFile.name (including when downloading the resource), so there is no functional impact. The divergence is only visible when inspecting the raw resources.files collection in MongoDB directly.
  • The new PATCH /:fileId route sits alongside the existing DELETE /:fileId route with no ambiguity since they use different HTTP methods.

@linear
Copy link
Copy Markdown

linear Bot commented May 26, 2026

VPS-96

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