mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
```
fix: prevent file browser flashing and reduce log verbosity - Split visibility and session change handling to avoid redundant directory loads - Only reload directory when component becomes visible or session changes while visible - Change directory browse success log from info to debug level to reduce noise - Fixes issue where file browser would flash/reload unnecessarily on prop changes ```
This commit is contained in:
parent
770951c63a
commit
b74de48ddd
2 changed files with 11 additions and 9 deletions
|
|
@ -129,11 +129,15 @@ export class FileBrowser extends LitElement {
|
||||||
async updated(changedProperties: Map<string, unknown>) {
|
async updated(changedProperties: Map<string, unknown>) {
|
||||||
super.updated(changedProperties);
|
super.updated(changedProperties);
|
||||||
|
|
||||||
if (changedProperties.has('visible') || changedProperties.has('session')) {
|
// Only load directory when the component becomes visible or when session changes while visible
|
||||||
if (this.visible) {
|
if (changedProperties.has('visible') && this.visible) {
|
||||||
this.currentPath = this.session?.workingDir || '.';
|
// Component just became visible
|
||||||
await this.loadDirectory(this.currentPath);
|
this.currentPath = this.session?.workingDir || '.';
|
||||||
}
|
await this.loadDirectory(this.currentPath);
|
||||||
|
} else if (changedProperties.has('session') && this.visible) {
|
||||||
|
// Session changed while component is visible
|
||||||
|
this.currentPath = this.session?.workingDir || '.';
|
||||||
|
await this.loadDirectory(this.currentPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Monaco editor will handle its own updates through properties
|
// Monaco editor will handle its own updates through properties
|
||||||
|
|
|
||||||
|
|
@ -288,10 +288,8 @@ export function createFilesystemRoutes(): Router {
|
||||||
return a.name.localeCompare(b.name);
|
return a.name.localeCompare(b.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.log(
|
logger.debug(
|
||||||
chalk.green(
|
`directory browsed successfully: ${requestedPath} (${filteredFiles.length} items)`
|
||||||
`directory browsed successfully: ${requestedPath} (${filteredFiles.length} items)`
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue