Wiring file watch events WIP

This commit is contained in:
2025-06-20 00:50:43 -05:00
parent 3a29e0dcad
commit 41f6ea5854
9 changed files with 119 additions and 25 deletions

View File

@@ -19,13 +19,25 @@
border-right-style: solid;
border-right-color: #ffffff64;
border-right-width: 2px;
}
.active-tab {
background-color: rgba(255, 255, 255, 0.46);
color: rgba(255, 255, 255, 0.8);
}
.tab:hover {
cursor: pointer;
}
.file-changed {
color: rgba(255, 168, 0, 0.64);
}
.file-deleted {
color: rgba(255, 0, 0, 0.64);
}
.title {
margin-left: 2em;
margin-right: 2em;

View File

@@ -42,9 +42,21 @@ export class TabsComponent {
public ngAfterViewInit(): void {
this.tabsService.getMessage$().pipe(
takeUntil(this.unsubscribe)
).subscribe((data: ServiceMessage) => {
if (data.action === "create-tab") {
this.createTab(data.fileName, data.fileUUID, data.filePath);
).subscribe((message: ServiceMessage) => {
if (message.action === "create-tab") {
this.createTab(message.fileName, message.fileUUID, message.filePath);
} else if (message.action === "file-changed") {
let elm = document.querySelectorAll(`[title="${message.filePath}"]`)[1];
elm.classList.add("file-changed");
elm.classList.remove("file-deleted");
} else if (message.action === "file-deleted") {
let elm = document.querySelectorAll(`[title="${message.filePath}"]`)[1];
elm.classList.add("file-deleted");
elm.classList.remove("file-changed");
} else if (message.action === "file-saved") {
let elm = document.querySelectorAll(`[title="${message.filePath}"]`)[1];
elm.classList.remove("file-deleted");
elm.classList.remove("file-changed");
}
});
}