feat: add text truncation hook and marquee support (#217)

Introduce a hook to detect text truncation for dynamic UI updates
Replace static marquee spans with a reusable marquee component in files and labels
Enable copying of terminal selection on mouse up and touch end
This commit is contained in:
Bohdan Triapitsyn
2026-01-26 00:24:40 +02:00
committed by GitHub
parent f34027df10
commit efe9ad27b7
18 changed files with 537 additions and 57 deletions
+14 -3
View File
@@ -1,18 +1,22 @@
import React from 'react';
import { getSafeStorage } from '@/stores/utils/safeStorage';
import { updateDesktopSettings } from '@/lib/persistence';
const SHOW_HIDDEN_STORAGE_KEY = 'directoryTreeShowHidden';
const SHOW_HIDDEN_EVENT = 'directory-show-hidden-change';
const readStoredShowHidden = (): boolean => {
if (typeof window === 'undefined') {
return false;
return true;
}
try {
const stored = getSafeStorage().getItem(SHOW_HIDDEN_STORAGE_KEY);
if (stored === null) {
return true;
}
return stored === 'true';
} catch {
return false;
return true;
}
};
@@ -23,7 +27,10 @@ export const notifyDirectoryShowHiddenChanged = () => {
window.dispatchEvent(new Event(SHOW_HIDDEN_EVENT));
};
export const setDirectoryShowHidden = (value: boolean) => {
export const setDirectoryShowHidden = (
value: boolean,
options: { persist?: boolean } = {}
) => {
if (typeof window === 'undefined') {
return;
}
@@ -33,6 +40,10 @@ export const setDirectoryShowHidden = (value: boolean) => {
} catch {
// ignore storage errors
}
if (options.persist !== false) {
void updateDesktopSettings({ directoryShowHidden: value });
}
};
export const useDirectoryShowHidden = (): boolean => {