feat: add action buttons and long-press support for vault tree items with mobile-friendly context menus

- Add action buttons (ellipsis icon) to vault, directory, and file tree items
- Implement long-press gesture detection for mobile devices with 550ms delay and 10px movement threshold
- Show action buttons on hover for desktop and always visible on mobile/touch devices
- Position context menus near action buttons to prevent off-screen rendering
- Prevent click events from firing after long-press ges
This commit is contained in:
2026-03-30 20:56:34 -04:00
parent 628a664c59
commit db812a6176
2 changed files with 137 additions and 0 deletions
+48
View File
@@ -837,6 +837,9 @@ select {
background: var(--bg-hover);
color: var(--text-primary);
}
.tree-item > .badge-small {
margin-left: auto;
}
.tree-item.active {
background: var(--bg-hover);
color: var(--accent);
@@ -880,6 +883,44 @@ select {
color: var(--accent-green);
}
.tree-item-action-btn {
margin-left: auto;
width: 24px;
height: 24px;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid transparent;
border-radius: 6px;
background: transparent;
color: var(--text-muted);
cursor: pointer;
opacity: 0;
pointer-events: none;
transition:
opacity 140ms ease,
color 140ms ease,
background 140ms ease,
border-color 140ms ease;
flex-shrink: 0;
}
.tree-item-action-btn:hover,
.tree-item-action-btn:focus-visible {
background: color-mix(in srgb, var(--accent) 10%, transparent);
border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
color: var(--accent);
outline: none;
}
.tree-item:hover .tree-item-action-btn,
.tree-item:focus-within .tree-item-action-btn,
.tree-item.path-selected .tree-item-action-btn,
.tree-item.active .tree-item-action-btn {
opacity: 1;
pointer-events: auto;
}
.tree-children {
padding-left: 16px;
overflow: hidden;
@@ -903,6 +944,13 @@ select {
padding: 4px 0 10px 12px;
}
@media (hover: none), (pointer: coarse), (max-width: 768px) {
.tree-item-action-btn {
opacity: 1;
pointer-events: auto;
}
}
.filter-result-item {
align-items: flex-start;
white-space: normal;