Skip to content

fix(file-browser): Enforce non-empty input in rename prompt - #2560

Draft
AuDevTist1C wants to merge 1 commit into
Acode-Foundation:mainfrom
AuDevTist1C:refactor/file-browser-rename-logic
Draft

AuDevTist1C wants to merge 1 commit into
Acode-Foundation:mainfrom
AuDevTist1C:refactor/file-browser-rename-logic

Conversation

@AuDevTist1C

@AuDevTist1C AuDevTist1C commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

This PR introduces explicit non-empty input enforcement to the file and folder rename prompt in fileBrowser.js, preventing users from accidentally submitting empty strings or blank file names.


Changes

  • Added required: true configuration option to the rename prompt parameter object.
  • Prevents the dialog from accepting empty string ("") submissions prior to executing file operations.
  • Complements the existing regex boundary validation handled via match: config.FILE_NAME_REGEX, eliminating edge cases where empty inputs bypass client-side checks.
  • Improves overall input validation robustness and consistency across file management workflows.

(PR name and description are AI generated (Gemini 3.6 Flash))

@greptile-apps

greptile-apps Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low risk] Adds validation to the file rename dialog.

The PR appears safe to merge.

Summary

Adds required: true to the file-browser rename prompt so blank names are explicitly rejected before rename operations proceed.

Reviews (3) · Last reviewed commit: "fix(file-browser): Enforce non-empty inp..." · Reviewed by Greptile

Comment thread src/pages/fileBrowser/fileBrowser.js

@bajrangCoder bajrangCoder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enter bypasses the new required validation.
FILE_NAME_REGEX accepts an empty string, so clearing the field enables submission. Pressing Enter runs prompt onsubmit, which resolves "" without checking options.required or hiding the prompt. The rename is cancelled by the caller, but the dialog remains in a resolved, non-functional state.

@AuDevTist1C
AuDevTist1C force-pushed the refactor/file-browser-rename-logic branch from 8380be3 to cf04325 Compare August 5, 2026 02:48
@AuDevTist1C
AuDevTist1C force-pushed the refactor/file-browser-rename-logic branch from 30873f3 to 6ce70f4 Compare August 14, 2026 08:49
@AuDevTist1C
AuDevTist1C force-pushed the refactor/file-browser-rename-logic branch 3 times, most recently from 3cf8973 to fc1cf4a Compare August 14, 2026 16:15
@bajrangCoder

This comment was marked as outdated.

@RohitKushvaha01 RohitKushvaha01 added the needs info / awaiting response The issue needs more information from the user before proceeding. label Aug 25, 2026
- Enforce `required: true` on the file/folder rename prompt to prevent empty inputs.
- Prevent submitting empty string values prior to file operation execution.

(AI generated commit message)
@AuDevTist1C AuDevTist1C changed the title refactor(file-browser): consolidate rename logic and prevent empty file names fix(file-browser): Enforce non-empty input in rename prompt Oct 8, 2026
@AuDevTist1C
AuDevTist1C force-pushed the refactor/file-browser-rename-logic branch from fc1cf4a to 8903fc8 Compare October 8, 2026 07:29
@AuDevTist1C
AuDevTist1C marked this pull request as draft October 8, 2026 07:30
@github-actions github-actions Bot removed the stale label Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community needs info / awaiting response The issue needs more information from the user before proceeding.

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

4 participants