feat: improve note path handling and add delete confirmation modal
- Updated API endpoints to handle note paths with slashes using regex routes - Added warning modal component for note deletion confirmation - Fixed URL encoding of note paths to preserve spaces and special characters - Improved fullscreen note handling to use URL state and custom events - Enhanced internal link copying to use proper URL format - Removed test/sample note files from vault directory
This commit is contained in:
@@ -4,6 +4,7 @@ import { FormsModule } from '@angular/forms';
|
||||
import { VaultNode, VaultFile, VaultFolder } from '../../types';
|
||||
import { VaultService } from '../../services/vault.service';
|
||||
import { NoteCreationService } from '../../app/services/note-creation.service';
|
||||
import { UrlStateService } from '../../app/services/url-state.service';
|
||||
import { NotesListFocusService } from '../../app/services/notes-list-focus.service';
|
||||
import { FolderFilterService } from '../../app/services/folder-filter.service';
|
||||
import { BadgeCountComponent } from '../../app/shared/ui/badge-count.component';
|
||||
@@ -184,6 +185,7 @@ export class FileExplorerComponent {
|
||||
private noteCreation = inject(NoteCreationService);
|
||||
private notesListFocus = inject(NotesListFocusService);
|
||||
private folderFilter = inject(FolderFilterService);
|
||||
private urlState = inject(UrlStateService);
|
||||
|
||||
// Computed filtered nodes based on folder filter settings
|
||||
filteredNodes = computed(() => {
|
||||
@@ -569,11 +571,11 @@ export class FileExplorerComponent {
|
||||
|
||||
private copyInternalLink() {
|
||||
if (!this.ctxTarget) return;
|
||||
const link = `[[${this.ctxTarget.path}]]`;
|
||||
navigator.clipboard.writeText(link).then(() => {
|
||||
this.showNotification('Internal link copied to clipboard!', 'success');
|
||||
const url = this.urlState.generateShareUrl({ folder: this.ctxTarget.path });
|
||||
navigator.clipboard.writeText(url).then(() => {
|
||||
this.showNotification('Folder URL copied to clipboard!', 'success');
|
||||
}).catch(() => {
|
||||
this.showNotification('Failed to copy link', 'error');
|
||||
this.showNotification('Failed to copy URL', 'error');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -45,10 +45,9 @@ type NoteAction =
|
||||
animation: fadeIn .12s ease-out;
|
||||
transform-origin: top left;
|
||||
user-select: none;
|
||||
/* Theme-aware background and border */
|
||||
background: var(--card, #ffffff);
|
||||
border: 1px solid var(--border, #e5e7eb);
|
||||
color: var(--fg, #111827);
|
||||
color: var(--text-main, var(--fg, #111827));
|
||||
z-index: 10000;
|
||||
}
|
||||
.item {
|
||||
@@ -113,6 +112,7 @@ type NoteAction =
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@keyframes fadeIn { from { opacity:0; transform: scale(.95);} to { opacity:1; transform: scale(1);} }
|
||||
|
||||
`],
|
||||
template: `
|
||||
<ng-container *ngIf="visible">
|
||||
|
||||
Reference in New Issue
Block a user