@@ -430,7 +451,28 @@
}
/* Layout-specific: push danger button to the left */
- .modal-actions :global(.btn-danger) {
- margin-right: auto;
- }
-
+ .modal-actions :global(.btn-danger) {
+ margin-right: auto;
+ }
+
+ .hidden-toggle {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ cursor: pointer;
+ color: var(--text-primary);
+ font-size: 14px;
+ }
+
+ .hidden-toggle input {
+ width: 16px;
+ height: 16px;
+ accent-color: var(--accent-primary);
+ }
+
+ .hidden-toggle-label {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ }
+
diff --git a/src/lib/components/NavigationItem.svelte b/src/lib/components/NavigationItem.svelte
index 50c397b4c..59bbfa417 100644
--- a/src/lib/components/NavigationItem.svelte
+++ b/src/lib/components/NavigationItem.svelte
@@ -17,7 +17,8 @@
let { icon, label, badge, tooltip, active = false, onclick, onHover, oncontextmenu, class: className = '', showLabel = true, indented = false }: Props = $props();
- // When label is hidden, always show tooltip on hover
+ // Show custom tooltip in both expanded and collapsed sidebar.
+ // Collapsed mode falls back to label when explicit tooltip is missing.
const effectiveTooltip = $derived(showLabel ? tooltip : (tooltip || label));
let showTooltip = $state(false);
@@ -25,6 +26,15 @@
let buttonRef: HTMLButtonElement | null = null;
let tooltipStyle = $state('');
+ function portal(node: HTMLElement) {
+ document.body.appendChild(node);
+ return {
+ destroy() {
+ node.remove();
+ }
+ };
+ }
+
function handleMouseEnter() {
// Call hover callback immediately (for lazy loading)
onHover?.();
@@ -33,7 +43,7 @@
tooltipTimeout = setTimeout(() => {
updateTooltipPosition();
showTooltip = true;
- }, 500); // Delay before showing tooltip
+ }, 350); // Slightly faster than before for better discoverability
}
function handleMouseLeave() {
@@ -47,7 +57,17 @@
function updateTooltipPosition() {
if (!buttonRef) return;
const rect = buttonRef.getBoundingClientRect();
- tooltipStyle = `left: ${rect.right + 8}px; top: ${rect.top + rect.height / 2}px; transform: translateY(-50%);`;
+ const padding = 8;
+ let left = rect.right + 8;
+ let top = rect.top + rect.height / 2;
+
+ // Keep tooltip on-screen while preferring the right side of the item.
+ if (left > window.innerWidth - padding - 40) {
+ left = Math.max(padding, rect.left - 180);
+ }
+ top = Math.min(window.innerHeight - padding, Math.max(padding, top));
+
+ tooltipStyle = `left: ${left}px; top: ${top}px; transform: translateY(-50%);`;
}
@@ -75,7 +95,7 @@
{#if showTooltip && effectiveTooltip}
-