Fix file tree clicks and redesign add-file UI on instructions tab

- Add onClick handler to file row div in PackageFileTree so clicks
  anywhere on the row select the file (not just the inner button)
- Replace "Add" button with compact "+" icon that reveals an inline
  input with Create/Cancel actions
- Hide file name input until "+" is clicked to reduce visual clutter
- Validate new file paths: reject ".." path traversal segments
- Change placeholder from "docs/TOOLS.md" to "TOOLS.md"

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta 2026-03-18 14:21:21 -05:00
parent b0524412c4
commit 58d7f59477
2 changed files with 61 additions and 23 deletions

View file

@ -286,6 +286,7 @@ export function PackageFileTree({
style={{
paddingInlineStart: `${TREE_BASE_INDENT + depth * TREE_STEP_INDENT - 8}px`,
}}
onClick={() => onSelectFile(node.path)}
>
{showCheckboxes && (
<label className="flex items-center pl-2">