Skip to content

Build your personal knowledge base with Trilium Notes

client/tab bar: update the tab icon to follow the active note split

Adorian Doranb1c435b9c098
diff --git a/apps/client/src/widgets/tab_row.ts b/apps/client/src/widgets/tab_row.ts
index 0e2cbed453..0d96843568 100644
--- a/apps/client/src/widgets/tab_row.ts
+++ b/apps/client/src/widgets/tab_row.ts
@@ -931,7 +931,11 @@ export default class TabRowWidget extends BasicWidget {
await this.updateTabTitle($tab, mainContext);
- const note = mainContext.note;
+ // The icon and type classes follow the focused split when this tab is active; otherwise they
+ // fall back to its main (first) split.
+ const activeNtxId = appContext.tabManager.activeNtxId;
+ const displayContext = mainContext.getSubContexts().find((ctx) => ctx.ntxId === activeNtxId) ?? mainContext;
+ const note = displayContext.note;
if (note) {
$tab.addClass(note.getCssClass());
$tab.addClass(utils.getNoteTypeClass(note.type));