Skip to content

Agent Zero AI framework

Reformat file browser markup and harden the DOX suggestion clause

linkliti4753de6f2a60
diff --git a/tests/test_file_browser_navigation.py b/tests/test_file_browser_navigation.py
index bb1d1d47a..a899680db 100644
--- a/tests/test_file_browser_navigation.py
+++ b/tests/test_file_browser_navigation.py
@@ -16,6 +16,11 @@ def read(*parts: str) -> str:
return PROJECT_ROOT.joinpath(*parts).read_text(encoding="utf-8")
+def flat(text: str) -> str:
+ """Collapse whitespace so CSS contract checks survive reformat-only edits."""
+ return " ".join(text.split())
+
+
def test_file_browser_remember_last_directory_defaults_enabled() -> None:
settings_source = read("helpers", "settings.py")
@@ -142,7 +147,7 @@ def test_file_browser_seamless_navigation_and_row_click_contract() -> None:
assert '@click="$store.fileBrowser.handleFileNameClick(file)"' in html
assert '<div class="file-name">' in html
- assert '.file-item {\n cursor: pointer;' in html
+ assert '.file-item { cursor: pointer;' in flat(html)
assert '<label class="file-select-cell" @click.stop>' in html
assert 'x-show="!$store.fileBrowser.isPickerMode()" @click.stop>' in html
@@ -180,13 +185,13 @@ def test_file_browser_compact_controls_and_narrow_layout_contract() -> None:
assert "btn-new-item" in html
assert "width: 32px;" in html
assert "height: 32px;" in html
- assert ".path-navigator {\n align-items: center;\n flex-direction: row;" in html
- assert ".path-navigator .nav-button-label {\n display: none;" in html
+ assert ".path-navigator { align-items: center; flex-direction: row;" in flat(html)
+ assert ".path-navigator .nav-button-label { display: none;" in flat(html)
assert "container: file-browser / inline-size;" in html
assert "@container file-browser (max-width: 620px)" in html
- assert "grid-template-columns: 2.25rem minmax(0, 1fr) minmax(4.25rem, max-content) 8rem;" in html
- assert ".file-cell-date,\n .file-date {\n display: none;" in html
+ assert "grid-template-columns: 2.25rem minmax(0, 1fr) minmax(4.25rem, max-content) 8rem;" in flat(html)
+ assert ".file-cell-date, .file-date { display: none;" in flat(html)
assert ".file-cell-size,\n .file-size" not in html
assert "hiding the Modified date column" in dox
diff --git a/webui/components/modals/file-browser/AGENTS.md b/webui/components/modals/file-browser/AGENTS.md
index c65a0a4c1..0c9472ec3 100644
--- a/webui/components/modals/file-browser/AGENTS.md
+++ b/webui/components/modals/file-browser/AGENTS.md
@@ -52,7 +52,7 @@
- The path bar has two preference modes persisted in `fileBrowser.preferences.pathBar` (`buttons` default, `raw`): `raw` keeps the Up button plus the plain path input with the pencil submit button; `buttons` replaces Up and the input with parent-folder crumb buttons and an Edit toggle. Both modes share one field frame owned by the shell (`1px solid var(--color-border)`, 6px radius, 36px outer height, `background: var(--color-input)`); the input fills it via `height: 100%` with `border: 0` and must never set its own 36px height.
- The raw input pins its scroll to the right end through the shared `pinPathInput` helper (ResizeObserver + double-rAF, re-run on `pathInput` changes and on blur): always when unfocused, and when focused only with the caret at the end; a caret moved mid-string keeps native caret-follow behavior.
- Both raw and edit submit buttons share one icon state machine, `pathSubmitState()`: pencil idle (raw only), checkmark while the input is focused/editing, spinner while busy — never duplicate the icon conditions per template. The icon is a static 26px flex slot with no hover feedback and `cursor: text`; the raw pencil focuses the input through `focusPathInput`, the check and edit-mode button submit, and Enter always submits the typed path.
-- Edit mode enables folder autocomplete below the path input, backed by the directory list API with stale-response guarding; keystrokes debounce through `queuePathSuggestions` (200ms, bypassed by immediate paths like Tab accept and refocus). The dropdown lists all matching directories (never silently capped) in an 8-row box (`max-height: 304px`, `overflow-y: auto`) and must not be a flex column: flex-shrink compresses row heights under max-height and destroys the natural `.dropdown-item` padding.
+- Edit mode enables folder autocomplete below the path input, backed by the directory list API with stale-response guarding; keystrokes debounce through `queuePathSuggestions` (200ms, bypassed by immediate paths like Tab accept and refocus). The dropdown lists all matching directories (never silently capped) in an 8-row box (`max-height: 304px`, `overflow-y: auto`) and must not be a flex column: flex-shrink compresses row heights under max-height and destroys the natural `.dropdown-item` padding. The active suggestion is the only highlighted row: `.path-suggestion:hover` suppresses the global `.dropdown-item:hover` background at reduced `0.8` opacity, while `.path-suggestion.is-active` paints `var(--color-background-hover)` at full `opacity: 1`; pointer hover highlights through `@mouseenter` updating `pathSuggestionIndex`, so a parked pointer never out-shines the keyboard selection.
- Successful submission exits edit mode; submitting the already-current directory is a no-op like `navigateToFolder`; Escape cancels back to buttons; blurring the input returns to buttons view (the check button and suggestion items suppress mousedown so their clicks survive the blur). In raw mode, Escape restores the current path and clears suggestions, and every successful submit (or same-path no-op) goes through `exitPathEdit`, which blurs the focused `.path-input` so the pencil icon returns. A failed submission never refreshes the active folder — the path-submit spinner is the only load feedback — and shows inline `pathError` plus a toast; navigation never swaps the listing for a loading overlay and rows act on soon-to-be-replaced entries only through the `.files-list.is-loading` guard.
- File rows open files and navigate into folders on whole-row click (name cell passive, pointer cursor); the selection label and action cells opt out with `@click.stop`.
- `pathError` and the suggestion dropdown are mutually exclusive: a set `pathError` hides the dropdown, and editing the input clears the error and reopens suggestions. A typed trailing separator lists the children of the typed directory itself; suggestion picks absolutize API-relative paths; Tab accepts the active suggestion by appending the separator and refetching children, only while the list is visible; Enter never autocompletes and submits the typed path as-is.
diff --git a/webui/components/modals/file-browser/file-browser.html b/webui/components/modals/file-browser/file-browser.html
index 625ef75d0..ee7a52018 100644
--- a/webui/components/modals/file-browser/file-browser.html
+++ b/webui/components/modals/file-browser/file-browser.html
@@ -9,1425 +9,1592 @@
data-canvas-dock-title="Open Files in canvas"
data-canvas-dock-icon="dock_to_right"
>
-<head>
- <title>File Browser</title>
- <script type="module">
- import { store } from "/components/modals/file-browser/file-browser-store.js";
- </script>
-</head>
-<body class="file-browser-modal-body">
- <div
- x-data
- class="file-browser-shell surface-workspace"
- :class="{ 'is-surface': xAttrs($el)?.mode === 'canvas' }"
- x-create="$store.fileBrowser.onMount($el, xAttrs($el) || {})"
- x-destroy="$store.fileBrowser.onUnmount($el)"
- >
- <template x-if="$store.fileBrowser">
- <div class="file-browser-root" x-effect="$store.fileBrowser.fileTree.follow($store.fileBrowser.browser.currentPath)" :class="{ 'is-surface': xAttrs($el)?.mode === 'canvas' }">
-
-
- <!-- File Browser Content -->
- <div x-show="!$store.fileBrowser.isLoading || $store.fileBrowser.browser.entries.length" class="file-browser-content">
- <!-- Path navigator -->
- <div class="path-navigator-wrap">
- <form class="path-navigator surface-toolbar" @submit.prevent="$store.fileBrowser.submitPath()">
- <button
- type="button"
- class="file-browser-header-button surface-control nav-history-button"
- @click="$store.fileBrowser.navigateBack()"
- :disabled="!$store.fileBrowser.history.length || $store.fileBrowser.isLoading"
- aria-label="Go back"
- title="Go back"
- >
- <x-icon aria-hidden="true" name="arrow_back"></x-icon>
- </button>
- <button
- type="button"
- class="file-browser-header-button surface-control nav-history-button"
- @click="$store.fileBrowser.navigateForward()"
- :disabled="!$store.fileBrowser.forwardHistory.length || $store.fileBrowser.isLoading"
- aria-label="Go forward"
- title="Go forward"
- >
- <x-icon aria-hidden="true" name="arrow_forward"></x-icon>
- </button>
- <template x-if="$store.fileBrowser.preferences.pathBar === 'raw'">
- <div class="path-edit-group">
+ <head>
+ <title>File Browser</title>
+ <script type="module">
+ import { store } from "/components/modals/file-browser/file-browser-store.js";
+ </script>
+ </head>
+ <body class="file-browser-modal-body">
+ <div
+ x-data
+ class="file-browser-shell surface-workspace"
+ :class="{ 'is-surface': xAttrs($el)?.mode === 'canvas' }"
+ x-create="$store.fileBrowser.onMount($el, xAttrs($el) || {})"
+ x-destroy="$store.fileBrowser.onUnmount($el)"
+ >
+ <template x-if="$store.fileBrowser">
+ <div
+ class="file-browser-root"
+ x-effect="$store.fileBrowser.fileTree.follow($store.fileBrowser.browser.currentPath)"
+ :class="{ 'is-surface': xAttrs($el)?.mode === 'canvas' }"
+ >
+ <!-- File Browser Content -->
+ <div x-show="!$store.fileBrowser.isLoading || $store.fileBrowser.browser.entries.length" class="file-browser-content">
+ <!-- Path navigator -->
+ <div class="path-navigator-wrap">
+ <form class="path-navigator surface-toolbar" @submit.prevent="$store.fileBrowser.submitPath()">
+ <button
+ type="button"
+ class="file-browser-header-button surface-control nav-history-button"
+ @click="$store.fileBrowser.navigateBack()"
+ :disabled="!$store.fileBrowser.history.length || $store.fileBrowser.isLoading"
+ aria-label="Go back"
+ title="Go back"
+ >
+ <x-icon aria-hidden="true" name="arrow_back"></x-icon>
+ </button>
+ <button
+ type="button"
+ class="file-browser-header-button surface-control nav-history-button"
+ @click="$store.fileBrowser.navigateForward()"
+ :disabled="!$store.fileBrowser.forwardHistory.length || $store.fileBrowser.isLoading"
+ aria-label="Go forward"
+ title="Go forward"
+ >
+ <x-icon aria-hidden="true" name="arrow_forward"></x-icon>
+ </button>
+ <template x-if="$store.fileBrowser.preferences.pathBar === 'raw'">
+ <div class="path-edit-group">
+ <button
+ type="button"
+ class="nav-button back-button surface-control"
+ @click="$store.fileBrowser.navigateUp()"
+ @dragover="$store.fileBrowser.setDropTarget($store.fileBrowser.browser.parentPath, $event)"
+ @dragleave="$store.fileBrowser.clearDropTarget($store.fileBrowser.browser.parentPath, $event)"
+ @drop="$store.fileBrowser.dropItems($store.fileBrowser.browser.parentPath, 'parent folder', $event)"
+ :class="{ 'is-drop-target': $store.fileBrowser.dragOverPath === $store.fileBrowser.browser.parentPath }"
+ :disabled="!$store.fileBrowser.browser.parentPath || $store.fileBrowser.isLoading"
+ aria-label="Navigate up"
+ title="Navigate up"
+ >
+ <x-icon aria-hidden="true" name="arrow_upward"></x-icon>
+ <span class="nav-button-label">Up</span>
+ </button>
+ <div class="path-input-shell" :class="{ 'has-error': $store.fileBrowser.pathError }">
+ <input
+ id="current-path"
+ class="path-input"
+ type="text"
+ x-model="$store.fileBrowser.pathInput"
+ x-effect="$store.fileBrowser.pathInput; $store.fileBrowser.pinPathInput($el)"
+ @input="$store.fileBrowser.queuePathSuggestions($el)"
+ @focus="$el.setSelectionRange($el.value.length, $el.value.length); $store.fileBrowser.showPathSuggestions($el); $store.fileBrowser.rawPathFocused = true"
+ @blur="$store.fileBrowser.hidePathSuggestions(); $store.fileBrowser.pinPathInput($el); $store.fileBrowser.rawPathFocused = false"
+ @keydown.arrow-down="if ($store.fileBrowser.movePathSuggestion(1)) $event.preventDefault()"
+ @keydown.arrow-up="if ($store.fileBrowser.movePathSuggestion(-1)) $event.preventDefault()"
+ @keydown.tab="if (!$event.shiftKey && $store.fileBrowser.selectPathSuggestion($el)) { $event.preventDefault(); $el.focus(); }"
+ @keydown.escape.stop.prevent="$store.fileBrowser.resetPathInput()"
+ :aria-invalid="$store.fileBrowser.pathError ? 'true' : 'false'"
+ aria-label="Directory path"
+ spellcheck="false"
+ autocomplete="off"
+ />
<button
- type="button"
- class="nav-button back-button surface-control"
- @click="$store.fileBrowser.navigateUp()"
- @dragover="$store.fileBrowser.setDropTarget($store.fileBrowser.browser.parentPath, $event)"
- @dragleave="$store.fileBrowser.clearDropTarget($store.fileBrowser.browser.parentPath, $event)"
- @drop="$store.fileBrowser.dropItems($store.fileBrowser.browser.parentPath, 'parent folder', $event)"
- :class="{ 'is-drop-target': $store.fileBrowser.dragOverPath === $store.fileBrowser.browser.parentPath }"
- :disabled="!$store.fileBrowser.browser.parentPath || $store.fileBrowser.isLoading"
- aria-label="Navigate up"
- title="Navigate up"
+ type="submit"
+ class="file-browser-header-button path-submit"
+ @mousedown.prevent
+ @click="if ($event.detail > 0 && $store.fileBrowser.pathSubmitState() === 'pencil') { $event.preventDefault(); $store.fileBrowser.focusPathInput($el); }"
+ :class="{ 'is-submitting': $store.fileBrowser.pathSubmitState() === 'spinner' }"
+ :disabled="$store.fileBrowser.isPathSubmitting || $store.fileBrowser.isLoading"
+ aria-label="Edit directory path"
>
- <x-icon aria-hidden="true" name="arrow_upward"></x-icon>
- <span class="nav-button-label">Up</span>
+ <span class="path-edit-spinner" x-show="$store.fileBrowser.pathSubmitState() === 'spinner'" aria-hidden="true"></span>
+ <x-icon name="check" x-show="$store.fileBrowser.pathSubmitState() === 'check'"></x-icon>
+ <x-icon name="edit" x-show="$store.fileBrowser.pathSubmitState() === 'pencil'"></x-icon>
</button>
- <div class="path-input-shell" :class="{ 'has-error': $store.fileBrowser.pathError }">
- <input
- id="current-path"
- class="path-input"
- type="text"
- x-model="$store.fileBrowser.pathInput"
- x-effect="$store.fileBrowser.pathInput; $store.fileBrowser.pinPathInput($el)"
- @input="$store.fileBrowser.queuePathSuggestions($el)"
- @focus="$el.setSelectionRange($el.value.length, $el.value.length); $store.fileBrowser.showPathSuggestions($el); $store.fileBrowser.rawPathFocused = true"
- @blur="$store.fileBrowser.hidePathSuggestions(); $store.fileBrowser.pinPathInput($el); $store.fileBrowser.rawPathFocused = false"
- @keydown.arrow-down="if ($store.fileBrowser.movePathSuggestion(1)) $event.preventDefault()"
- @keydown.arrow-up="if ($store.fileBrowser.movePathSuggestion(-1)) $event.preventDefault()"
- @keydown.tab="if (!$event.shiftKey && $store.fileBrowser.selectPathSuggestion($el)) { $event.preventDefault(); $el.focus(); }"
- @keydown.escape.stop.prevent="$store.fileBrowser.resetPathInput()"
- :aria-invalid="$store.fileBrowser.pathError ? 'true' : 'false'"
- aria-label="Directory path"
- spellcheck="false"
- autocomplete="off"
- />
- <button
- type="submit"
- class="file-browser-header-button path-submit"
- @mousedown.prevent
- @click="if ($event.detail > 0 && $store.fileBrowser.pathSubmitState() === 'pencil') { $event.preventDefault(); $store.fileBrowser.focusPathInput($el); }"
- :class="{ 'is-submitting': $store.fileBrowser.pathSubmitState() === 'spinner' }"
- :disabled="$store.fileBrowser.isPathSubmitting || $store.fileBrowser.isLoading"
- aria-label="Edit directory path"
- >
- <span class="path-edit-spinner" x-show="$store.fileBrowser.pathSubmitState() === 'spinner'" aria-hidden="true"></span>
- <x-icon name="check" x-show="$store.fileBrowser.pathSubmitState() === 'check'"></x-icon>
- <x-icon name="edit" x-show="$store.fileBrowser.pathSubmitState() === 'pencil'"></x-icon>
- </button>
- </div>
</div>
- </template>
- <template x-if="$store.fileBrowser.preferences.pathBar !== 'raw' && !$store.fileBrowser.pathEditing">
- <div class="path-buttons-group">
- <button
- type="button"
- class="path-overflow-up"
- x-show="$store.fileBrowser.pathCrumbsOverflow > 0"
- @click="$store.fileBrowser.togglePathOverflowMenu($el)"
- @keydown.escape.stop="$store.fileBrowser.closePathOverflowMenu()"
- :disabled="!$store.fileBrowser.browser.parentPath || $store.fileBrowser.isLoading"
- :aria-expanded="$store.fileBrowser.pathOverflowMenuOpen ? 'true' : 'false'"
- aria-label="Parent folders"
- title="Parent folders"
+ </div>
+ </template>
+ <template x-if="$store.fileBrowser.preferences.pathBar !== 'raw' && !$store.fileBrowser.pathEditing">
+ <div class="path-buttons-group">
+ <button
+ type="button"
+ class="path-overflow-up"
+ x-show="$store.fileBrowser.pathCrumbsOverflow > 0"
+ @click="$store.fileBrowser.togglePathOverflowMenu($el)"
+ @keydown.escape.stop="$store.fileBrowser.closePathOverflowMenu()"
+ :disabled="!$store.fileBrowser.browser.parentPath || $store.fileBrowser.isLoading"
+ :aria-expanded="$store.fileBrowser.pathOverflowMenuOpen ? 'true' : 'false'"
+ aria-label="Parent folders"
+ title="Parent folders"
+ >
+ <x-icon aria-hidden="true" name="chevron_left"></x-icon>
+ </button>
+ <template x-teleport="body">
+ <div
+ class="path-overflow-menu"
+ x-show="$store.fileBrowser.pathOverflowMenuOpen"
+ :style="$store.fileBrowser.pathOverflowMenuStyle"
+ @click.outside="$store.fileBrowser.closePathOverflowMenu()"
+ @keydown.escape.window="$store.fileBrowser.closePathOverflowMenu()"
>
- <x-icon aria-hidden="true" name="chevron_left"></x-icon>
- </button>
- <template x-teleport="body">
- <div
- class="path-overflow-menu"
- x-show="$store.fileBrowser.pathOverflowMenuOpen"
- :style="$store.fileBrowser.pathOverflowMenuStyle"
- @click.outside="$store.fileBrowser.closePathOverflowMenu()"
- @keydown.escape.window="$store.fileBrowser.closePathOverflowMenu()"
- >
- <template x-for="ancestor in $store.fileBrowser.pathOverflowAncestors()" :key="ancestor.path">
- <button
- type="button"
- class="path-ancestor dropdown-item"
- @click="$store.fileBrowser.pickPathAncestor(ancestor)"
- ><x-icon aria-hidden="true" name="folder"></x-icon><span x-text="ancestor.name"></span></button>
- </template>
- </div>
- </template>
- <div class="path-crumbs" role="navigation" aria-label="Directory path" x-effect="$store.fileBrowser.pathCrumbs(); $nextTick(() => $store.fileBrowser.measurePathCrumbFit($el))" @click.self="$store.fileBrowser.startPathEdit()">
- <template x-for="(crumb, index) in $store.fileBrowser.pathCrumbs()" :key="crumb.path">
- <button
- type="button"
- class="path-crumb"
- :class="{ 'is-active': index === $store.fileBrowser.pathCrumbs().length - 1, 'is-drop-target': $store.fileBrowser.dragOverPath === crumb.path }"
- @click="$store.fileBrowser.navigateToFolder(crumb.path)"
- @dragover="$store.fileBrowser.setDropTarget(crumb.path, $event)"
- @dragleave="$store.fileBrowser.clearDropTarget(crumb.path, $event)"
- @drop="$store.fileBrowser.dropItems(crumb.path, crumb.name, $event)"
- :disabled="$store.fileBrowser.isLoading"
- :title="crumb.path"
- ><span class="path-crumb-name" x-text="crumb.name"></span><span class="path-crumb-separator" aria-hidden="true" x-show="index < $store.fileBrowser.pathCrumbs().length - 1">›</span></button>
+ <template x-for="ancestor in $store.fileBrowser.pathOverflowAncestors()" :key="ancestor.path">
+ <button type="button" class="path-ancestor dropdown-item" @click="$store.fileBrowser.pickPathAncestor(ancestor)">
+ <x-icon aria-hidden="true" name="folder"></x-icon><span x-text="ancestor.name"></span>
+ </button>
</template>
</div>
- <button
- type="button"
- class="file-browser-header-button surface-control path-edit-toggle"
- @click="$store.fileBrowser.startPathEdit()"
- :class="{ 'is-loading': $store.fileBrowser.isLoading }"
- :disabled="$store.fileBrowser.isLoading"
- aria-label="Edit path"
- title="Edit path"
- >
- <span class="path-edit-spinner" x-show="$store.fileBrowser.isLoading" aria-hidden="true"></span>
- <x-icon name="edit" x-show="!$store.fileBrowser.isLoading"></x-icon>
- </button>
- </div>
- </template>
- <template x-if="$store.fileBrowser.pathEditing">
- <div class="path-edit-group">
- <div class="path-input-shell" :class="{ 'has-error': $store.fileBrowser.pathError }">
- <input
- id="current-path-edit"
- class="path-input"
- type="text"
- x-model="$store.fileBrowser.pathInput"
- x-init="$nextTick(() => { $el.focus(); $el.setSelectionRange($el.value.length, $el.value.length); })"
- x-effect="$store.fileBrowser.pathInput; $store.fileBrowser.pinPathInput($el)"
- @input="$store.fileBrowser.queuePathSuggestions($el)"
- @focus="$store.fileBrowser.showPathSuggestions($el)"
- @blur="$store.fileBrowser.hidePathSuggestions()"
- @keydown.arrow-down="if ($store.fileBrowser.movePathSuggestion(1)) $event.preventDefault()"
- @keydown.arrow-up="if ($store.fileBrowser.movePathSuggestion(-1)) $event.preventDefault()"
- @keydown.tab="if (!$event.shiftKey && $store.fileBrowser.selectPathSuggestion($el)) { $event.preventDefault(); $el.focus(); }"
- @keydown.escape.stop.prevent="$store.fileBrowser.exitPathEdit()"
- :aria-invalid="$store.fileBrowser.pathError ? 'true' : 'false'"
- aria-label="Directory path"
- spellcheck="false"
- autocomplete="off"
- />
- <button
- type="submit"
- class="file-browser-header-button path-submit"
- @mousedown.prevent
- :class="{ 'is-submitting': $store.fileBrowser.pathSubmitState() === 'spinner' }"
- :disabled="$store.fileBrowser.isPathSubmitting || $store.fileBrowser.isLoading"
- aria-label="Go to directory"
- >
- <span class="path-edit-spinner" x-show="$store.fileBrowser.pathSubmitState() === 'spinner'" aria-hidden="true"></span>
- <x-icon name="check" x-show="$store.fileBrowser.pathSubmitState() === 'check'"></x-icon>
- </button>
- </div>
- </div>
- </template>
- <template x-teleport="body">
+ </template>
<div
- class="path-suggestions"
- x-show="$store.fileBrowser.pathSuggestions.length && !$store.fileBrowser.pathSuggestionsHidden && !$store.fileBrowser.pathError"
- :style="$store.fileBrowser.pathSuggestionsStyle"
+ class="path-crumbs"
+ role="navigation"
+ aria-label="Directory path"
+ x-effect="$store.fileBrowser.pathCrumbs(); $nextTick(() => $store.fileBrowser.measurePathCrumbFit($el))"
+ @click.self="$store.fileBrowser.startPathEdit()"
>
- <template x-for="(suggestion, index) in $store.fileBrowser.pathSuggestions" :key="suggestion.path">
+ <template x-for="(crumb, index) in $store.fileBrowser.pathCrumbs()" :key="crumb.path">
<button
type="button"
- class="path-suggestion dropdown-item"
- :class="{ 'is-active': index === $store.fileBrowser.pathSuggestionIndex }"
- @mousedown.prevent
- @click="$store.fileBrowser.pickPathSuggestion(suggestion)"
- @mouseenter="$store.fileBrowser.pathSuggestionIndex = index"
- ><x-icon aria-hidden="true" name="folder"></x-icon><span x-text="suggestion.name"></span></button>
+ class="path-crumb"
+ :class="{ 'is-active': index === $store.fileBrowser.pathCrumbs().length - 1, 'is-drop-target': $store.fileBrowser.dragOverPath === crumb.path }"
+ @click="$store.fileBrowser.navigateToFolder(crumb.path)"
+ @dragover="$store.fileBrowser.setDropTarget(crumb.path, $event)"
+ @dragleave="$store.fileBrowser.clearDropTarget(crumb.path, $event)"
+ @drop="$store.fileBrowser.dropItems(crumb.path, crumb.name, $event)"
+ :disabled="$store.fileBrowser.isLoading"
+ :title="crumb.path"
+ >
+ <span class="path-crumb-name" x-text="crumb.name"></span
+ ><span class="path-crumb-separator" aria-hidden="true" x-show="index < $store.fileBrowser.pathCrumbs().length - 1">›</span>
+ </button>
</template>
</div>
- </template>
- <span class="surface-toolbar-separator" aria-hidden="true" x-show="!$store.fileBrowser.isTextOpenPicker()"></span>
- <button
- type="button"
- class="file-browser-header-button btn-new-item surface-control"
- x-show="$store.fileBrowser.remoteAllowed('upload') && (!$store.fileBrowser.isTextOpenPicker() || ($store.fileBrowser.remoteAllowed('edit') && !$store.fileBrowser.isPickerMode()))"
- @click="$store.fileBrowser.toggleNewItemsMenu($el)"
- @keydown.escape.stop="$store.fileBrowser.closeNewItemsMenu()"
- :aria-expanded="$store.fileBrowser.newItemsMenuOpen ? 'true' : 'false'"
- aria-label="Create new"
- title="Create new"
- >
- <x-icon aria-hidden="true" name="add"></x-icon>
- </button>
- <template x-teleport="body">
- <div
- class="path-overflow-menu new-items-menu"
- x-show="$store.fileBrowser.newItemsMenuOpen"
- :style="$store.fileBrowser.newItemsMenuStyle"
- @click.outside="$store.fileBrowser.closeNewItemsMenu()"
- @keydown.escape.window="$store.fileBrowser.closeNewItemsMenu()"
+ <button
+ type="button"
+ class="file-browser-header-button surface-control path-edit-toggle"
+ @click="$store.fileBrowser.startPathEdit()"
+ :class="{ 'is-loading': $store.fileBrowser.isLoading }"
+ :disabled="$store.fileBrowser.isLoading"
+ aria-label="Edit path"
+ title="Edit path"
>
+ <span class="path-edit-spinner" x-show="$store.fileBrowser.isLoading" aria-hidden="true"></span>
+ <x-icon name="edit" x-show="!$store.fileBrowser.isLoading"></x-icon>
+ </button>
+ </div>
+ </template>
+ <template x-if="$store.fileBrowser.pathEditing">
+ <div class="path-edit-group">
+ <div class="path-input-shell" :class="{ 'has-error': $store.fileBrowser.pathError }">
+ <input
+ id="current-path-edit"
+ class="path-input"
+ type="text"
+ x-model="$store.fileBrowser.pathInput"
+ x-init="$nextTick(() => { $el.focus(); $el.setSelectionRange($el.value.length, $el.value.length); })"
+ x-effect="$store.fileBrowser.pathInput; $store.fileBrowser.pinPathInput($el)"
+ @input="$store.fileBrowser.queuePathSuggestions($el)"
+ @focus="$store.fileBrowser.showPathSuggestions($el)"
+ @blur="$store.fileBrowser.hidePathSuggestions()"
+ @keydown.arrow-down="if ($store.fileBrowser.movePathSuggestion(1)) $event.preventDefault()"
+ @keydown.arrow-up="if ($store.fileBrowser.movePathSuggestion(-1)) $event.preventDefault()"
+ @keydown.tab="if (!$event.shiftKey && $store.fileBrowser.selectPathSuggestion($el)) { $event.preventDefault(); $el.focus(); }"
+ @keydown.escape.stop.prevent="$store.fileBrowser.exitPathEdit()"
+ :aria-invalid="$store.fileBrowser.pathError ? 'true' : 'false'"
+ aria-label="Directory path"
+ spellcheck="false"
+ autocomplete="off"
+ />
<button
- type="button"
- class="new-item dropdown-item"
- x-show="!$store.fileBrowser.isPickerMode() && $store.fileBrowser.remoteAllowed('upload') && $store.fileBrowser.remoteAllowed('edit')"
- @click="$store.fileBrowser.pickNewItem('file')"
- aria-label="New file"
- title="New file"
- ><x-icon aria-hidden="true" name="note_add"></x-icon><span>New file</span></button>
+ type="submit"
+ class="file-browser-header-button path-submit"
+ @mousedown.prevent
+ :class="{ 'is-submitting': $store.fileBrowser.pathSubmitState() === 'spinner' }"
+ :disabled="$store.fileBrowser.isPathSubmitting || $store.fileBrowser.isLoading"
+ aria-label="Go to directory"
+ >
+ <span class="path-edit-spinner" x-show="$store.fileBrowser.pathSubmitState() === 'spinner'" aria-hidden="true"></span>
+ <x-icon name="check" x-show="$store.fileBrowser.pathSubmitState() === 'check'"></x-icon>
+ </button>
+ </div>
+ </div>
+ </template>
+ <template x-teleport="body">
+ <div
+ class="path-suggestions"
+ x-show="$store.fileBrowser.pathSuggestions.length && !$store.fileBrowser.pathSuggestionsHidden && !$store.fileBrowser.pathError"
+ :style="$store.fileBrowser.pathSuggestionsStyle"
+ >
+ <template x-for="(suggestion, index) in $store.fileBrowser.pathSuggestions" :key="suggestion.path">
<button
type="button"
- class="new-item dropdown-item"
- x-show="!$store.fileBrowser.isTextOpenPicker() && $store.fileBrowser.remoteAllowed('upload')"
- @click="$store.fileBrowser.pickNewItem('folder')"
- aria-label="New folder"
- title="New folder"
- ><x-icon aria-hidden="true" name="create_new_folder"></x-icon><span>New folder</span></button>
- </div>
- </template>
- <span class="surface-toolbar-separator" aria-hidden="true"></span>
- <button type="button" class="file-browser-header-button surface-control" title="Toggle file tree" aria-label="Toggle file tree" :aria-pressed="String($store.fileBrowser.fileTree.shown)" @click="$store.fileBrowser.fileTree.toggle($store.fileBrowser.browser.currentPath)">
- <x-icon name="account_tree"></x-icon>
- </button>
- <button type="button" class="file-browser-header-button surface-control" x-show="!$store.fileBrowser.isPickerMode()"
- @click="$store.fileBrowser.openSettings()" title="File Browser Settings" aria-label="File Browser Settings">
- <x-icon aria-hidden="true" name="settings"></x-icon>
- </button>
- </form>
- <template x-if="$store.fileBrowser.pathError">
- <div class="path-error" x-text="$store.fileBrowser.pathError"></div>
+ class="path-suggestion dropdown-item"
+ :class="{ 'is-active': index === $store.fileBrowser.pathSuggestionIndex }"
+ @mousedown.prevent
+ @click="$store.fileBrowser.pickPathSuggestion(suggestion)"
+ @mouseenter="$store.fileBrowser.pathSuggestionIndex = index"
+ >
+ <x-icon aria-hidden="true" name="folder"></x-icon><span x-text="suggestion.name"></span>
+ </button>
+ </template>
+ </div>
</template>
- </div>
- <div x-show="$store.fileBrowser.selectedCount > 0 && !$store.fileBrowser.isPickerMode()" class="mass-action-toolbar file-mass-toolbar">
- <div class="selection-summary">
- <button
- type="button"
- class="selection-close"
- @click="$store.fileBrowser.clearSelection()"
- :disabled="$store.fileBrowser.isBulkBusy"
- title="Clear Selection"
- aria-label="Clear selection"
+ <span class="surface-toolbar-separator" aria-hidden="true" x-show="!$store.fileBrowser.isTextOpenPicker()"></span>
+ <button
+ type="button"
+ class="file-browser-header-button btn-new-item surface-control"
+ x-show="$store.fileBrowser.remoteAllowed('upload') && (!$store.fileBrowser.isTextOpenPicker() || ($store.fileBrowser.remoteAllowed('edit') && !$store.fileBrowser.isPickerMode()))"
+ @click="$store.fileBrowser.toggleNewItemsMenu($el)"
+ @keydown.escape.stop="$store.fileBrowser.closeNewItemsMenu()"
+ :aria-expanded="$store.fileBrowser.newItemsMenuOpen ? 'true' : 'false'"
+ aria-label="Create new"
+ title="Create new"
+ >
+ <x-icon aria-hidden="true" name="add"></x-icon>
+ </button>
+ <template x-teleport="body">
+ <div
+ class="path-overflow-menu new-items-menu"
+ x-show="$store.fileBrowser.newItemsMenuOpen"
+ :style="$store.fileBrowser.newItemsMenuStyle"
+ @click.outside="$store.fileBrowser.closeNewItemsMenu()"
+ @keydown.escape.window="$store.fileBrowser.closeNewItemsMenu()"
>
- <x-icon name="close"></x-icon>
- </button>
- <div class="selection-info" x-text="$store.fileBrowser.selectedCountLabel"></div>
- </div>
+ <button
+ type="button"
+ class="new-item dropdown-item"
+ x-show="!$store.fileBrowser.isPickerMode() && $store.fileBrowser.remoteAllowed('upload') && $store.fileBrowser.remoteAllowed('edit')"
+ @click="$store.fileBrowser.pickNewItem('file')"
+ aria-label="New file"
+ title="New file"
+ >
+ <x-icon aria-hidden="true" name="note_add"></x-icon><span>New file</span>
+ </button>
+ <button
+ type="button"
+ class="new-item dropdown-item"
+ x-show="!$store.fileBrowser.isTextOpenPicker() && $store.fileBrowser.remoteAllowed('upload')"
+ @click="$store.fileBrowser.pickNewItem('folder')"
+ aria-label="New folder"
+ title="New folder"
+ >
+ <x-icon aria-hidden="true" name="create_new_folder"></x-icon><span>New folder</span>
+ </button>
+ </div>
+ </template>
+ <span class="surface-toolbar-separator" aria-hidden="true"></span>
+ <button
+ type="button"
+ class="file-browser-header-button surface-control"
+ title="Toggle file tree"
+ aria-label="Toggle file tree"
+ :aria-pressed="String($store.fileBrowser.fileTree.shown)"
+ @click="$store.fileBrowser.fileTree.toggle($store.fileBrowser.browser.currentPath)"
+ >
+ <x-icon name="account_tree"></x-icon>
+ </button>
+ <button
+ type="button"
+ class="file-browser-header-button surface-control"
+ x-show="!$store.fileBrowser.isPickerMode()"
+ @click="$store.fileBrowser.openSettings()"
+ title="File Browser Settings"
+ aria-label="File Browser Settings"
+ >
+ <x-icon aria-hidden="true" name="settings"></x-icon>
+ </button>
+ </form>
+ <template x-if="$store.fileBrowser.pathError">
+ <div class="path-error" x-text="$store.fileBrowser.pathError"></div>
+ </template>
+ </div>
+ <div x-show="$store.fileBrowser.selectedCount > 0 && !$store.fileBrowser.isPickerMode()" class="mass-action-toolbar file-mass-toolbar">
+ <div class="selection-summary">
+ <button
+ type="button"
+ class="selection-close"
+ @click="$store.fileBrowser.clearSelection()"
+ :disabled="$store.fileBrowser.isBulkBusy"
+ title="Clear Selection"
+ aria-label="Clear selection"
+ >
+ <x-icon name="close"></x-icon>
+ </button>
+ <div class="selection-info" x-text="$store.fileBrowser.selectedCountLabel"></div>
+ </div>
- <div class="mass-actions">
- <button
- type="button"
- class="btn btn-mass export"
- @click="$store.fileBrowser.bulkDownloadFiles()"
- :disabled="$store.fileBrowser.isBulkBusy"
- title="Download Selected Items"
- x-show="$store.fileBrowser.remoteAllowed('download')"
- >
- <x-icon name="folder_zip"></x-icon>
- Download ZIP
- </button>
-
- <button
- type="button"
- class="btn btn-mass delete"
- @click="$confirmClick($event, () => $store.fileBrowser.bulkDeleteFiles())"
- :disabled="$store.fileBrowser.isBulkBusy"
- title="Delete Selected Items"
- x-show="$store.fileBrowser.remoteAllowed('delete')"
- aria-label="Delete selected items"
- >
- <x-icon name="delete"></x-icon>
- </button>
- </div>
+ <div class="mass-actions">
+ <button
+ type="button"
+ class="btn btn-mass export"
+ @click="$store.fileBrowser.bulkDownloadFiles()"
+ :disabled="$store.fileBrowser.isBulkBusy"
+ title="Download Selected Items"
+ x-show="$store.fileBrowser.remoteAllowed('download')"
+ >
+ <x-icon name="folder_zip"></x-icon>
+ Download ZIP
+ </button>
+
+ <button
+ type="button"
+ class="btn btn-mass delete"
+ @click="$confirmClick($event, () => $store.fileBrowser.bulkDeleteFiles())"
+ :disabled="$store.fileBrowser.isBulkBusy"
+ title="Delete Selected Items"
+ x-show="$store.fileBrowser.remoteAllowed('delete')"
+ aria-label="Delete selected items"
+ >
+ <x-icon name="delete"></x-icon>
+ </button>
</div>
+ </div>
- <div class="file-browser-workspace">
- <div class="file-browser-list-pane">
- <!-- Files list -->
- <div class="files-list" :class="{ 'file-icons-view': $store.fileBrowser.preferences.view === 'icons', 'is-loading': $store.fileBrowser.isLoading }" @scroll="$store.fileBrowser.closeDropdown(); $store.fileBrowser.closeNewItemsMenu()">
- <div class="file-header">
- <div class="file-cell-select">
- <input
- type="checkbox"
- :checked="$store.fileBrowser.allVisibleSelected"
- :indeterminate="$store.fileBrowser.someVisibleSelected && !$store.fileBrowser.allVisibleSelected"
- @change="$store.fileBrowser.toggleSelectAllVisible()"
- :disabled="$store.fileBrowser.selectableEntries.length === 0"
- title="Select visible items"
- aria-label="Select visible items"
- />
+ <div class="file-browser-workspace">
+ <div class="file-browser-list-pane">
+ <!-- Files list -->
+ <div
+ class="files-list"
+ :class="{ 'file-icons-view': $store.fileBrowser.preferences.view === 'icons', 'is-loading': $store.fileBrowser.isLoading }"
+ @scroll="$store.fileBrowser.closeDropdown(); $store.fileBrowser.closeNewItemsMenu()"
+ >
+ <div class="file-header">
+ <div class="file-cell-select">
+ <input
+ type="checkbox"
+ :checked="$store.fileBrowser.allVisibleSelected"
+ :indeterminate="$store.fileBrowser.someVisibleSelected && !$store.fileBrowser.allVisibleSelected"
+ @change="$store.fileBrowser.toggleSelectAllVisible()"
+ :disabled="$store.fileBrowser.selectableEntries.length === 0"
+ title="Select visible items"
+ aria-label="Select visible items"
+ />
+ </div>
+ <div class="file-cell" @click="$store.fileBrowser.toggleSort('name')">
+ Name
+ <span
+ x-show="$store.fileBrowser.browser.sortBy === 'name'"
+ x-text="$store.fileBrowser.browser.sortDirection === 'asc' ? '↑' : '↓'"
+ ></span>
+ </div>
+ <div class="file-cell-size" @click="$store.fileBrowser.toggleSort('size')">
+ Size
+ <span
+ x-show="$store.fileBrowser.browser.sortBy === 'size'"
+ x-text="$store.fileBrowser.browser.sortDirection === 'asc' ? '↑' : '↓'"
+ ></span>
+ </div>
+ <div class="file-cell-date" @click="$store.fileBrowser.toggleSort('date')">
+ Modified
+ <span
+ x-show="$store.fileBrowser.browser.sortBy === 'date'"
+ x-text="$store.fileBrowser.browser.sortDirection === 'asc' ? '↑' : '↓'"
+ ></span>
+ </div>
+ <div class="file-cell-actions"></div>
</div>
- <div class="file-cell" @click="$store.fileBrowser.toggleSort('name')">Name <span x-show="$store.fileBrowser.browser.sortBy === 'name'" x-text="$store.fileBrowser.browser.sortDirection === 'asc' ? '↑' : '↓'"></span></div>
- <div class="file-cell-size" @click="$store.fileBrowser.toggleSort('size')">Size <span x-show="$store.fileBrowser.browser.sortBy === 'size'" x-text="$store.fileBrowser.browser.sortDirection === 'asc' ? '↑' : '↓'"></span></div>
- <div class="file-cell-date" @click="$store.fileBrowser.toggleSort('date')">Modified <span x-show="$store.fileBrowser.browser.sortBy === 'date'" x-text="$store.fileBrowser.browser.sortDirection === 'asc' ? '↑' : '↓'"></span></div>
- <div class="file-cell-actions"></div>
- </div>
- <!-- File list entries -->
- <template x-if="$store.fileBrowser.visibleEntries.length">
- <template x-for="file in $store.fileBrowser.visibleEntries" :key="file.path">
- <div
- class="file-item"
- @click="$store.fileBrowser.handleFileNameClick(file)"
- :data-is-dir="file.is_dir"
- :draggable="!$store.fileBrowser.isPickerMode() && !$store.fileBrowser.isBulkBusy"
- :class="{
+ <!-- File list entries -->
+ <template x-if="$store.fileBrowser.visibleEntries.length">
+ <template x-for="file in $store.fileBrowser.visibleEntries" :key="file.path">
+ <div
+ class="file-item"
+ @click="$store.fileBrowser.handleFileNameClick(file)"
+ :data-is-dir="file.is_dir"
+ :draggable="!$store.fileBrowser.isPickerMode() && !$store.fileBrowser.isBulkBusy"
+ :class="{
'selected': file.selected,
'is-dragging': $store.fileBrowser.isDraggingPath(file.path),
'is-drop-target': file.is_dir && $store.fileBrowser.dragOverPath === file.path
}"
- @dragstart="$store.fileBrowser.startDrag(file, $event)"
- @dragend="$store.fileBrowser.clearDragState()"
- @dragover="file.is_dir && $store.fileBrowser.setDropTarget(file.path, $event)"
- @dragleave="file.is_dir && $store.fileBrowser.clearDropTarget(file.path, $event)"
- @drop="file.is_dir && $store.fileBrowser.dropItems(file.path, file.name, $event)"
- >
- <label class="file-select-cell" @click.stop>
- <template x-if="!$store.fileBrowser.isTextOpenPicker() || !file.is_dir">
- <input
- type="checkbox"
- x-model="file.selected"
- :disabled="!$store.fileBrowser.isSelectableEntry(file)"
- :aria-label="`Select ${file.name}`"
- />
- </template>
- </label>
- <div class="file-name">
- <template x-if="file.is_dir">
- <x-icon name="folder" class="file-icon file-folder-icon"></x-icon>
- </template>
- <template x-if="!file.is_dir">
- <img :src="'/public/' + (file.type === 'unknown' ? 'file' : ($store.fileBrowser.isArchive(file.name) ? 'archive' : file.type)) + '.svg'" class="file-icon" :alt="file.type" draggable="false" />
- </template>
- <span x-text="file.name"></span>
- </div>
- <div class="file-size" x-text="file.is_dir ? '—' : $store.fileBrowser.formatFileSize(file.size)"></div>
- <div class="file-date" x-text="$store.fileBrowser.formatDate(file.modified)"></div>
- <div class="file-actions" x-data="{ fileActions: $el }" x-show="!$store.fileBrowser.isPickerMode()" @click.stop>
- <!-- Secondary single-item actions (Rename/...) are grouped under a dropdown -->
- <div
- class="dropdown file-actions-dropdown"
- @click.outside="$store.fileBrowser.closeDropdown()"
- @keydown.escape.window="$store.fileBrowser.closeDropdown()"
- >
- <button
- type="button"
- class="btn-icon-action dropdown-trigger"
- @click.stop="$store.fileBrowser.toggleDropdown(file.path, $event.currentTarget)"
- :aria-expanded="$store.fileBrowser.isDropdownOpen(file.path, fileActions).toString()"
- aria-label="More actions"
- title="More actions"
+ @dragstart="$store.fileBrowser.startDrag(file, $event)"
+ @dragend="$store.fileBrowser.clearDragState()"
+ @dragover="file.is_dir && $store.fileBrowser.setDropTarget(file.path, $event)"
+ @dragleave="file.is_dir && $store.fileBrowser.clearDropTarget(file.path, $event)"
+ @drop="file.is_dir && $store.fileBrowser.dropItems(file.path, file.name, $event)"
+ >
+ <label class="file-select-cell" @click.stop>
+ <template x-if="!$store.fileBrowser.isTextOpenPicker() || !file.is_dir">
+ <input
+ type="checkbox"
+ x-model="file.selected"
+ :disabled="!$store.fileBrowser.isSelectableEntry(file)"
+ :aria-label="`Select ${file.name}`"
+ />
+ </template>
+ </label>
+ <div class="file-name">
+ <template x-if="file.is_dir">
+ <x-icon name="folder" class="file-icon file-folder-icon"></x-icon>
+ </template>
+ <template x-if="!file.is_dir">
+ <img
+ :src="'/public/' + (file.type === 'unknown' ? 'file' : ($store.fileBrowser.isArchive(file.name) ? 'archive' : file.type)) + '.svg'"
+ class="file-icon"
+ :alt="file.type"
+ draggable="false"
+ />
+ </template>
+ <span x-text="file.name"></span>
+ </div>
+ <div class="file-size" x-text="file.is_dir ? '—' : $store.fileBrowser.formatFileSize(file.size)"></div>
+ <div class="file-date" x-text="$store.fileBrowser.formatDate(file.modified)"></div>
+ <div class="file-actions" x-data="{ fileActions: $el }" x-show="!$store.fileBrowser.isPickerMode()" @click.stop>
+ <!-- Secondary single-item actions (Rename/...) are grouped under a dropdown -->
+ <div
+ class="dropdown file-actions-dropdown"
+ @click.outside="$store.fileBrowser.closeDropdown()"
+ @keydown.escape.window="$store.fileBrowser.closeDropdown()"
>
- <x-icon name="more_vert"></x-icon>
- </button>
-
- <template x-teleport="body">
- <div
- class="dropdown-menu file-actions-menu"
- x-show="$store.fileBrowser.isDropdownOpen(file.path, fileActions)"
- x-transition
- :style="$store.fileBrowser.dropdownStyle"
- style="display: none;"
- @click.stop="$store.fileBrowser.closeDropdown()"
+ <button
+ type="button"
+ class="btn-icon-action dropdown-trigger"
+ @click.stop="$store.fileBrowser.toggleDropdown(file.path, $event.currentTarget)"
+ :aria-expanded="$store.fileBrowser.isDropdownOpen(file.path, fileActions).toString()"
+ aria-label="More actions"
+ title="More actions"
>
- <button
- type="button"
- class="dropdown-item"
- x-show="$store.fileBrowser.isEditableFile(file)"
- @click="$store.fileBrowser.openFileEditor(file)"
- >
- <x-icon name="edit"></x-icon>
- <span>Edit</span>
- </button>
-
- <button
- type="button"
- class="dropdown-item"
- x-show="$store.fileBrowser.canOpenInActionMenu(file)"
- @click="$store.fileBrowser.openInSurface(file)"
- :title="$store.fileBrowser.surfaceActionTitle(file)"
+ <x-icon name="more_vert"></x-icon>
+ </button>
+
+ <template x-teleport="body">
+ <div
+ class="dropdown-menu file-actions-menu"
+ x-show="$store.fileBrowser.isDropdownOpen(file.path, fileActions)"
+ x-transition
+ :style="$store.fileBrowser.dropdownStyle"
+ style="display: none"
+ @click.stop="$store.fileBrowser.closeDropdown()"
>
- <x-icon :name="$store.fileBrowser.surfaceActionIcon(file)"></x-icon>
- <span x-text="$store.fileBrowser.surfaceActionLabel(file)"></span>
- </button>
-
- <button
- type="button"
- class="dropdown-item"
- x-show="file.is_dir && $store.fileBrowser.remoteAllowed('download', file)"
- @click="$store.fileBrowser.downloadFile(file)"
- >
- <x-icon name="folder_zip"></x-icon>
- <span>Download ZIP</span>
- </button>
-
- <button
- type="button"
- class="dropdown-item"
- x-show="!file.is_dir && !$store.fileBrowser.isRemote(file.path) && $store.fileBrowser.isArchive(file.name)"
- @click="$store.fileBrowser.extractArchive(file)"
- >
- <x-icon name="unarchive"></x-icon>
- <span>Extract</span>
- </button>
-
- <button
- type="button"
- class="dropdown-item"
- x-show="$store.fileBrowser.remoteAllowed('rename', file)"
- @click="$store.fileBrowser.openRenameModal(file)"
- >
- <x-icon name="drive_file_rename_outline"></x-icon>
- <span>Rename</span>
- </button>
- <template x-if="$store.fileBrowser.isDropdownOpen(file.path, fileActions)">
- <x-extension id="file-browser-actions-menu"></x-extension>
- </template>
- </div>
- </template>
+ <button
+ type="button"
+ class="dropdown-item"
+ x-show="$store.fileBrowser.isEditableFile(file)"
+ @click="$store.fileBrowser.openFileEditor(file)"
+ >
+ <x-icon name="edit"></x-icon>
+ <span>Edit</span>
+ </button>
+
+ <button
+ type="button"
+ class="dropdown-item"
+ x-show="$store.fileBrowser.canOpenInActionMenu(file)"
+ @click="$store.fileBrowser.openInSurface(file)"
+ :title="$store.fileBrowser.surfaceActionTitle(file)"
+ >
+ <x-icon :name="$store.fileBrowser.surfaceActionIcon(file)"></x-icon>
+ <span x-text="$store.fileBrowser.surfaceActionLabel(file)"></span>
+ </button>
+
+ <button
+ type="button"
+ class="dropdown-item"
+ x-show="file.is_dir && $store.fileBrowser.remoteAllowed('download', file)"
+ @click="$store.fileBrowser.downloadFile(file)"
+ >
+ <x-icon name="folder_zip"></x-icon>
+ <span>Download ZIP</span>
+ </button>
+
+ <button
+ type="button"
+ class="dropdown-item"
+ x-show="!file.is_dir && !$store.fileBrowser.isRemote(file.path) && $store.fileBrowser.isArchive(file.name)"
+ @click="$store.fileBrowser.extractArchive(file)"
+ >
+ <x-icon name="unarchive"></x-icon>
+ <span>Extract</span>
+ </button>
+
+ <button
+ type="button"
+ class="dropdown-item"
+ x-show="$store.fileBrowser.remoteAllowed('rename', file)"
+ @click="$store.fileBrowser.openRenameModal(file)"
+ >
+ <x-icon name="drive_file_rename_outline"></x-icon>
+ <span>Rename</span>
+ </button>
+ <template x-if="$store.fileBrowser.isDropdownOpen(file.path, fileActions)">
+ <x-extension id="file-browser-actions-menu"></x-extension>
+ </template>
+ </div>
+ </template>
+ </div>
+ <button
+ class="btn-icon-action"
+ x-show="!file.is_dir && $store.fileBrowser.remoteAllowed('download', file)"
+ @click.stop="$store.fileBrowser.downloadFile(file)"
+ title="Download file"
+ aria-label="Download file"
+ >
+ <x-icon name="download"></x-icon>
+ </button>
+ <button
+ class="btn-icon-action danger"
+ x-show="$store.fileBrowser.remoteAllowed('delete', file)"
+ @click.stop="$confirmClick($event, () => $store.fileBrowser.deleteFile(file))"
+ title="Delete item"
+ aria-label="Delete item"
+ >
+ <x-icon name="delete"></x-icon>
+ </button>
</div>
- <button class="btn-icon-action" x-show="!file.is_dir && $store.fileBrowser.remoteAllowed('download', file)" @click.stop="$store.fileBrowser.downloadFile(file)" title="Download file" aria-label="Download file">
- <x-icon name="download"></x-icon>
- </button>
- <button class="btn-icon-action danger" x-show="$store.fileBrowser.remoteAllowed('delete', file)" @click.stop="$confirmClick($event, () => $store.fileBrowser.deleteFile(file))" title="Delete item" aria-label="Delete item">
- <x-icon name="delete"></x-icon>
- </button>
</div>
- </div>
+ </template>
</template>
- </template>
- <!-- Empty state -->
- <template x-if="!$store.fileBrowser.browser.entries.length">
- <div class="no-files">No files found</div>
- </template>
- <template x-if="$store.fileBrowser.browser.entries.length && !$store.fileBrowser.visibleEntries.length">
- <div class="no-files">
- <div>No matching files found</div>
- <button class="btn btn-cancel btn-clear-search" @click="$store.fileBrowser.clearSearch()">
- <x-icon name="close"></x-icon>
- Clear
- </button>
- </div>
- </template>
- </div>
- </div>
- <div class="file-tree-host" x-show="$store.fileBrowser.fileTree.shown" style="display: none;">
- <x-component path="modals/file-browser/file-tree.html" owner="fileBrowser"></x-component>
+ <!-- Empty state -->
+ <template x-if="!$store.fileBrowser.browser.entries.length">
+ <div class="no-files">No files found</div>
+ </template>
+ <template x-if="$store.fileBrowser.browser.entries.length && !$store.fileBrowser.visibleEntries.length">
+ <div class="no-files">
+ <div>No matching files found</div>
+ <button class="btn btn-cancel btn-clear-search" @click="$store.fileBrowser.clearSearch()">
+ <x-icon name="close"></x-icon>
+ Clear
+ </button>
+ </div>
+ </template>
</div>
</div>
+ <div class="file-tree-host" x-show="$store.fileBrowser.fileTree.shown" style="display: none">
+ <x-component path="modals/file-browser/file-tree.html" owner="fileBrowser"></x-component>
+ </div>
</div>
+ </div>
</div>
- </template>
-
- <!-- Modal Footer (outside template x-if so it exists immediately) -->
- <template x-if="$store.fileBrowser">
- <div class="modal-footer file-browser-footer" data-modal-footer :class="{ 'is-surface': xAttrs($el)?.mode === 'canvas' }">
- <div class="file-browser-picker-actions" x-show="$store.fileBrowser.isPickerMode()" style="display: none;">
- <template x-if="$store.fileBrowser.isSaveAsPicker()">
- <input
- type="text"
- class="picker-filename-input"
- x-model="$store.fileBrowser.pickerFilename"
- @input="$store.fileBrowser.onPickerFilenameInput()"
- @keydown.enter.prevent="$store.fileBrowser.confirmPicker()"
- placeholder="File name"
- aria-label="File name"
- spellcheck="false"
- />
- </template>
- <template x-if="$store.fileBrowser.pickerFilenameError">
- <span class="picker-inline-error" x-text="$store.fileBrowser.pickerFilenameError"></span>
- </template>
+ </template>
+
+ <!-- Modal Footer (outside template x-if so it exists immediately) -->
+ <template x-if="$store.fileBrowser">
+ <div class="modal-footer file-browser-footer" data-modal-footer :class="{ 'is-surface': xAttrs($el)?.mode === 'canvas' }">
+ <div class="file-browser-picker-actions" x-show="$store.fileBrowser.isPickerMode()" style="display: none">
+ <template x-if="$store.fileBrowser.isSaveAsPicker()">
+ <input
+ type="text"
+ class="picker-filename-input"
+ x-model="$store.fileBrowser.pickerFilename"
+ @input="$store.fileBrowser.onPickerFilenameInput()"
+ @keydown.enter.prevent="$store.fileBrowser.confirmPicker()"
+ placeholder="File name"
+ aria-label="File name"
+ spellcheck="false"
+ />
+ </template>
+ <template x-if="$store.fileBrowser.pickerFilenameError">
+ <span class="picker-inline-error" x-text="$store.fileBrowser.pickerFilenameError"></span>
+ </template>
+ <button
+ type="button"
+ class="btn btn-ok picker-confirm-button"
+ :disabled="!$store.fileBrowser.canConfirmPicker() || $store.fileBrowser.isBulkBusy"
+ @click="$store.fileBrowser.confirmPicker()"
+ x-text="$store.fileBrowser.pickerConfirmLabel"
+ ></button>
+ <button type="button" class="btn btn-cancel" :disabled="$store.fileBrowser.isBulkBusy" @click="$store.fileBrowser.cancelPicker()">Cancel</button>
+ </div>
+ <label class="btn btn-upload" x-show="!$store.fileBrowser.isPickerMode() && $store.fileBrowser.remoteAllowed('upload')">
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"
+ />
+ </svg>
+ Upload Files
+ <input type="file" multiple accept="*" @change="$store.fileBrowser.handleFileUpload" style="display: none" />
+ </label>
<button
- type="button"
- class="btn btn-ok picker-confirm-button"
- :disabled="!$store.fileBrowser.canConfirmPicker() || $store.fileBrowser.isBulkBusy"
- @click="$store.fileBrowser.confirmPicker()"
- x-text="$store.fileBrowser.pickerConfirmLabel"
- ></button>
- <button type="button" class="btn btn-cancel" :disabled="$store.fileBrowser.isBulkBusy" @click="$store.fileBrowser.cancelPicker()">Cancel</button>
+ class="btn btn-cancel"
+ x-show="xAttrs($el)?.mode !== 'canvas' && !$store.fileBrowser.isPickerMode()"
+ @click="$store.fileBrowser.handleClose()"
+ >
+ Close Browser
+ </button>
</div>
- <label class="btn btn-upload" x-show="!$store.fileBrowser.isPickerMode() && $store.fileBrowser.remoteAllowed('upload')">
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"/></svg>
- Upload Files
- <input type="file" multiple accept="*" @change="$store.fileBrowser.handleFileUpload" style="display:none;" />
- </label>
- <button class="btn btn-cancel" x-show="xAttrs($el)?.mode !== 'canvas' && !$store.fileBrowser.isPickerMode()" @click="$store.fileBrowser.handleClose()">Close Browser</button>
- </div>
- </template>
- </div>
-
- <style>
- .file-browser-shell {
- width: 100%;
- min-width: 0;
- }
-
- .modal-inner.file-browser-modal {
- box-sizing: border-box;
- width: min(78vw, 1040px);
- height: min(82vh, 820px);
- min-width: min(420px, calc(100vw - 16px));
- min-height: min(360px, calc(100vh - 16px));
- max-width: calc(100vw - 16px);
- max-height: calc(100vh - 16px);
- resize: both;
- overflow: hidden;
- }
-
- .modal-inner.file-browser-modal.is-focus-mode {
- resize: none;
- border-radius: 6px;
- }
-
- .modal-inner.file-browser-modal .modal-header {
- background: color-mix(in srgb, var(--color-background) 92%, #000 8%);
- border-bottom: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
- }
-
- .modal-inner.file-browser-modal .modal-scroll,
- .modal-inner.file-browser-modal .modal-bd.file-browser-modal-body {
- display: flex;
- flex: 1 1 auto;
- width: 100%;
- height: 100%;
- min-width: 0;
- min-height: 0;
- max-height: none;
- overflow: hidden;
- padding: 0;
- }
-
- .modal-inner.file-browser-modal .modal-bd.file-browser-modal-body > div[x-data],
- .modal-inner.file-browser-modal .file-browser-shell {
- display: flex;
- flex: 1 1 auto;
- flex-direction: column;
- height: 100%;
- min-width: 0;
- min-height: 0;
- }
-
- .file-browser-shell.is-surface {
- display: flex;
- flex: 1 1 auto;
- flex-direction: column;
- height: 100%;
- min-height: 0;
- }
-
- /* File Browser Root */
- .file-browser-root {
- container: file-browser / inline-size;
- display: flex;
- flex-direction: column;
- width: 100%;
- height: 100%;
- min-height: 400px;
- }
-
- .file-browser-root.is-surface {
- flex: 1 1 auto;
- min-height: 0;
- }
-
- .modal-inner.file-browser-modal .file-browser-root {
- flex: 1 1 auto;
- min-height: 0;
- }
-
- @keyframes spin {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg); }
- }
-
- /* File Browser Content */
- .file-browser-content {
- display: flex;
- flex-direction: column;
- padding: 0;
- gap: 0;
- min-height: 0;
- }
-
- .file-browser-shell.is-surface .file-browser-content {
- flex: 1 1 auto;
- overflow: hidden;
- }
-
- .modal-inner.file-browser-modal .file-browser-content {
- flex: 1 1 auto;
- overflow: hidden;
- }
-
- /* File Browser Styles */
- .files-list {
- width: 100%;
- border-radius: 4px;
- }
-
- /* Rows act on soon-to-be-replaced entries during background fetches. */
- .files-list.is-loading .file-item {
- pointer-events: none;
- }
-
- .file-browser-shell.is-surface .files-list,
- .modal-inner.file-browser-modal .files-list {
- flex: 1 1 auto;
- min-height: 0;
- overflow: auto;
- background: var(--surface-background);
- }
-
- .file-browser-shell.is-surface .file-header {
- position: sticky;
- top: 0;
- z-index: 2;
- }
-
- .modal-inner.file-browser-modal .file-header {
- position: sticky;
- top: 0;
- z-index: 2;
- }
-
- /* Header Styles */
- .file-header {
- width: 100%;
- border-radius: 4px;
- overflow: hidden;
- display: grid;
- grid-template-columns: 2.5rem minmax(0, 1.5fr) minmax(5.5rem, 0.7fr) minmax(9rem, 1fr) 8.75rem;
- background: color-mix(in srgb, var(--color-panel) 88%, var(--color-background) 12%);
- padding: 4px 0;
- font-weight: bold;
- color: var(--color-primary);
- }
- .file-cell-select,
- .file-cell-actions {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .file-cell,
- .file-cell-size,
- .file-cell-date {
- color: var(--color-primary);
- padding: 4px;
- cursor: pointer;
- }
-
- /* File Item Styles */
- .file-item {
- cursor: pointer;
- display: grid;
- grid-template-columns: 2.5rem minmax(0, 1.5fr) minmax(5.5rem, 0.7fr) minmax(9rem, 1fr) 8.75rem;
- align-items: center;
- padding: 5px 0;
- font-size: 0.875rem;
- border-top: 1px solid var(--color-border);
- transition: background-color 120ms cubic-bezier(0.2, 0, 0, 1), box-shadow 120ms cubic-bezier(0.2, 0, 0, 1), opacity 120ms ease, transform 120ms cubic-bezier(0.2, 0, 0, 1);
- white-space: nowrap;
- overflow: visible; /* allow action dropdown menus to overflow the row */
- color: var(--color-text);
- }
- .file-item:hover {
- background-color: var(--color-secondary);
- }
- .file-item.selected {
- background: color-mix(in srgb, var(--color-primary) 12%, transparent);
- }
- .file-item.is-dragging {
- opacity: 0.45;
- transform: scale(0.995);
- }
- .file-item.is-drop-target,
- .nav-button.is-drop-target {
- background: color-mix(in srgb, var(--color-primary) 18%, var(--color-input) 82%);
- box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--color-primary) 72%, transparent);
- }
- .file-item.is-drop-target .file-icon,
- .nav-button.is-drop-target .material-symbols-outlined {
- transform: scale(1.12);
- }
-
- .file-select-cell {
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- min-height: 1.75rem;
- }
-
- .file-cell-select input,
- .file-select-cell input {
- width: 1rem;
- height: 1rem;
- accent-color: var(--color-primary);
- cursor: pointer;
- }
-
- /* File Icon and Name */
- .file-icon {
- width: 22px;
- height: 22px;
- flex: 0 0 22px;
- object-fit: contain;
- margin: 0 1rem 0 0.7rem;
- vertical-align: middle;
- font-size: var(--font-size-sm);
- transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
- }
- .file-folder-icon {
- color: #a0a0a0;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- font-size: 22px;
- }
- .file-name {
- display: flex;
- align-items: center;
- font-weight: 500;
- margin-right: var(--spacing-sm);
- overflow: hidden;
- }
- .file-name > span {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .file-size,
- .file-date {
- color: var(--color-text-secondary);
- }
- /* No Files Message */
- .no-files {
- padding: 32px;
- text-align: center;
- color: var(--color-text-secondary);
- }
- .no-files .btn-clear-search {
- display: inline-flex;
- align-items: center;
- gap: 0.25rem;
- margin-top: 0.75rem;
- }
- /* Light Mode Adjustments */
- .light-mode .file-item:hover {
- background-color: var(--color-secondary-light);
- }
-
- /* Path Navigator Styles */
- .path-navigator-wrap {
- display: flex;
- flex-direction: column;
- gap: 0.35rem;
- }
-
- .path-navigator {
- overflow: hidden;
- display: flex;
- align-items: center;
- gap: 8px;
- background: color-mix(in srgb, var(--color-background) 92%, #000 8%);
- padding: 7px 10px;
- margin: 0;
- border: 0;
- border-bottom: 1px solid color-mix(in srgb, var(--color-border) 58%, transparent);
- border-radius: 0;
- }
-
- .path-navigator .back-button {
- flex: 0 0 auto;
- }
-
- .path-input-shell {
- display: flex;
- align-items: center;
- gap: 6px;
- flex: 1;
- min-width: 0;
- height: 36px;
- box-sizing: border-box;
- padding-right: 3px;
- border: 1px solid var(--color-border);
- border-radius: 6px;
- background: var(--color-input);
- }
-
- .path-navigator .path-input-shell .path-input {
- flex: 1 1 auto;
- width: 100%;
- height: 100%;
- box-sizing: border-box;
- min-width: 0;
- border: 0;
- background: transparent;
- filter: none;
- color: var(--color-text);
- padding: 0 0 0 0.75rem;
- font: inherit;
- font-size: var(--font-size-small);
- font-family: 'Roboto Mono', monospace;
- -webkit-font-optical-sizing: auto;
- font-optical-sizing: auto;
- line-height: 1;
- transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
- }
-
- .path-navigator .file-browser-header-button > x-icon,
- .path-navigator .nav-button > x-icon,
- .surface-workspace .path-navigator .nav-button > x-icon,
- .surface-workspace .path-navigator .file-browser-header-button > x-icon {
- font-size: 16px;
- }
-
- .path-overflow-up {
- display: inline-grid;
- place-items: center;
- flex: 0 0 16px;
- width: 16px;
- min-width: 16px;
- height: 32px;
- padding: 0;
- border: 0;
- background: transparent;
- color: var(--color-text);
- cursor: pointer;
- }
-
- .path-overflow-up:hover:not(:disabled),
- .path-overflow-up:focus-visible {
- color: var(--color-text-primary);
- }
-
- .path-overflow-up > x-icon {
- width: 16px;
- min-width: 16px;
- height: 16px;
- font-size: 16px;
- line-height: 16px;
- }
-
- .path-overflow-menu {
- position: fixed;
- z-index: 6000;
- display: flex;
- flex-direction: column;
- background: var(--color-background);
- border: 1px solid var(--color-border);
- border-radius: 6px;
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
- max-height: 260px;
- overflow-y: auto;
- }
-
- .path-ancestor {
- display: flex;
- align-items: center;
- gap: 8px;
- width: 100%;
- font-size: var(--font-size-small);
- text-align: left;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .new-items-menu {
- width: 180px;
- }
-
- .new-item {
- gap: 8px;
- color: var(--color-text);
- }
-
- .new-item > x-icon {
- font-size: 16px;
- }
-
- .path-input-shell:focus-within {
- border-color: var(--color-primary);
- background: var(--color-input-focus);
- box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 20%, transparent);
- }
-
- .path-input-shell.has-error {
- border-color: var(--color-error);
- box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-error) 18%, transparent);
- }
-
- .path-input:focus {
- outline: none;
- }
-
- .path-submit {
- color: var(--color-text);
- }
-
- .path-submit:disabled {
- opacity: 0.5;
- cursor: wait;
- }
-
- .path-submit.is-submitting {
- opacity: 1 !important;
- }
-
- .path-error {
- color: var(--color-error);
- font-size: 0.8rem;
- padding: 0 0.25rem;
- }
-
- .path-edit-group,
- .path-buttons-group {
- display: flex;
- align-items: center;
- gap: 8px;
- flex: 1;
- min-width: 0;
- }
-
- .path-buttons-group {
- gap: 2px;
- height: 36px;
- padding: 0 4px;
- border: 1px solid var(--color-border);
- border-radius: 6px;
- background: var(--color-input);
- }
-
- .path-crumbs {
- display: flex;
- align-items: center;
- gap: 0;
- flex: 1;
- min-width: 0;
- overflow-x: auto;
- scrollbar-width: none;
- }
-
- .path-crumbs::-webkit-scrollbar {
- display: none;
- }
-
- .path-crumb {
- flex: 0 0 auto;
- overflow: hidden;
- white-space: nowrap;
- height: 32px;
- padding: 0 4px;
- border-radius: 6px;
- border: 0;
- background: transparent;
- color: var(--color-text);
- font: inherit;
- font-size: var(--font-size-small);
- opacity: 0.85;
- cursor: pointer;
- }
-
- .path-crumb:first-child {
- padding-left: 6px;
- }
-
- .path-crumb:hover:not(:disabled):not(.is-active) {
- background: color-mix(in srgb, var(--color-secondary) 60%, transparent);
- }
-
- .path-crumb.is-active {
- font-weight: 700;
- opacity: 1;
- cursor: default;
- }
-
- .path-crumb.is-drop-target {
- outline: 1px solid var(--color-primary);
- }
-
- .path-crumb-separator {
- margin-left: 4px;
- font-weight: 300;
- opacity: 0.45;
- }
-
- .path-edit-toggle {
- flex: 0 0 auto;
- opacity: 0;
- transition: opacity 120ms ease;
- }
-
- .path-navigator .path-edit-group .path-submit x-icon {
- font-size: 15px;
- }
-
- .path-navigator .path-buttons-group .path-edit-toggle x-icon {
- font-size: 15px;
- }
-
- .path-buttons-group:hover .path-edit-toggle,
- .path-edit-toggle:focus-visible {
- opacity: 0.72;
- }
-
- .path-edit-toggle.is-loading,
- .path-buttons-group:hover .path-edit-toggle.is-loading,
- .path-edit-toggle.is-loading:focus-visible {
- opacity: 1 !important;
- }
-
- .path-edit-spinner {
- width: 13px;
- height: 13px;
- border: 2px solid color-mix(in srgb, var(--color-text) 25%, transparent);
- border-top-color: var(--color-text);
- border-radius: 50%;
- margin: 0;
- display: inline-block;
- animation: spin 1s linear infinite;
- }
-
- .path-buttons-group:hover .path-edit-toggle:hover,
- .path-buttons-group:hover .path-edit-toggle:focus-visible {
- opacity: 1;
- }
-
- .path-suggestions {
- position: fixed;
- background: var(--color-background);
- border: 1px solid var(--color-border);
- border-radius: 6px;
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
- /* 8 suggestion rows (38px each); the store clamps the inline viewport-aware height */
- max-height: 304px;
- overflow-y: auto;
- }
-
- .path-suggestion {
- display: flex;
- align-items: center;
- gap: 8px;
- width: 100%;
- text-align: left;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .path-suggestion.is-active {
- background: color-mix(in srgb, var(--color-text) 8%, transparent);
- }
-
- .file-mass-toolbar {
- border-radius: 8px;
- border-left: 1px solid var(--color-border);
- border-right: 1px solid var(--color-border);
- border-bottom: 1px solid var(--color-border);
- }
-
- .file-mass-toolbar .btn-mass:disabled {
- opacity: 0.55;
- cursor: wait;
- }
-
- .nav-button {
- appearance: none;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- gap: 0.1rem;
- min-height: 2.35rem;
- padding: 0.22rem 0.62rem 0.24rem;
- border: 1px solid var(--color-border);
- border-radius: 6px;
- background: color-mix(in srgb, var(--color-input) 86%, var(--color-panel) 14%);
- color: var(--color-text);
- font: inherit;
- line-height: 1;
- box-shadow: none;
- cursor: pointer;
- transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
- }
- .nav-button.back-button {
- flex: 0 0 auto;
- flex-direction: column;
- min-width: 3.1rem;
- }
- .nav-button .material-symbols-outlined {
- font-size: 1.05rem;
- line-height: 1;
- transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
- }
- .nav-button-label {
- font-size: 0.66rem;
- font-weight: 600;
- letter-spacing: 0;
- line-height: 1;
- }
- .nav-button:hover:not(:disabled) {
- border-color: color-mix(in srgb, var(--color-primary) 34%, var(--color-border));
- background: color-mix(in srgb, var(--color-input-focus) 84%, var(--color-primary) 16%);
- color: var(--color-text);
- }
- .nav-button:focus-visible {
- outline: none;
- border-color: var(--color-primary);
- box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 22%, transparent);
- }
- .nav-button:disabled {
- cursor: not-allowed;
- opacity: 0.5;
- }
- /* Folder Specific Styles */
- .file-item[data-is-dir="true"] {
- cursor: pointer;
- }
- .file-item[draggable="true"] {
- cursor: grab;
- }
- .file-item[draggable="true"]:active {
- cursor: grabbing;
- }
- .file-item[data-is-dir="true"]:hover {
- background-color: var(--color-secondary);
- }
- .file-item[data-is-dir="true"].is-drop-target:hover {
- background: color-mix(in srgb, var(--color-primary) 18%, var(--color-input) 82%);
- }
-
- /* Upload Button Styles */
- .btn-upload {
- display: inline-flex;
- align-items: center;
- padding: 8px 16px;
- background: #4248f1;
- gap: 0.5rem;
- color: white;
- border-radius: 4px;
- cursor: pointer;
- transition: background-color 0.3s ease-in-out;
- }
- .btn-upload > svg {
- width: 20px;
- }
- .btn-upload:hover {
- background-color: #353bc5;
- }
- .btn-upload:active {
- background-color: #2b309c;
- }
-
- .file-browser-footer.is-surface {
- display: flex;
- flex: 0 0 auto;
- justify-content: flex-end;
- gap: var(--spacing-sm);
- padding: var(--spacing-sm);
- border-top: 1px solid var(--color-border);
- background: color-mix(in srgb, var(--color-panel) 90%, var(--color-background) 10%);
- }
-
- .file-browser-picker-actions {
- display: flex;
- flex: 1 1 auto;
- align-items: center;
- justify-content: flex-end;
- gap: var(--spacing-sm);
- min-width: 0;
- }
-
- .file-browser-picker-actions .picker-filename-input {
- flex: 1 1 auto;
- min-width: 0;
- width: 100%;
- box-sizing: border-box;
- }
-
- .file-browser-picker-actions .btn {
- flex-shrink: 0;
- white-space: nowrap;
- }
-
- .picker-inline-error {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: 0.82rem;
- font-weight: 700;
- letter-spacing: 0;
- }
-
- .picker-inline-error {
- color: var(--color-error);
- }
-
-
- /* File Actions */
- .file-actions {
- display: flex;
- gap: var(--spacing-xs);
- justify-content: flex-end;
- padding-right: 0.5rem;
- }
- .file-actions-menu {
- margin: 0;
- }
- .file-browser-header-button,
- .path-navigator .back-button {
- display: inline-grid;
- place-items: center;
- flex: 0 0 32px;
- width: 32px;
- height: 32px;
- min-width: 32px;
- min-height: 32px;
- max-height: 32px;
- box-sizing: border-box;
- padding: 0;
- border: 1px solid color-mix(in srgb, var(--color-border), transparent 12%);
- border-radius: 8px;
- background: color-mix(in srgb, var(--color-panel), var(--color-background) 16%);
- color: var(--color-text);
- cursor: pointer;
- }
- .file-browser-header-button x-icon { font-size: 20px; }
- .file-browser-header-button:hover,
- .file-browser-header-button[aria-pressed="true"] {
- background: color-mix(in srgb, var(--color-text) 8%, var(--color-panel));
- }
- .file-browser-header-button.path-submit {
- flex: 0 0 auto;
- display: inline-grid;
- place-items: center;
- width: 26px;
- height: 26px;
- min-width: 26px;
- min-height: 26px;
- max-height: 26px;
- border: 0;
- border-radius: 4px;
- background: transparent;
- opacity: 0.65;
- cursor: text;
- }
- .file-browser-header-button.path-submit:hover:not(:disabled),
- .file-browser-header-button.path-submit:focus-visible {
- background: transparent;
- opacity: 0.65;
- }
- .file-browser-header-button.path-submit:disabled { opacity: 0.65; cursor: text; }
- .file-browser-header-button:focus-visible { outline: 1px solid var(--color-text-secondary); outline-offset: 2px; }
- .path-navigator .nav-button-label { display: none; }
- .nav-history-button:disabled {
- cursor: not-allowed;
- opacity: 0.5;
- }
- .file-mass-toolbar {
- flex: 0 0 auto;
- flex-flow: row wrap;
- gap: 0.75rem 1rem;
- margin: 0 6px;
- }
- .file-mass-toolbar .selection-info {
- flex-shrink: 0;
- white-space: nowrap;
- }
- .file-mass-toolbar .mass-actions {
- flex-wrap: wrap;
- justify-content: flex-start;
- }
- .file-mass-toolbar .btn-mass {
- flex-shrink: 0;
- white-space: nowrap;
- }
- .file-mass-toolbar .btn-mass.delete { padding-inline: 0.5rem; }
- .file-browser-workspace { display: flex; flex: 1; min-height: 0; min-width: 0; position: relative; overflow: hidden; }
- .file-browser-list-pane { container: file-browser / inline-size; display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; padding: 0 6px; }
- .btn-secondary {
- background: var(--color-secondary);
- color: var(--color-text);
- border: 1px solid var(--color-border);
- }
- .btn-secondary:hover {
- filter: brightness(1.05);
- }
- .btn-secondary:active {
- filter: brightness(0.95);
- }
- /* Responsive Design */
- @media (max-width: 768px) {
- .path-navigator {
- align-items: center;
- flex-direction: row;
- gap: 0.5rem;
- }
- .path-navigator .back-button {
- align-self: stretch;
- }
- .file-header {
- grid-template-columns: 2.25rem minmax(0, 1fr) minmax(5rem, 0.52fr) 8.75rem;
- }
- .file-item {
- grid-template-columns: 2.25rem minmax(0, 1fr) minmax(5rem, 0.5fr) 8.75rem;
- }
- .file-cell-date,
- .file-date {
+ </template>
+ </div>
+
+ <style>
+ .file-browser-shell {
+ width: 100%;
+ min-width: 0;
+ }
+
+ .modal-inner.file-browser-modal {
+ box-sizing: border-box;
+ width: min(78vw, 1040px);
+ height: min(82vh, 820px);
+ min-width: min(420px, calc(100vw - 16px));
+ min-height: min(360px, calc(100vh - 16px));
+ max-width: calc(100vw - 16px);
+ max-height: calc(100vh - 16px);
+ resize: both;
+ overflow: hidden;
+ }
+
+ .modal-inner.file-browser-modal.is-focus-mode {
+ resize: none;
+ border-radius: 6px;
+ }
+
+ .modal-inner.file-browser-modal .modal-header {
+ background: color-mix(in srgb, var(--color-background) 92%, #000 8%);
+ border-bottom: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
+ }
+
+ .modal-inner.file-browser-modal .modal-scroll,
+ .modal-inner.file-browser-modal .modal-bd.file-browser-modal-body {
+ display: flex;
+ flex: 1 1 auto;
+ width: 100%;
+ height: 100%;
+ min-width: 0;
+ min-height: 0;
+ max-height: none;
+ overflow: hidden;
+ padding: 0;
+ }
+
+ .modal-inner.file-browser-modal .modal-bd.file-browser-modal-body > div[x-data],
+ .modal-inner.file-browser-modal .file-browser-shell {
+ display: flex;
+ flex: 1 1 auto;
+ flex-direction: column;
+ height: 100%;
+ min-width: 0;
+ min-height: 0;
+ }
+
+ .file-browser-shell.is-surface {
+ display: flex;
+ flex: 1 1 auto;
+ flex-direction: column;
+ height: 100%;
+ min-height: 0;
+ }
+
+ /* File Browser Root */
+ .file-browser-root {
+ container: file-browser / inline-size;
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ height: 100%;
+ min-height: 400px;
+ }
+
+ .file-browser-root.is-surface {
+ flex: 1 1 auto;
+ min-height: 0;
+ }
+
+ .modal-inner.file-browser-modal .file-browser-root {
+ flex: 1 1 auto;
+ min-height: 0;
+ }
+
+ @keyframes spin {
+ 0% {
+ transform: rotate(0deg);
+ }
+ 100% {
+ transform: rotate(360deg);
+ }
+ }
+
+ /* File Browser Content */
+ .file-browser-content {
+ display: flex;
+ flex-direction: column;
+ padding: 0;
+ gap: 0;
+ min-height: 0;
+ }
+
+ .file-browser-shell.is-surface .file-browser-content {
+ flex: 1 1 auto;
+ overflow: hidden;
+ }
+
+ .modal-inner.file-browser-modal .file-browser-content {
+ flex: 1 1 auto;
+ overflow: hidden;
+ }
+
+ /* File Browser Styles */
+ .files-list {
+ width: 100%;
+ border-radius: 4px;
+ }
+
+ /* Rows act on soon-to-be-replaced entries during background fetches. */
+ .files-list.is-loading .file-item {
+ pointer-events: none;
+ }
+
+ .file-browser-shell.is-surface .files-list,
+ .modal-inner.file-browser-modal .files-list {
+ flex: 1 1 auto;
+ min-height: 0;
+ overflow: auto;
+ background: var(--surface-background);
+ }
+
+ .file-browser-shell.is-surface .file-header {
+ position: sticky;
+ top: 0;
+ z-index: 2;
+ }
+
+ .modal-inner.file-browser-modal .file-header {
+ position: sticky;
+ top: 0;
+ z-index: 2;
+ }
+
+ /* Header Styles */
+ .file-header {
+ width: 100%;
+ border-radius: 4px;
+ overflow: hidden;
+ display: grid;
+ grid-template-columns:
+ 2.5rem minmax(0, 1.5fr) minmax(5.5rem, 0.7fr)
+ minmax(9rem, 1fr) 8.75rem;
+ background: color-mix(in srgb, var(--color-panel) 88%, var(--color-background) 12%);
+ padding: 4px 0;
+ font-weight: bold;
+ color: var(--color-primary);
+ }
+ .file-cell-select,
+ .file-cell-actions {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ .file-cell,
+ .file-cell-size,
+ .file-cell-date {
+ color: var(--color-primary);
+ padding: 4px;
+ cursor: pointer;
+ }
+
+ /* File Item Styles */
+ .file-item {
+ cursor: pointer;
+ display: grid;
+ grid-template-columns:
+ 2.5rem minmax(0, 1.5fr) minmax(5.5rem, 0.7fr)
+ minmax(9rem, 1fr) 8.75rem;
+ align-items: center;
+ padding: 5px 0;
+ font-size: 0.875rem;
+ border-top: 1px solid var(--color-border);
+ transition:
+ background-color 120ms cubic-bezier(0.2, 0, 0, 1),
+ box-shadow 120ms cubic-bezier(0.2, 0, 0, 1),
+ opacity 120ms ease,
+ transform 120ms cubic-bezier(0.2, 0, 0, 1);
+ white-space: nowrap;
+ overflow: visible; /* allow action dropdown menus to overflow the row */
+ color: var(--color-text);
+ }
+ .file-item:hover {
+ background-color: var(--color-secondary);
+ }
+ .file-item.selected {
+ background: color-mix(in srgb, var(--color-primary) 12%, transparent);
+ }
+ .file-item.is-dragging {
+ opacity: 0.45;
+ transform: scale(0.995);
+ }
+ .file-item.is-drop-target,
+ .nav-button.is-drop-target {
+ background: color-mix(in srgb, var(--color-primary) 18%, var(--color-input) 82%);
+ box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--color-primary) 72%, transparent);
+ }
+ .file-item.is-drop-target .file-icon,
+ .nav-button.is-drop-target .material-symbols-outlined {
+ transform: scale(1.12);
+ }
+
+ .file-select-cell {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ cursor: pointer;
+ min-height: 1.75rem;
+ }
+
+ .file-cell-select input,
+ .file-select-cell input {
+ width: 1rem;
+ height: 1rem;
+ accent-color: var(--color-primary);
+ cursor: pointer;
+ }
+
+ /* File Icon and Name */
+ .file-icon {
+ width: 22px;
+ height: 22px;
+ flex: 0 0 22px;
+ object-fit: contain;
+ margin: 0 1rem 0 0.7rem;
+ vertical-align: middle;
+ font-size: var(--font-size-sm);
+ transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
+ }
+ .file-folder-icon {
+ color: #a0a0a0;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 22px;
+ }
+ .file-name {
+ display: flex;
+ align-items: center;
+ font-weight: 500;
+ margin-right: var(--spacing-sm);
+ overflow: hidden;
+ }
+ .file-name > span {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+ .file-size,
+ .file-date {
+ color: var(--color-text-secondary);
+ }
+ /* No Files Message */
+ .no-files {
+ padding: 32px;
+ text-align: center;
+ color: var(--color-text-secondary);
+ }
+ .no-files .btn-clear-search {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.25rem;
+ margin-top: 0.75rem;
+ }
+ /* Light Mode Adjustments */
+ .light-mode .file-item:hover {
+ background-color: var(--color-secondary-light);
+ }
+
+ /* Path Navigator Styles */
+ .path-navigator-wrap {
+ display: flex;
+ flex-direction: column;
+ gap: 0.35rem;
+ }
+
+ .path-navigator {
+ overflow: hidden;
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ background: color-mix(in srgb, var(--color-background) 92%, #000 8%);
+ padding: 7px 10px;
+ margin: 0;
+ border: 0;
+ border-bottom: 1px solid color-mix(in srgb, var(--color-border) 58%, transparent);
+ border-radius: 0;
+ }
+
+ .path-navigator .back-button {
+ flex: 0 0 auto;
+ }
+
+ .path-input-shell {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ flex: 1;
+ min-width: 0;
+ height: 36px;
+ box-sizing: border-box;
+ padding-right: 3px;
+ border: 1px solid var(--color-border);
+ border-radius: 6px;
+ background: var(--color-input);
+ }
+
+ .path-navigator .path-input-shell .path-input {
+ flex: 1 1 auto;
+ width: 100%;
+ height: 100%;
+ box-sizing: border-box;
+ min-width: 0;
+ border: 0;
+ background: transparent;
+ filter: none;
+ color: var(--color-text);
+ padding: 0 0 0 0.75rem;
+ font: inherit;
+ font-size: var(--font-size-small);
+ font-family: "Roboto Mono", monospace;
+ -webkit-font-optical-sizing: auto;
+ font-optical-sizing: auto;
+ line-height: 1;
+ transition:
+ border-color 0.15s ease,
+ box-shadow 0.15s ease,
+ background-color 0.15s ease;
+ }
+
+ .path-navigator .file-browser-header-button > x-icon,
+ .path-navigator .nav-button > x-icon,
+ .surface-workspace .path-navigator .nav-button > x-icon,
+ .surface-workspace .path-navigator .file-browser-header-button > x-icon {
+ font-size: 16px;
+ }
+
+ .path-overflow-up {
+ display: inline-grid;
+ place-items: center;
+ flex: 0 0 16px;
+ width: 16px;
+ min-width: 16px;
+ height: 32px;
+ padding: 0;
+ border: 0;
+ background: transparent;
+ color: var(--color-text);
+ cursor: pointer;
+ }
+
+ .path-overflow-up:hover:not(:disabled),
+ .path-overflow-up:focus-visible {
+ color: var(--color-text-primary);
+ }
+
+ .path-overflow-up > x-icon {
+ width: 16px;
+ min-width: 16px;
+ height: 16px;
+ font-size: 16px;
+ line-height: 16px;
+ }
+
+ .path-overflow-menu {
+ position: fixed;
+ z-index: 6000;
+ display: flex;
+ flex-direction: column;
+ background: var(--color-background);
+ border: 1px solid var(--color-border);
+ border-radius: 6px;
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
+ max-height: 260px;
+ overflow-y: auto;
+ }
+
+ .path-ancestor {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ width: 100%;
+ font-size: var(--font-size-small);
+ text-align: left;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ .new-items-menu {
+ width: 180px;
+ }
+
+ .new-item {
+ gap: 8px;
+ color: var(--color-text);
+ }
+
+ .new-item > x-icon {
+ font-size: 16px;
+ }
+
+ .path-input-shell:focus-within {
+ border-color: var(--color-primary);
+ background: var(--color-input-focus);
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 20%, transparent);
+ }
+
+ .path-input-shell.has-error {
+ border-color: var(--color-error);
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-error) 18%, transparent);
+ }
+
+ .path-input:focus {
+ outline: none;
+ }
+
+ .path-submit {
+ color: var(--color-text);
+ }
+
+ .path-submit:disabled {
+ opacity: 0.5;
+ cursor: wait;
+ }
+
+ .path-submit.is-submitting {
+ opacity: 1 !important;
+ }
+
+ .path-error {
+ color: var(--color-error);
+ font-size: 0.8rem;
+ padding: 0 0.25rem;
+ }
+
+ .path-edit-group,
+ .path-buttons-group {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ flex: 1;
+ min-width: 0;
+ }
+
+ .path-buttons-group {
+ gap: 2px;
+ height: 36px;
+ padding: 0 4px;
+ border: 1px solid var(--color-border);
+ border-radius: 6px;
+ background: var(--color-input);
+ }
+
+ .path-crumbs {
+ display: flex;
+ align-items: center;
+ gap: 0;
+ flex: 1;
+ min-width: 0;
+ overflow-x: auto;
+ scrollbar-width: none;
+ }
+
+ .path-crumbs::-webkit-scrollbar {
display: none;
- }
- .file-actions {
- gap: 0.2rem;
- padding-right: 0.2rem;
- }
- }
- @media (max-width: 540px) {
- .path-navigator .back-button {
+ }
+
+ .path-crumb {
+ flex: 0 0 auto;
+ overflow: hidden;
+ white-space: nowrap;
+ height: 32px;
+ padding: 0 4px;
+ border-radius: 6px;
+ border: 0;
+ background: transparent;
+ color: var(--color-text);
+ font: inherit;
+ font-size: var(--font-size-small);
+ opacity: 0.85;
+ cursor: pointer;
+ }
+
+ .path-crumb:first-child {
+ padding-left: 6px;
+ }
+
+ .path-crumb:hover:not(:disabled):not(.is-active) {
+ background: color-mix(in srgb, var(--color-secondary) 60%, transparent);
+ }
+
+ .path-crumb.is-active {
+ font-weight: 700;
+ opacity: 1;
+ cursor: default;
+ }
+
+ .path-crumb.is-drop-target {
+ outline: 1px solid var(--color-primary);
+ }
+
+ .path-crumb-separator {
+ margin-left: 4px;
+ font-weight: 300;
+ opacity: 0.45;
+ }
+
+ .path-edit-toggle {
+ flex: 0 0 auto;
+ opacity: 0;
+ transition: opacity 120ms ease;
+ }
+
+ .path-navigator .path-edit-group .path-submit x-icon {
+ font-size: 15px;
+ }
+
+ .path-navigator .path-buttons-group .path-edit-toggle x-icon {
+ font-size: 15px;
+ }
+
+ .path-buttons-group:hover .path-edit-toggle,
+ .path-edit-toggle:focus-visible {
+ opacity: 0.72;
+ }
+
+ .path-edit-toggle.is-loading,
+ .path-buttons-group:hover .path-edit-toggle.is-loading,
+ .path-edit-toggle.is-loading:focus-visible {
+ opacity: 1 !important;
+ }
+
+ .path-edit-spinner {
+ width: 13px;
+ height: 13px;
+ border: 2px solid color-mix(in srgb, var(--color-text) 25%, transparent);
+ border-top-color: var(--color-text);
+ border-radius: 50%;
+ margin: 0;
+ display: inline-block;
+ animation: spin 1s linear infinite;
+ }
+
+ .path-buttons-group:hover .path-edit-toggle:hover,
+ .path-buttons-group:hover .path-edit-toggle:focus-visible {
+ opacity: 1;
+ }
+
+ .path-suggestions {
+ position: fixed;
+ background: var(--color-background);
+ border: 1px solid var(--color-border);
+ border-radius: 6px;
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
+ /* 8 suggestion rows (38px each); the store clamps the inline viewport-aware height */
+ max-height: 304px;
+ overflow-y: auto;
+ }
+
+ .path-suggestion {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ width: 100%;
+ text-align: left;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ .path-suggestion:hover {
+ background: transparent;
+ opacity: 0.8;
+ }
+
+ .path-suggestion.is-active {
+ background: var(--color-background-hover);
+ opacity: 1;
+ }
+
+ .file-mass-toolbar {
+ border-radius: 8px;
+ border-left: 1px solid var(--color-border);
+ border-right: 1px solid var(--color-border);
+ border-bottom: 1px solid var(--color-border);
+ }
+
+ .file-mass-toolbar .btn-mass:disabled {
+ opacity: 0.55;
+ cursor: wait;
+ }
+
+ .nav-button {
+ appearance: none;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 0.1rem;
+ min-height: 2.35rem;
+ padding: 0.22rem 0.62rem 0.24rem;
+ border: 1px solid var(--color-border);
+ border-radius: 6px;
+ background: color-mix(in srgb, var(--color-input) 86%, var(--color-panel) 14%);
+ color: var(--color-text);
+ font: inherit;
+ line-height: 1;
+ box-shadow: none;
+ cursor: pointer;
+ transition:
+ background-color 0.15s ease,
+ border-color 0.15s ease,
+ color 0.15s ease,
+ opacity 0.15s ease;
+ }
+ .nav-button.back-button {
+ flex: 0 0 auto;
+ flex-direction: column;
+ min-width: 3.1rem;
+ }
+ .nav-button .material-symbols-outlined {
+ font-size: 1.05rem;
+ line-height: 1;
+ transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
+ }
+ .nav-button-label {
+ font-size: 0.66rem;
+ font-weight: 600;
+ letter-spacing: 0;
+ line-height: 1;
+ }
+ .nav-button:hover:not(:disabled) {
+ border-color: color-mix(in srgb, var(--color-primary) 34%, var(--color-border));
+ background: color-mix(in srgb, var(--color-input-focus) 84%, var(--color-primary) 16%);
+ color: var(--color-text);
+ }
+ .nav-button:focus-visible {
+ outline: none;
+ border-color: var(--color-primary);
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 22%, transparent);
+ }
+ .nav-button:disabled {
+ cursor: not-allowed;
+ opacity: 0.5;
+ }
+ /* Folder Specific Styles */
+ .file-item[data-is-dir="true"] {
+ cursor: pointer;
+ }
+ .file-item[draggable="true"] {
+ cursor: grab;
+ }
+ .file-item[draggable="true"]:active {
+ cursor: grabbing;
+ }
+ .file-item[data-is-dir="true"]:hover {
+ background-color: var(--color-secondary);
+ }
+ .file-item[data-is-dir="true"].is-drop-target:hover {
+ background: color-mix(in srgb, var(--color-primary) 18%, var(--color-input) 82%);
+ }
+
+ /* Upload Button Styles */
+ .btn-upload {
+ display: inline-flex;
+ align-items: center;
+ padding: 8px 16px;
+ background: #4248f1;
+ gap: 0.5rem;
+ color: white;
+ border-radius: 4px;
+ cursor: pointer;
+ transition: background-color 0.3s ease-in-out;
+ }
+ .btn-upload > svg {
+ width: 20px;
+ }
+ .btn-upload:hover {
+ background-color: #353bc5;
+ }
+ .btn-upload:active {
+ background-color: #2b309c;
+ }
+
+ .file-browser-footer.is-surface {
+ display: flex;
+ flex: 0 0 auto;
+ justify-content: flex-end;
+ gap: var(--spacing-sm);
+ padding: var(--spacing-sm);
+ border-top: 1px solid var(--color-border);
+ background: color-mix(in srgb, var(--color-panel) 90%, var(--color-background) 10%);
+ }
+
+ .file-browser-picker-actions {
+ display: flex;
+ flex: 1 1 auto;
+ align-items: center;
+ justify-content: flex-end;
+ gap: var(--spacing-sm);
+ min-width: 0;
+ }
+
+ .file-browser-picker-actions .picker-filename-input {
+ flex: 1 1 auto;
+ min-width: 0;
+ width: 100%;
+ box-sizing: border-box;
+ }
+
+ .file-browser-picker-actions .btn {
+ flex-shrink: 0;
+ white-space: nowrap;
+ }
+
+ .picker-inline-error {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-size: 0.82rem;
+ font-weight: 700;
+ letter-spacing: 0;
+ }
+
+ .picker-inline-error {
+ color: var(--color-error);
+ }
+
+ /* File Actions */
+ .file-actions {
+ display: flex;
+ gap: var(--spacing-xs);
+ justify-content: flex-end;
+ padding-right: 0.5rem;
+ }
+ .file-actions-menu {
+ margin: 0;
+ }
+ .file-browser-header-button,
+ .path-navigator .back-button {
+ display: inline-grid;
+ place-items: center;
+ flex: 0 0 32px;
+ width: 32px;
+ height: 32px;
min-width: 32px;
- padding-inline: 0;
- }
- .path-navigator .nav-button-label {
+ min-height: 32px;
+ max-height: 32px;
+ box-sizing: border-box;
+ padding: 0;
+ border: 1px solid color-mix(in srgb, var(--color-border), transparent 12%);
+ border-radius: 8px;
+ background: color-mix(in srgb, var(--color-panel), var(--color-background) 16%);
+ color: var(--color-text);
+ cursor: pointer;
+ }
+ .file-browser-header-button x-icon {
+ font-size: 20px;
+ }
+ .file-browser-header-button:hover,
+ .file-browser-header-button[aria-pressed="true"] {
+ background: color-mix(in srgb, var(--color-text) 8%, var(--color-panel));
+ }
+ .file-browser-header-button.path-submit {
+ flex: 0 0 auto;
+ display: inline-grid;
+ place-items: center;
+ width: 26px;
+ height: 26px;
+ min-width: 26px;
+ min-height: 26px;
+ max-height: 26px;
+ border: 0;
+ border-radius: 4px;
+ background: transparent;
+ opacity: 0.65;
+ cursor: text;
+ }
+ .file-browser-header-button.path-submit:hover:not(:disabled),
+ .file-browser-header-button.path-submit:focus-visible {
+ background: transparent;
+ opacity: 0.65;
+ }
+ .file-browser-header-button.path-submit:disabled {
+ opacity: 0.65;
+ cursor: text;
+ }
+ .file-browser-header-button:focus-visible {
+ outline: 1px solid var(--color-text-secondary);
+ outline-offset: 2px;
+ }
+ .path-navigator .nav-button-label {
display: none;
- }
- .file-header,
- .file-item {
- grid-template-columns: 2.25rem minmax(0, 1fr) minmax(4.25rem, max-content) 8rem;
- }
- .file-cell-date,
- .file-date {
+ }
+ .nav-history-button:disabled {
+ cursor: not-allowed;
+ opacity: 0.5;
+ }
+ .file-mass-toolbar {
+ flex: 0 0 auto;
+ flex-flow: row wrap;
+ gap: 0.75rem 1rem;
+ margin: 0 6px;
+ }
+ .file-mass-toolbar .selection-info {
+ flex-shrink: 0;
+ white-space: nowrap;
+ }
+ .file-mass-toolbar .mass-actions {
+ flex-wrap: wrap;
+ justify-content: flex-start;
+ }
+ .file-mass-toolbar .btn-mass {
+ flex-shrink: 0;
+ white-space: nowrap;
+ }
+ .file-mass-toolbar .btn-mass.delete {
+ padding-inline: 0.5rem;
+ }
+ .file-browser-workspace {
+ display: flex;
+ flex: 1;
+ min-height: 0;
+ min-width: 0;
+ position: relative;
+ overflow: hidden;
+ }
+ .file-browser-list-pane {
+ container: file-browser / inline-size;
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ min-width: 0;
+ min-height: 0;
+ padding: 0 6px;
+ }
+ .btn-secondary {
+ background: var(--color-secondary);
+ color: var(--color-text);
+ border: 1px solid var(--color-border);
+ }
+ .btn-secondary:hover {
+ filter: brightness(1.05);
+ }
+ .btn-secondary:active {
+ filter: brightness(0.95);
+ }
+ /* Responsive Design */
+ @media (max-width: 768px) {
+ .path-navigator {
+ align-items: center;
+ flex-direction: row;
+ gap: 0.5rem;
+ }
+ .path-navigator .back-button {
+ align-self: stretch;
+ }
+ .file-header {
+ grid-template-columns:
+ 2.25rem minmax(0, 1fr) minmax(5rem, 0.52fr)
+ 8.75rem;
+ }
+ .file-item {
+ grid-template-columns:
+ 2.25rem minmax(0, 1fr) minmax(5rem, 0.5fr)
+ 8.75rem;
+ }
+ .file-cell-date,
+ .file-date {
+ display: none;
+ }
+ .file-actions {
+ gap: 0.2rem;
+ padding-right: 0.2rem;
+ }
+ }
+ @media (max-width: 540px) {
+ .path-navigator .back-button {
+ min-width: 32px;
+ padding-inline: 0;
+ }
+ .path-navigator .nav-button-label {
+ display: none;
+ }
+ .file-header,
+ .file-item {
+ grid-template-columns:
+ 2.25rem minmax(0, 1fr) minmax(4.25rem, max-content)
+ 8rem;
+ }
+ .file-cell-date,
+ .file-date {
+ display: none;
+ }
+ }
+ @container file-browser (max-width: 620px) {
+ .file-header,
+ .file-item {
+ grid-template-columns:
+ 2.25rem minmax(0, 1fr) minmax(4.25rem, max-content)
+ 8rem;
+ }
+ .file-cell-date,
+ .file-date {
+ display: none;
+ }
+ .file-actions {
+ gap: 0.2rem;
+ padding-right: 0.2rem;
+ }
+ .file-browser-picker-actions {
+ flex-wrap: wrap;
+ justify-content: stretch;
+ }
+ .file-browser-picker-actions .picker-filename-input {
+ flex-basis: 100%;
+ }
+ .picker-confirm-button {
+ flex: 1 1 auto;
+ }
+ }
+ .files-list.file-icons-view {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
+ align-content: start;
+ gap: var(--spacing-sm);
+ }
+ .file-icons-view .file-header {
+ grid-column: 1 / -1;
+ }
+ .file-icons-view .file-header .file-cell-size,
+ .file-icons-view .file-header .file-cell-date,
+ .file-icons-view .file-header .file-cell-actions {
display: none;
- }
- }
- @container file-browser (max-width: 620px) {
- .file-header,
- .file-item {
- grid-template-columns: 2.25rem minmax(0, 1fr) minmax(4.25rem, max-content) 8rem;
- }
- .file-cell-date,
- .file-date {
+ }
+ .file-icons-view .file-item {
+ grid-template-columns: 1fr;
+ position: relative;
+ padding: var(--spacing-sm);
+ border: 1px solid var(--color-border);
+ border-radius: var(--border-radius-sm);
+ gap: var(--spacing-sm);
+ }
+ .file-icons-view .file-select-cell {
+ position: absolute;
+ top: var(--spacing-sm);
+ left: var(--spacing-sm);
+ }
+ .file-icons-view .file-name {
+ flex-direction: column;
+ max-height: none;
+ margin: 0;
+ gap: var(--spacing-sm);
+ padding: var(--spacing-sm);
+ text-align: center;
+ }
+ .file-icons-view .file-name span {
+ white-space: normal;
+ overflow-wrap: anywhere;
+ }
+ .file-icons-view .file-icon {
+ width: 48px;
+ height: 48px;
+ flex-basis: 48px;
+ margin: 0;
+ font-size: 48px;
+ }
+ .file-icons-view .file-size,
+ .file-icons-view .file-date {
display: none;
- }
- .file-actions {
- gap: 0.2rem;
- padding-right: 0.2rem;
- }
- .file-browser-picker-actions {
- flex-wrap: wrap;
- justify-content: stretch;
- }
- .file-browser-picker-actions .picker-filename-input {
- flex-basis: 100%;
- }
- .picker-confirm-button {
- flex: 1 1 auto;
- }
- }
- .files-list.file-icons-view {
- display: grid;
- grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
- align-content: start;
- gap: var(--spacing-sm);
- }
- .file-icons-view .file-header { grid-column: 1 / -1; }
- .file-icons-view .file-header .file-cell-size,
- .file-icons-view .file-header .file-cell-date,
- .file-icons-view .file-header .file-cell-actions { display: none; }
- .file-icons-view .file-item {
- grid-template-columns: 1fr;
- position: relative;
- padding: var(--spacing-sm);
- border: 1px solid var(--color-border);
- border-radius: var(--border-radius-sm);
- gap: var(--spacing-sm);
- }
- .file-icons-view .file-select-cell { position: absolute; top: var(--spacing-sm); left: var(--spacing-sm); }
- .file-icons-view .file-name { flex-direction: column; max-height: none; margin: 0; gap: var(--spacing-sm); padding: var(--spacing-sm); text-align: center; }
- .file-icons-view .file-name span { white-space: normal; overflow-wrap: anywhere; }
- .file-icons-view .file-icon { width: 48px; height: 48px; flex-basis: 48px; margin: 0; font-size: 48px; }
- .file-icons-view .file-size,
- .file-icons-view .file-date { display: none; }
- .file-icons-view .file-actions { justify-content: center; padding: 0; }
- @media (prefers-reduced-motion: reduce) {
- .file-item,
- .file-icon,
- .nav-button .material-symbols-outlined {
- transition: none;
- }
- }
- </style>
-</body>
+ }
+ .file-icons-view .file-actions {
+ justify-content: center;
+ padding: 0;
+ }
+ @media (prefers-reduced-motion: reduce) {
+ .file-item,
+ .file-icon,
+ .nav-button .material-symbols-outlined {
+ transition: none;
+ }
+ }
+ </style>
+ </body>
</html>