Skip to content

Build your personal knowledge base with Trilium Notes

feat(mobile/tab_switcher): clip note title

Elian Doran05fa1ef2fbfa
diff --git a/apps/client/src/widgets/mobile_widgets/TabSwitcher.css b/apps/client/src/widgets/mobile_widgets/TabSwitcher.css
index 0540f2b540..c281c04d9d 100644
--- a/apps/client/src/widgets/mobile_widgets/TabSwitcher.css
+++ b/apps/client/src/widgets/mobile_widgets/TabSwitcher.css
@@ -12,10 +12,20 @@
.tab-card {
background: var(--card-background-color);
border-radius: 1em;
+ min-width: 0;
header {
padding: 0.5em 1em;
border-bottom: 1px solid var(--main-border-color);
+ display: flex;
+ overflow: hidden;
+
+ .title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ text-wrap: nowrap;
+ font-size: 0.9em;
+ }
}
.tab-preview {
diff --git a/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx b/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx
index c32b742287..4ce8ed4bf6 100644
--- a/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx
+++ b/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx
@@ -62,7 +62,9 @@ function Tab({ noteContext }: {
return (
<div class="tab-card">
- <header>{noteContext.note?.title}</header>
+ <header>
+ <span className="title">{noteContext.note?.title}</span>
+ </header>
<div className={clsx("tab-preview", `type-${note?.type ?? "empty"}`)}>
{note && <NoteContent
note={note}