From 96be35c105c93f22550ecf387cf39edecbfe824f Mon Sep 17 00:00:00 2001 From: Kashaf Ansari Date: Mon, 6 Jul 2026 13:36:31 +0500 Subject: [PATCH] mobile: fix long tag names overflow and display in tag items (#9950) * mobile: fix long tag names overflow and display in tag items Signed-off-by: kashaf-ansari-dev * mobile: fix long title in side menu Signed-off-by: kashaf-ansari-dev * mobile: fix long notebook title display Signed-off-by: kashaf-ansari-dev * mobile: prevent tag list overlap on first render Signed-off-by: kashaf-ansari-dev --------- Signed-off-by: kashaf-ansari-dev --- .../app/components/side-menu/menu-item.tsx | 7 ++++++- .../app/components/side-menu/notebook-item.tsx | 17 ++++++++++------- .../app/components/side-menu/side-menu-tags.tsx | 13 +++++++++++-- apps/mobile/app/screens/manage-tags/index.tsx | 7 +++++-- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/apps/mobile/app/components/side-menu/menu-item.tsx b/apps/mobile/app/components/side-menu/menu-item.tsx index 95c6bc8bd..ff30aa8dd 100644 --- a/apps/mobile/app/components/side-menu/menu-item.tsx +++ b/apps/mobile/app/components/side-menu/menu-item.tsx @@ -156,7 +156,8 @@ export function MenuItem({ style={{ flexDirection: "row", alignItems: "center", - gap: DefaultAppStyles.GAP_SMALL + gap: DefaultAppStyles.GAP_SMALL, + flexShrink: 1 }} > {renderIcon ? ( @@ -185,6 +186,7 @@ export function MenuItem({ isFocused ? colors.selected.paragraph : colors.primary.paragraph } size={AppFontSize.sm} + style={{ flexShrink: 1 }} > {item.title} @@ -195,6 +197,9 @@ export function MenuItem({ color={ isFocused ? colors.primary.paragraph : colors.secondary.paragraph } + style={{ + marginLeft: DefaultAppStyles.GAP_SMALL + }} > {menuItemCount} diff --git a/apps/mobile/app/components/side-menu/notebook-item.tsx b/apps/mobile/app/components/side-menu/notebook-item.tsx index ec8f49175..1f95b0f6f 100644 --- a/apps/mobile/app/components/side-menu/notebook-item.tsx +++ b/apps/mobile/app/components/side-menu/notebook-item.tsx @@ -72,7 +72,7 @@ export const NotebookItem = ({ const notebook = item.notebook; const isFocused = focused; const { totalNotes, getTotalNotes } = useTotalNotes("notebook"); - const updater = useRelationStore(state => state.updater); + const updater = useRelationStore((state) => state.updater); const getTotalNotesRef = React.useRef(getTotalNotes); getTotalNotesRef.current = getTotalNotes; const { colors } = useThemeColors(); @@ -101,8 +101,8 @@ export const NotebookItem = ({ item.depth === 0 ? undefined : item.depth < 6 - ? 15 * item.depth - : 15 * 5, + ? 15 * item.depth + : 15 * 5, width: "100%", marginTop: 2, opacity: item.disabled ? 0.5 : 1 @@ -162,7 +162,8 @@ export const NotebookItem = ({ @@ -201,6 +202,7 @@ export const NotebookItem = ({ isFocused ? colors.selected.paragraph : colors.primary.paragraph } size={AppFontSize.sm} + style={{ flexShrink: 1 }} > {notebook?.title} @@ -211,7 +213,8 @@ export const NotebookItem = ({ gap: DefaultAppStyles.GAP_SMALL, flexDirection: "row", alignItems: "center", - justifyContent: "center" + justifyContent: "center", + marginLeft: DefaultAppStyles.GAP_SMALL }} > {selectionEnabled ? ( diff --git a/apps/mobile/app/components/side-menu/side-menu-tags.tsx b/apps/mobile/app/components/side-menu/side-menu-tags.tsx index a7c3e2317..95790b7c9 100644 --- a/apps/mobile/app/components/side-menu/side-menu-tags.tsx +++ b/apps/mobile/app/components/side-menu/side-menu-tags.tsx @@ -56,7 +56,7 @@ const TagItem = (props: { const totalNotes = useTotalNotes("tag"); const totalNotesRef = React.useRef(totalNotes); totalNotesRef.current = totalNotes; - const updater = useRelationStore(state => state.updater); + const updater = useRelationStore((state) => state.updater); useEffect(() => { if (item?.id) { @@ -67,6 +67,8 @@ const TagItem = (props: { return ( {item?.title} @@ -173,6 +179,9 @@ const TagItem = (props: { {totalNotes.totalNotes(item?.id)} diff --git a/apps/mobile/app/screens/manage-tags/index.tsx b/apps/mobile/app/screens/manage-tags/index.tsx index ea44e2f93..6c4b5e773 100644 --- a/apps/mobile/app/screens/manage-tags/index.tsx +++ b/apps/mobile/app/screens/manage-tags/index.tsx @@ -398,7 +398,8 @@ const TagItem = ({ flexDirection: "row", marginVertical: 5, justifyContent: "flex-start", - height: 40 + minHeight: 40, + alignItems: "center" }} onPress={() => { if (!tag) return; @@ -438,7 +439,9 @@ const TagItem = ({ /> )} {tag ? ( - {"#" + tag?.title} + + {"#" + tag?.title} + ) : (