Compare commits

..

5 Commits

Author SHA1 Message Date
Henrique Dias
8ef8f2c098
chore(release): 2.35.0 2025-06-30 17:03:16 +02:00
Henrique Dias
3b3df83d64 docs: add warning to command runner 2025-06-30 17:01:02 +02:00
Henrique Dias
38d0366acf fix: update documentation links 2025-06-30 17:01:02 +02:00
Henrique Dias
4403cd3572 fix: shell value must be joined by blank space 2025-06-30 17:01:02 +02:00
Foxy Hunter
8d7522049c
feat: Long press selects item in single click mode 2025-06-30 16:14:09 +02:00
5 changed files with 113 additions and 5 deletions

View File

@ -2,6 +2,19 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [2.35.0](https://github.com/filebrowser/filebrowser/compare/v2.34.2...v2.35.0) (2025-06-30)
### Features
* Long press selects item in single click mode ([8d75220](https://github.com/filebrowser/filebrowser/commit/8d7522049ced83f28f0933b55772c32e3ad04627))
### Bug Fixes
* shell value must be joined by blank space ([4403cd3](https://github.com/filebrowser/filebrowser/commit/4403cd35720dbda5a8bb1013b92582accf3317bc))
* update documentation links ([38d0366](https://github.com/filebrowser/filebrowser/commit/38d0366acf88352b5a9a97c45837b0f865efae0b))
### [2.34.2](https://github.com/filebrowser/filebrowser/compare/v2.34.1...v2.34.2) (2025-06-29) ### [2.34.2](https://github.com/filebrowser/filebrowser/compare/v2.34.1...v2.34.2) (2025-06-29)

View File

@ -12,7 +12,7 @@ if [ -f "/.filebrowser.json" ]; then
echo "" echo ""
echo "The volume mount configuration has changed in the latest release." echo "The volume mount configuration has changed in the latest release."
echo "Please rename .filebrowser.json to settings.json and mount the parent directory to /config". echo "Please rename .filebrowser.json to settings.json and mount the parent directory to /config".
echo "Read more on https://github.com/filebrowser/filebrowser/blob/master/docs/installation.md#docker" echo "Read more on https://filebrowser.org/installation.html#docker"
echo "" echo ""
echo "This workaround will be removed in a future release." echo "This workaround will be removed in a future release."
echo "" echo ""
@ -27,7 +27,7 @@ if [ -f "/database.db" ]; then
echo "" echo ""
echo "The volume mount configuration has changed in the latest release." echo "The volume mount configuration has changed in the latest release."
echo "Please rename database.db to filebrowser.db and mount the parent directory to /database". echo "Please rename database.db to filebrowser.db and mount the parent directory to /database".
echo "Read more on https://github.com/filebrowser/filebrowser/blob/master/docs/installation.md#docker" echo "Read more on https://filebrowser.org/installation.html#docker"
echo "" echo ""
echo "This workaround will be removed in a future release." echo "This workaround will be removed in a future release."
echo "" echo ""

View File

@ -8,6 +8,13 @@
@dragover="dragOver" @dragover="dragOver"
@drop="drop" @drop="drop"
@click="itemClick" @click="itemClick"
@mousedown="handleMouseDown"
@mouseup="handleMouseUp"
@mouseleave="handleMouseLeave"
@touchstart="handleTouchStart"
@touchend="handleTouchEnd"
@touchcancel="handleTouchCancel"
@touchmove="handleTouchMove"
:data-dir="isDir" :data-dir="isDir"
:data-type="type" :data-type="type"
:aria-label="name" :aria-label="name"
@ -50,6 +57,12 @@ import { useRouter } from "vue-router";
const touches = ref<number>(0); const touches = ref<number>(0);
const longPressTimer = ref<number | null>(null);
const longPressTriggered = ref<boolean>(false);
const longPressDelay = ref<number>(500);
const startPosition = ref<{ x: number; y: number } | null>(null);
const moveThreshold = ref<number>(10);
const $showError = inject<IToastError>("$showError")!; const $showError = inject<IToastError>("$showError")!;
const router = useRouter(); const router = useRouter();
@ -209,6 +222,12 @@ const drop = async (event: Event) => {
}; };
const itemClick = (event: Event | KeyboardEvent) => { const itemClick = (event: Event | KeyboardEvent) => {
// If long press was triggered, prevent normal click behavior
if (longPressTriggered.value) {
longPressTriggered.value = false;
return;
}
if ( if (
singleClick.value && singleClick.value &&
!(event as KeyboardEvent).ctrlKey && !(event as KeyboardEvent).ctrlKey &&
@ -281,4 +300,76 @@ const getExtension = (fileName: string): string => {
} }
return fileName.substring(lastDotIndex); return fileName.substring(lastDotIndex);
}; };
// Long-press helper functions
const startLongPress = (clientX: number, clientY: number) => {
startPosition.value = { x: clientX, y: clientY };
longPressTimer.value = window.setTimeout(() => {
handleLongPress();
}, longPressDelay.value);
};
const cancelLongPress = () => {
if (longPressTimer.value !== null) {
window.clearTimeout(longPressTimer.value);
longPressTimer.value = null;
}
startPosition.value = null;
};
const handleLongPress = () => {
if (singleClick.value) {
longPressTriggered.value = true;
click(new Event("longpress"));
}
cancelLongPress();
};
const checkMovement = (clientX: number, clientY: number): boolean => {
if (!startPosition.value) return false;
const deltaX = Math.abs(clientX - startPosition.value.x);
const deltaY = Math.abs(clientY - startPosition.value.y);
return deltaX > moveThreshold.value || deltaY > moveThreshold.value;
};
// Event handlers
const handleMouseDown = (event: MouseEvent) => {
if (event.button === 0) {
startLongPress(event.clientX, event.clientY);
}
};
const handleMouseUp = () => {
cancelLongPress();
};
const handleMouseLeave = () => {
cancelLongPress();
};
const handleTouchStart = (event: TouchEvent) => {
if (event.touches.length === 1) {
const touch = event.touches[0];
startLongPress(touch.clientX, touch.clientY);
}
};
const handleTouchEnd = () => {
cancelLongPress();
};
const handleTouchCancel = () => {
cancelLongPress();
};
const handleTouchMove = (event: TouchEvent) => {
if (event.touches.length === 1 && startPosition.value) {
const touch = event.touches[0];
if (checkMovement(touch.clientX, touch.clientY)) {
cancelLongPress();
}
}
};
</script> </script>

View File

@ -65,7 +65,7 @@
<a <a
class="link" class="link"
target="_blank" target="_blank"
href="https://github.com/filebrowser/filebrowser/blob/master/docs/configuration.md#custom-branding" href="https://filebrowser.org/configuration.html#command-runner"
>{{ t("settings.documentation") }}</a >{{ t("settings.documentation") }}</a
> >
</i18n-t> </i18n-t>
@ -204,7 +204,7 @@
<a <a
class="link" class="link"
target="_blank" target="_blank"
href="https://github.com/filebrowser/filebrowser/blob/master/docs/configuration.md#command-runner" href="https://filebrowser.org/configuration.html#command-runner"
>{{ t("settings.documentation") }}</a >{{ t("settings.documentation") }}</a
> >
</i18n-t> </i18n-t>
@ -401,7 +401,7 @@ onMounted(async () => {
originalSettings.value = original; originalSettings.value = original;
settings.value = newSettings; settings.value = newSettings;
shellValue.value = newSettings.shell.join("\n"); shellValue.value = newSettings.shell.join(" ");
} catch (err) { } catch (err) {
if (err instanceof Error) { if (err instanceof Error) {
error.value = err; error.value = err;

View File

@ -97,6 +97,10 @@ filebrowser config set --auth.method=noauth
## Command Runner ## Command Runner
> [!CAUTION]
>
> The **command execution** functionality has been disabled for all existent and new installations by default from version v2.33.8 and onwards, due to continuous and known security vulnerabilities. You should only use this feature if you are aware of all of the security risks involved. For more up to date information, consult issue [#5199](https://github.com/filebrowser/filebrowser/issues/5199).
The command runner is a feature that enables you to execute any shell command you want before or after a certain event. Right now, these are the events: The command runner is a feature that enables you to execute any shell command you want before or after a certain event. Right now, these are the events:
* Copy * Copy