Skip to content

fix: Improve preferences data access folders input UX with validation and guidance#9649

Merged
shelby-moore merged 6 commits intoKong:developfrom
miycctwn:fix/add-input-value-check-to-folders-access
Feb 13, 2026
Merged

fix: Improve preferences data access folders input UX with validation and guidance#9649
shelby-moore merged 6 commits intoKong:developfrom
miycctwn:fix/add-input-value-check-to-folders-access

Conversation

@miycctwn
Copy link
Contributor

@miycctwn miycctwn commented Feb 9, 2026

Summary

Improves the UX of the "File Access" data folders setting (Preferences → General → Security -> "What folders can Insomnia access?") to address confusion reported in #9064 (specifically this comment), where users found the Add button misleading — it wasn't clear that a path must be entered first, and clicking Add with an empty input silently did nothing.

This PR does not close #9064 (which covers broader file access UX concerns) but addresses the specific input usability pain points discussed there.

Changes

  • On-click validation for empty input: Clicking Add with an empty input now shows a red-bordered input with the message "Enter a folder path to add." instead of silently doing nothing.
  • Duplicate folder path validation: If the user enters a path that already exists in the list and clicks Add, the input is
    highlighted with a red border and a "Duplicate folders are not allowed." message is shown — preventing duplicate entries.
  • Trailing slash normalization: Paths like /Users/foo and /Users/foo/ are as duplicates by stripping trailing slashes before comparison.
  • Validation clears on edit: The error state is dismissed as soon as the user modifies the input.
  • Placeholder example: Added a placeholder (e.g., /Users/folder1) to the data folders input to guide users on the expected
    format.
Screen.Recording.2026-02-09.at.17.57.57.mov

Related to #9064

@CLAassistant
Copy link

CLAassistant commented Feb 9, 2026

CLA assistant check
All committers have signed the CLA.

@miycctwn miycctwn force-pushed the fix/add-input-value-check-to-folders-access branch from 2340dfa to 0913cab Compare February 9, 2026 23:28
@miycctwn miycctwn marked this pull request as ready for review February 9, 2026 23:38
return;
}
const normalizedValue = validValue.replace(/\/+$/, '') || validValue;
const exists = currentValue.some(v => (v.replace(/\/+$/, '') || v) === normalizedValue);
Copy link
Contributor

Choose a reason for hiding this comment

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

A few concerns with these regex replaces:

  • if validValue is something like ///, the regex replace will output an empty string, which will cause a fallback and /// to be stored
  • The regex makes sense for unix style paths, but it's not compatible with windows

An alternative here could perhaps be a combination of path.normalize (to collapse duplicate separators and resolve ./.. segments) and stripping trailing separators with /[/\\]+$/ to handle both platforms.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @shelby-moore ,
Great catch! I initially overlooked Windows path handling. Thanks for the suggestions and these give me ideas to add unit tests for the path handler function normalizeFolderPath to ensure covering different OS systems and UX error messaging for invalid paths.

The fix has been pushed! Please take another look whenever you have time. Thank you.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Love the addition of tests :)

@miycctwn miycctwn force-pushed the fix/add-input-value-check-to-folders-access branch from bafdf81 to 43cb795 Compare February 12, 2026 03:23
Copy link
Contributor

@shelby-moore shelby-moore left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution, @miycctwn! 🚀

@shelby-moore shelby-moore enabled auto-merge (squash) February 12, 2026 17:24
Add visual feedback when users attempt to add duplicate folder paths:
 - Red border on input field when duplicate is detected
 - Red warning message "Duplicate folders are not allowed." displayed below input
 - Add button is disabled when a duplicate path is entered
…mpty tooltip

- Strip trailing slashes before comparing folder paths so /Users/foo and /Users/foo/ are detected as duplicates
- Add isDisabled prop to Tooltip component to suppress hover when message is empty, avoiding tooltip remount of the Add button
Remove tooltip and instead show red input border with error message when clicking Add with empty or duplicate paths.
Revert tooltip.tsx isDisabled prop as it's no longer needed.
@shelby-moore shelby-moore force-pushed the fix/add-input-value-check-to-folders-access branch from 43cb795 to 79516ef Compare February 12, 2026 23:40
@shelby-moore shelby-moore merged commit f96bcd7 into Kong:develop Feb 13, 2026
10 of 11 checks passed
@miycctwn miycctwn deleted the fix/add-input-value-check-to-folders-access branch February 16, 2026 17:38
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.

Insomnia cannot access the file ... . You can adjust this in Preferences → Security.

3 participants