fix: column view navigation and duplicate app instance

- Fix duplicate tsview-app rendering by checking if element already exists in HTML
- Fix column navigation to expand horizontally instead of resetting
- Remove navigate event dispatch from column folder selection to preserve column state
This commit is contained in:
2026-01-23 23:32:36 +00:00
parent a7ee9dff9f
commit 43210ab3f1
3 changed files with 8 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@@ -186,14 +186,8 @@ export class TsviewS3Columns extends DeesElement {
console.error('Error loading folder:', err);
}
// Dispatch navigate event
this.dispatchEvent(
new CustomEvent('navigate', {
detail: { prefix },
bubbles: true,
composed: true,
})
);
// Note: Don't dispatch navigate event here - columns view expands horizontally
// The navigate event is only for breadcrumb sync, not for column navigation
}
private selectFile(columnIndex: number, key: string) {

View File

@@ -13,9 +13,11 @@ const initApp = async () => {
// Wait for custom elements to be defined
await customElements.whenDefined('tsview-app');
// Create and mount the app
const app = document.createElement('tsview-app');
document.body.appendChild(app);
// Only create the app element if it doesn't already exist in HTML
if (!document.querySelector('tsview-app')) {
const app = document.createElement('tsview-app');
document.body.appendChild(app);
}
console.log('TsView UI ready');
};