refactor: enhance URL state management for dataset modal and improve snippet creation with tooltip support

This commit is contained in:
2025-11-17 00:39:35 +02:00
parent 11c876f74b
commit c03860d789
3 changed files with 45 additions and 16 deletions

View File

@@ -39,8 +39,8 @@ const URLState = {
if (parts[1] === 'new') {
return { view: 'datasets', snippetId: null, datasetId: 'new' };
}
// #datasets/dataset-123456
if (parts[1].startsWith('dataset-')) {
// #datasets/edit-dataset-123456 or #datasets/dataset-123456
if (parts[1].startsWith('edit-') || parts[1].startsWith('dataset-')) {
return { view: 'datasets', snippetId: null, datasetId: parts[1] };
}
}
@@ -246,6 +246,12 @@ const ModalManager = {
},
close(modalId) {
// Special handling for dataset modal to ensure URL state is updated
if (modalId === 'dataset-modal' && typeof closeDatasetManager === 'function') {
closeDatasetManager();
return;
}
const modal = document.getElementById(modalId);
if (modal) {
modal.style.display = 'none';