Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
chore(web): compact user profile header and in-place views on profiles
johnnyjoygh55d8e6ad4291
diff --git a/web/src/components/AppSidebar/AppSidebar.tsx b/web/src/components/AppSidebar/AppSidebar.tsxindex b21e42819..ea83ef78d 100644--- a/web/src/components/AppSidebar/AppSidebar.tsx+++ b/web/src/components/AppSidebar/AppSidebar.tsx@@ -42,7 +42,8 @@ import useCurrentUser from "@/hooks/useCurrentUser";import { type MemoStatsContext, useFilteredMemoStats } from "@/hooks/useFilteredMemoStats";import useMediaQuery from "@/hooks/useMediaQuery";import { useNotifications, useUser } from "@/hooks/useUserQueries";-import { getMemoScopePath, isMemoScopeRoute, type PrimaryMemoScope, resolveMemoScope } from "@/lib/memo-views";+import { getMemoScopePath, getProfileUsername, type PrimaryMemoScope, resolveMemoScope } from "@/lib/memo-views";+import { userNamePrefix } from "@/lib/resource-names";import { cn } from "@/lib/utils";import { ROUTES } from "@/router/routes";import { State } from "@/types/proto/api/v1/common_pb";@@ -126,9 +127,9 @@ const CollectionSidebarContent = ({ context }: { context: MemoStatsContext }) =>const { mobileOpen, setMobileOpen } = useAppSidebar();const { isInitialized: authInitialized } = useAuth();const { isInitialized: instanceInitialized } = useInstance();- const profileMatch = matchPath("/u/:username", location.pathname);- const { data: profileUser } = useUser(profileMatch?.params.username ? `users/${profileMatch.params.username}` : "", {- enabled: context === "profile" && !!profileMatch?.params.username,+ const profileUsername = getProfileUsername(location.pathname);+ const { data: profileUser } = useUser(`${userNamePrefix}${profileUsername ?? ""}`, {+ enabled: context === "profile" && profileUsername !== undefined,});const statsUserName = context === "home" ? currentUser?.name : context === "profile" ? profileUser?.name : undefined;// User-level collections stay aligned with their unscoped feeds even when a Space is remembered.@@ -141,12 +142,6 @@ const CollectionSidebarContent = ({ context }: { context: MemoStatsContext }) =>enabled: authInitialized && instanceInitialized && (md || mobileOpen),});- const showViews = !!currentUser && (context === "home" || context === "archived" || context === "explore");-- // Off the collection routes (the library shown as fallback content), calendar and tag- // clicks must land somewhere that renders the filtered feed.- const onCollectionRoute = isMemoScopeRoute(location.pathname) || !!profileMatch;- const filterTarget = onCollectionRoute ? undefined : context === "explore" ? ROUTES.EXPLORE : ROUTES.HOME;const tagStateScope = isUserLevelCollection? (statsUserName ?? context): `${statsUserName ?? context}${selectedSpaceName ? `:${selectedSpaceName}` : ""}`;@@ -155,10 +150,11 @@ const CollectionSidebarContent = ({ context }: { context: MemoStatsContext }) =><div className={SIDEBAR_SECTION_STACK_CLASSES}>{context === "profile" && <ProfileMode />}<SidebarSection ariaLabel={t("common.statistics")}>- <StatisticsView statisticsData={statistics} navigationTarget={filterTarget} onDateSelect={() => setMobileOpen(false)} />+ <StatisticsView statisticsData={statistics} onDateSelect={() => setMobileOpen(false)} /></SidebarSection>- {showViews && <ViewsSection />}- <TagsSection tagCount={tags} navigationTarget={filterTarget} scope={tagStateScope} onSelect={() => setMobileOpen(false)} />+ {/* Every collection route narrows the same way: views (yours, so signed-in only), days, tags. */}+ {currentUser && <ViewsSection />}+ <TagsSection tagCount={tags} scope={tagStateScope} onSelect={() => setMobileOpen(false)} /></div>);};diff --git a/web/src/components/AppSidebar/QuickFindDialog.tsx b/web/src/components/AppSidebar/QuickFindDialog.tsxindex fee93cb34..e046b35d9 100644--- a/web/src/components/AppSidebar/QuickFindDialog.tsx+++ b/web/src/components/AppSidebar/QuickFindDialog.tsx@@ -9,7 +9,7 @@ import { type MemoFilter, replaceFiltersByFactor, stringifyFilters, useMemoFilteimport { useSpaceContext } from "@/contexts/SpaceContext";import useCurrentUser from "@/hooks/useCurrentUser";import { useMemoViews } from "@/hooks/useUserQueries";-import { BUILTIN_TASKS_VIEW_ID, getMemoViewId, isMemoScopeRoute } from "@/lib/memo-views";+import { BUILTIN_TASKS_VIEW_ID, getMemoViewId, isMemoCollectionRoute } from "@/lib/memo-views";import { extractSpaceUidFromName, formatSpaceUidForDisplay } from "@/lib/space-display";import { useTranslate } from "@/utils/i18n";import { getRouteActionPolicy, getSidebarRouteKind } from "./routes";@@ -59,7 +59,7 @@ const QuickFindDialog = () => {const { clearSelectedSpace, duplicateSpaceTitles, selectedSpace, selectedSpaceName } = useSpaceContext();const { quickFindOpen, setQuickFindOpen } = useAppSidebar();const [query, setQuery] = useState("");- const viewApplies = isMemoScopeRoute(location.pathname);+ const viewApplies = isMemoCollectionRoute(location.pathname);const selectedMemoView = viewApplies ? memoViews.find((item) => getMemoViewId(item.name) === memoView) : undefined;const lensLabel =viewApplies && memoView === BUILTIN_TASKS_VIEW_ID ? t("common.tasks") : selectedMemoView?.title || getScopeLabel(location.pathname, t);diff --git a/web/src/components/AppSidebar/TagsSection.tsx b/web/src/components/AppSidebar/TagsSection.tsxindex 82326ad8a..bf5bff4f8 100644--- a/web/src/components/AppSidebar/TagsSection.tsx+++ b/web/src/components/AppSidebar/TagsSection.tsx@@ -1,8 +1,7 @@import { HashIcon, ListIcon, ListTreeIcon } from "lucide-react";import { forwardRef, useMemo } from "react";-import { useNavigate } from "react-router-dom";import { Button } from "@/components/ui/button";-import { replaceFiltersByFactor, stringifyFilters, useMemoFilterContext } from "@/contexts/MemoFilterContext";+import { useMemoFilterContext } from "@/contexts/MemoFilterContext";import { useLocalStorage, useOverflowTitle } from "@/hooks";import { cn } from "@/lib/utils";import { useTranslate } from "@/utils/i18n";@@ -23,8 +22,6 @@ import SidebarSection, {interface Props {tagCount: Record<string, number>;onSelect?: () => void;- /** When set, tag clicks land on this route with the tag filter instead of filtering the current one. */- navigationTarget?: string;/** Whose tags these are; keeps tree expansion state from bleeding between users and views. */scope: string;}@@ -76,10 +73,9 @@ const FlatTagRow = ({ tag, amount, active, ariaLabel, onClick }: FlatTagRowProps);};-const TagsSection = ({ tagCount, onSelect, navigationTarget, scope }: Props) => {+const TagsSection = ({ tagCount, onSelect, scope }: Props) => {const t = useTranslate();- const navigate = useNavigate();- const { filters, setFilters, getFiltersByFactor, addFilter, removeFilter } = useMemoFilterContext();+ const { getFiltersByFactor, addFilter, removeFilter } = useMemoFilterContext();const [treeMode, setTreeMode] = useLocalStorage<boolean>("tag-view-as-tree", false);const activeTags = new Set(getFiltersByFactor("tagSearch").map((filter) => filter.value));const activeTag = activeTags.values().next().value as string | undefined;@@ -90,13 +86,6 @@ const TagsSection = ({ tagCount, onSelect, navigationTarget, scope }: Props) =>}const handleTagClick = (tag: string) => {- if (navigationTarget) {- const nextFilters = replaceFiltersByFactor(filters, "tagSearch", [{ factor: "tagSearch", value: tag }]);- setFilters(nextFilters);- navigate({ pathname: navigationTarget, search: `?filter=${stringifyFilters(nextFilters)}` });- onSelect?.();- return;- }const active = activeTags.has(tag);if (active) {removeFilter((filter) => filter.factor === "tagSearch" && filter.value === tag);diff --git a/web/src/components/AppSidebar/ViewsSection.tsx b/web/src/components/AppSidebar/ViewsSection.tsxindex 413a5d70b..18be85686 100644--- a/web/src/components/AppSidebar/ViewsSection.tsx+++ b/web/src/components/AppSidebar/ViewsSection.tsx@@ -13,7 +13,7 @@ import { useMemoFilterContext } from "@/contexts/MemoFilterContext";import useCurrentUser from "@/hooks/useCurrentUser";import { useMemoViews, userKeys } from "@/hooks/useUserQueries";import { handleError } from "@/lib/error";-import { BUILTIN_TASKS_VIEW_ID, getMemoViewId, isMemoScopeRoute } from "@/lib/memo-views";+import { BUILTIN_TASKS_VIEW_ID, getMemoViewId, isMemoCollectionRoute } from "@/lib/memo-views";import { cn } from "@/lib/utils";import { ROUTES } from "@/router/routes";import type { MemoView } from "@/types/proto/api/v1/memo_view_service_pb";@@ -47,7 +47,7 @@ const ViewsSection = ({ manageActive = false }: { manageActive?: boolean }) => {const handleView = (viewId: string) => {setMemoView(selectedMemoView === viewId ? undefined : viewId);- if (!isMemoScopeRoute(location.pathname)) navigate(ROUTES.HOME);+ if (!isMemoCollectionRoute(location.pathname)) navigate(ROUTES.HOME);setMobileOpen(false);};diff --git a/web/src/components/AppSidebar/routes.ts b/web/src/components/AppSidebar/routes.tsindex 5dfb90af5..46a25f48a 100644--- a/web/src/components/AppSidebar/routes.ts+++ b/web/src/components/AppSidebar/routes.ts@@ -1,5 +1,5 @@import { matchPath } from "react-router-dom";-import { isMemoScopeRoute, type MemoScope, resolveMemoScope } from "@/lib/memo-views";+import { getProfileUsername, isMemoScopeRoute, type MemoScope, resolveMemoScope } from "@/lib/memo-views";import { ROUTES } from "@/router/routes";export type SidebarRouteKind = MemoScope | "profile" | "views" | "attachments" | "inbox" | "settings" | "memo" | "common";@@ -17,7 +17,7 @@ export interface RouteActionPolicy {export const getSidebarRouteKind = (path: string): SidebarRouteKind => {const normalizedPath = path.length > 1 ? path.replace(/\/+$/, "") : path;if (isMemoScopeRoute(normalizedPath)) return resolveMemoScope(normalizedPath);- if (matchPath("/u/:username", normalizedPath)) return "profile";+ if (getProfileUsername(normalizedPath) !== undefined) return "profile";if (matchPath(ROUTES.VIEWS, normalizedPath)) return "views";if (matchPath(ROUTES.ATTACHMENTS, normalizedPath)) return "attachments";if (matchPath(ROUTES.INBOX, normalizedPath)) return "inbox";diff --git a/web/src/components/ColumnGrid/ColumnGrid.tsx b/web/src/components/ColumnGrid/ColumnGrid.tsxindex 2081a1f94..20b1a2362 100644--- a/web/src/components/ColumnGrid/ColumnGrid.tsx+++ b/web/src/components/ColumnGrid/ColumnGrid.tsx@@ -10,6 +10,8 @@ interface ColumnGridProps<T> {estimateHeight?: (item: T, context: { columnWidth: number }) => number;/** Optional node packed as the very first tile (e.g. the note composer). */leading?: ReactNode;+ /** Optional node spanning the packed columns above them all (e.g. a page identity block). */+ header?: ReactNode;/** Key that must land at the top of column one (e.g. a just-created memo), not the shortest column. */priorityKey?: string;/** Upper bound on the column count; 0 or undefined means as many as fit. */@@ -19,6 +21,7 @@ interface ColumnGridProps<T> {}const LEADING_KEY = "__grid_leading__";+const HEADER_KEY = "__grid_header__";const GRID_MIN_COLUMN_WIDTH = 260;export const GRID_GAP = 12;@@ -76,6 +79,7 @@ function ColumnGrid<T>({renderItem,estimateHeight,leading,+ header,priorityKey,maxColumns,maxColumnWidth,@@ -105,7 +109,15 @@ function ColumnGrid<T>({let columnWidth = count > 1 ? Math.floor((width - GRID_GAP * (count - 1)) / count) : width;if (maxColumnWidth != null) columnWidth = Math.min(columnWidth, maxColumnWidth);// Center the packed columns in whatever width the clamp leaves over.- const offsetX = Math.floor((width - (columnWidth * count + GRID_GAP * (count - 1))) / 2);+ const packedWidth = columnWidth * count + GRID_GAP * (count - 1);+ const offsetX = Math.floor((width - packedWidth) / 2);++ // The header is not a column item: it spans the packed columns and pushes them all down.+ const headerEl = itemRefs.current.get(HEADER_KEY);+ if (headerEl) {+ headerEl.style.width = `${packedWidth}px`;+ headerEl.style.left = `${offsetX}px`;+ }// Ordered by feed position: the leading tile (composer) first, then items.const ordered: { key: string; el: HTMLDivElement }[] = [];@@ -133,12 +145,17 @@ function ColumnGrid<T>({// Pass 2 (reads): height of every card, measured once after the width writes so the// browser reflows a single time. We read the inner element, not the absolutely-positioned// wrapper (whose block-formatting context would fold in margins).+ const measure = (el: HTMLElement) => {+ const child = el.firstElementChild;+ return child instanceof HTMLElement ? child.offsetHeight : el.offsetHeight;+ };const heightByKey = new Map<string, number>();for (const { key, el } of ordered) {- const child = el.firstElementChild;- heightByKey.set(key, child instanceof HTMLElement ? child.offsetHeight : el.offsetHeight);+ heightByKey.set(key, measure(el));}const heightOf = (key: string) => heightByKey.get(key) ?? 0;+ // Same pass as the cards, so the header's width write above reflows with theirs.+ const columnStartY = headerEl ? measure(headerEl) + GRID_GAP : 0;const pinnedKeys = new Set<string>([LEADING_KEY]);if (priorityKey) {@@ -154,7 +171,7 @@ function ColumnGrid<T>({},});- const columnY = new Array<number>(count).fill(0);+ const columnY = new Array<number>(count).fill(columnStartY);const pos = new Map<string, { x: number; y: number }>();for (const { key } of ordered) {const col = columnOf.get(key) ?? 0;@@ -265,6 +282,13 @@ function ColumnGrid<T>({return (<div ref={containerRef} className="relative w-full" style={{ height: containerHeight }}>+ {header != null && (+ // Spans the packed columns; positioned with left/top like the leading tile so it is+ // never a containing block for fixed descendants either.+ <div key={HEADER_KEY} ref={getItemRef(HEADER_KEY)} className="absolute top-0 left-0">+ {header}+ </div>+ )}{leading != null && (// Positioned with left/top (see relayout), and deliberately WITHOUT// transform/will-change so it never establishes a containing block that would trapdiff --git a/web/src/components/MemoFilters.tsx b/web/src/components/MemoFilters.tsxindex ca277c455..b22bc546e 100644--- a/web/src/components/MemoFilters.tsx+++ b/web/src/components/MemoFilters.tsx@@ -20,7 +20,7 @@ import { Button } from "@/components/ui/button";import { type FilterFactor, getMemoFilterKey, type MemoFilter, useMemoFilterContext } from "@/contexts/MemoFilterContext";import useCurrentUser from "@/hooks/useCurrentUser";import { useMemoViews } from "@/hooks/useUserQueries";-import { BUILTIN_TASKS_VIEW_ID, getMemoViewId, isMemoScopeRoute } from "@/lib/memo-views";+import { BUILTIN_TASKS_VIEW_ID, getMemoViewId, isMemoCollectionRoute } from "@/lib/memo-views";import { cn } from "@/lib/utils";import { useTranslate } from "@/utils/i18n";@@ -98,7 +98,7 @@ const MemoFilters = ({ className }: { className?: string }) => {const currentUser = useCurrentUser();const { filters, memoView, removeFilter, setMemoView } = useMemoFilterContext();// A remembered view only narrows the collection routes; elsewhere it is dormant and must not be echoed.- const viewApplies = memoView !== undefined && isMemoScopeRoute(location.pathname);+ const viewApplies = memoView !== undefined && isMemoCollectionRoute(location.pathname);const { data: memoViews = [] } = useMemoViews(viewApplies ? currentUser?.name : undefined);const handleRemoveFilter = (filter: MemoFilter) => {diff --git a/web/src/components/MemoView/navigation.ts b/web/src/components/MemoView/navigation.tsindex 94ccf3c4c..c1618cbe3 100644--- a/web/src/components/MemoView/navigation.ts+++ b/web/src/components/MemoView/navigation.ts@@ -1,4 +1,4 @@-import { isMemoScopeRoute } from "@/lib/memo-views";+import { getProfileUsername, isMemoScopeRoute } from "@/lib/memo-views";import { ROUTES } from "@/router/routes";export type MemoOriginScope = "all" | "preserve";@@ -113,7 +113,7 @@ export const withMemoFilter = (page: string, filter: string): string => {const pathname = questionMark === -1 ? pathAndSearch : pathAndSearch.slice(0, questionMark);const search = questionMark === -1 ? "" : pathAndSearch.slice(questionMark + 1);const searchParams = new URLSearchParams(search);- if (/^\/u\//i.test(pathname) && searchParams.get("view") === "map") {+ if (getProfileUsername(pathname) !== undefined && searchParams.get("view") === "map") {searchParams.delete("view");}searchParams.set("filter", filter);diff --git a/web/src/components/PagedMemoList/PagedMemoList.tsx b/web/src/components/PagedMemoList/PagedMemoList.tsxindex 05541bb2f..f1cec2279 100644--- a/web/src/components/PagedMemoList/PagedMemoList.tsx+++ b/web/src/components/PagedMemoList/PagedMemoList.tsx@@ -47,6 +47,10 @@ interface Props {enabled?: boolean;/** Route-owned content rendered before the list and inside column one in grid mode. */renderLeading?: (options: { useGrid: boolean }) => ReactNode;+ /** Route-owned content spanning the full list width above every column (e.g. a page identity block). */+ renderHeader?: (options: { useGrid: boolean }) => ReactNode;+ /** Replaces the generic empty-state message when the route knows why the list is empty. */+ emptyMessage?: string;}function useAutoFetchWhenNotScrollable({@@ -195,6 +199,7 @@ const PagedMemoList = (props: Props) => {}, [isDisplayPending, hasNextPage, isFetchingNextPage, fetchNextPage]);const leadingContent = props.renderLeading?.({ useGrid });+ const headerContent = props.renderHeader?.({ useGrid });// A freshly created memo is hoisted to the front; pin it to the top of column one so it// appears right under the composer instead of dropping into a random (shortest) column.@@ -219,7 +224,7 @@ const PagedMemoList = (props: Props) => {const emptyPlaceholder =!isDisplayPending && !isFetchingNextPage && !hasNextPage && displayMemoList.length === 0 ? (- <Placeholder variant="empty" message={t("message.no-data")} className="w-full" />+ <Placeholder variant="empty" message={props.emptyMessage ?? t("message.no-data")} className="w-full" />) : null;const initialLoader = isDisplayPending && showLoader ? <Loader /> : null;@@ -261,6 +266,7 @@ const PagedMemoList = (props: Props) => {getKey={getMemoKey}renderItem={(memo) => props.renderer(memo, { compact: effectiveCompact })}estimateHeight={estimateMemoCardHeight}+ header={headerContent}leading={gridLeading}priorityKey={priorityKey}maxColumns={maxColumns}@@ -270,6 +276,7 @@ const PagedMemoList = (props: Props) => {</>) : (<>+ {headerContent}{leadingContent}<MemoFilters className="mb-2" />{initialLoader}diff --git a/web/src/components/StatisticsView/StatisticsView.tsx b/web/src/components/StatisticsView/StatisticsView.tsxindex 7d5dec736..29adb84d7 100644--- a/web/src/components/StatisticsView/StatisticsView.tsx+++ b/web/src/components/StatisticsView/StatisticsView.tsx@@ -9,15 +9,13 @@ import { MonthNavigator } from "./MonthNavigator";interface Props {statisticsData: StatisticsData;onDateSelect?: () => void;- /** When set, day clicks land on this route with the date filter instead of filtering the current one. */- navigationTarget?: string;}const StatisticsView = (props: Props) => {const { statisticsData } = props;const { activityStats, timeBasis } = statisticsData;const { filters } = useMemoFilterContext();- const navigateToDateFilter = useDateFilterNavigation(props.navigationTarget);+ const navigateToDateFilter = useDateFilterNavigation();const [visibleMonthString, setVisibleMonthString] = useState(dayjs().format("YYYY-MM"));const selectedDate = filters.find((filter) => filter.factor === "displayTime")?.value;diff --git a/web/src/hooks/useDateFilterNavigation.ts b/web/src/hooks/useDateFilterNavigation.tsindex e1b969741..0683058d6 100644--- a/web/src/hooks/useDateFilterNavigation.ts+++ b/web/src/hooks/useDateFilterNavigation.ts@@ -2,7 +2,7 @@ import { useCallback } from "react";import { useLocation, useNavigate } from "react-router-dom";import { replaceFiltersByFactor, stringifyFilters, useMemoFilterContext } from "@/contexts/MemoFilterContext";-export const useDateFilterNavigation = (targetPath?: string) => {+export const useDateFilterNavigation = () => {const navigate = useNavigate();const location = useLocation();const { filters, setFilters } = useMemoFilterContext();@@ -10,14 +10,12 @@ export const useDateFilterNavigation = (targetPath?: string) => {const navigateToDateFilter = useCallback((date: string) => {const nextFilters = replaceFiltersByFactor(filters, "displayTime", [{ factor: "displayTime", value: date }]);- const filterQuery = stringifyFilters(nextFilters);- const basePath = targetPath ?? location.pathname;- const nextSearchParams = targetPath ? new URLSearchParams() : new URLSearchParams(location.search);- nextSearchParams.set("filter", filterQuery);+ const nextSearchParams = new URLSearchParams(location.search);+ nextSearchParams.set("filter", stringifyFilters(nextFilters));setFilters(nextFilters);- navigate({ pathname: basePath, search: nextSearchParams.toString() });+ navigate({ pathname: location.pathname, search: nextSearchParams.toString() });},- [filters, location.pathname, location.search, navigate, setFilters, targetPath],+ [filters, location.pathname, location.search, navigate, setFilters],);return navigateToDateFilter;diff --git a/web/src/lib/memo-views.ts b/web/src/lib/memo-views.tsindex 653093873..8b79eeb50 100644--- a/web/src/lib/memo-views.ts+++ b/web/src/lib/memo-views.ts@@ -21,6 +21,23 @@ export const isMemoScopeRoute = (pathname: string): boolean => {return comparablePath === ROUTES.HOME || comparablePath === ROUTES.EXPLORE || comparablePath === ROUTES.ARCHIVED;};+const PROFILE_ROUTE_PATTERN = /^\/u\/([^/]+)$/i;++/** The decoded username when `pathname` is a user profile (`/u/:username`), else undefined. */+export const getProfileUsername = (pathname: string): string | undefined => {+ const match = cleanPathname(pathname).match(PROFILE_ROUTE_PATTERN);+ return match ? decodeURIComponent(match[1]) : undefined;+};++/**+ * Routes that render a memo collection the sidebar can narrow: the scope routes plus a+ * user profile. Views, calendar days and tags apply in place on all of them. This is a+ * different question from `isMemoCollectionOrigin` (MemoView/navigation.ts), which asks+ * whether returning to a route should keep the remembered Space.+ */+export const isMemoCollectionRoute = (pathname: string): boolean =>+ isMemoScopeRoute(pathname) || getProfileUsername(pathname) !== undefined;+export const getMemoScopePath = (scope: PrimaryMemoScope): string => {if (scope === "explore") return ROUTES.EXPLORE;return ROUTES.HOME;@@ -40,9 +57,9 @@ export const resolveMemoScope = (pathname: string, options: ResolveMemoScopeOptiif (comparablePath === ROUTES.ARCHIVED) return "archived";if (comparablePath === ROUTES.HOME) return "home";- const profileMatch = cleanPath.match(/^\/u\/([^/]+)$/i);- if (profileMatch) {- return options.currentUsername && decodeURIComponent(profileMatch[1]) === options.currentUsername ? "home" : "explore";+ const profileUsername = getProfileUsername(cleanPath);+ if (profileUsername !== undefined) {+ return options.currentUsername && profileUsername === options.currentUsername ? "home" : "explore";}if (comparablePath.startsWith("/memos/") && options.detailFrom) {diff --git a/web/src/locales/ar.json b/web/src/locales/ar.jsonindex 15a0d382a..5914ebf9f 100644--- a/web/src/locales/ar.json+++ b/web/src/locales/ar.json@@ -257,8 +257,7 @@"restored-successfully": "تمت الاستعادة بنجاح","succeed-copy-content": "تم نسخ المحتوى بنجاح.","succeed-copy-link": "تم نسخ الرابط بنجاح.",- "update-succeed": "تم التحديث بنجاح",- "user-not-found": "المستخدم غير موجود"+ "update-succeed": "تم التحديث بنجاح"},"reference": {"add-references": "إضافة مراجع",diff --git a/web/src/locales/bg.json b/web/src/locales/bg.jsonindex dc4860d1f..3be0daa79 100644--- a/web/src/locales/bg.json+++ b/web/src/locales/bg.json@@ -328,8 +328,7 @@"restored-successfully": "Възстановен успешно","succeed-copy-content": "Съдържанието е копирано успешно.","succeed-copy-link": "Връзката е копирана успешно.",- "update-succeed": "Актуализацията е успешна",- "user-not-found": "Потребителят не е намерен"+ "update-succeed": "Актуализацията е успешна"},"reference": {"add-references": "Добавете препратки",diff --git a/web/src/locales/ca.json b/web/src/locales/ca.jsonindex 15f3a8173..6b79967e1 100644--- a/web/src/locales/ca.json+++ b/web/src/locales/ca.json@@ -291,8 +291,7 @@"restored-successfully": "Restaurat correctament","succeed-copy-content": "Contingut copiat correctament.","succeed-copy-link": "Enllaç copiat correctament.",- "update-succeed": "Actualització correcta",- "user-not-found": "Usuari no trobat"+ "update-succeed": "Actualització correcta"},"reference": {"add-references": "Afegeix referències",diff --git a/web/src/locales/cs.json b/web/src/locales/cs.jsonindex b80be67a9..304535bba 100644--- a/web/src/locales/cs.json+++ b/web/src/locales/cs.json@@ -291,8 +291,7 @@"restored-successfully": "Úspěšně obnoveno","succeed-copy-content": "Obsah úspěšně zkopírován.","succeed-copy-link": "Odkaz byl úspěšně zkopírován.",- "update-succeed": "Aktualizace proběhla úspěšně",- "user-not-found": "Uživatel nenalezen"+ "update-succeed": "Aktualizace proběhla úspěšně"},"reference": {"add-references": "Přidat odkazy",diff --git a/web/src/locales/da.json b/web/src/locales/da.jsonindex b01ba08cb..62e0cead4 100644--- a/web/src/locales/da.json+++ b/web/src/locales/da.json@@ -328,8 +328,7 @@"restored-successfully": "Gendannet med succes","succeed-copy-content": "Indholdet blev kopieret.","succeed-copy-link": "Linket blev kopieret.",- "update-succeed": "Opdatering lykkedes",- "user-not-found": "Bruger ikke fundet"+ "update-succeed": "Opdatering lykkedes"},"reference": {"add-references": "Tilføj referencer",diff --git a/web/src/locales/de.json b/web/src/locales/de.jsonindex e5e2b5486..26fa2da82 100644--- a/web/src/locales/de.json+++ b/web/src/locales/de.json@@ -291,8 +291,7 @@"restored-successfully": "Erfolgreich wiederhergestellt","succeed-copy-content": "Inhalt erfolgreich kopiert.","succeed-copy-link": "Link erfolgreich kopiert",- "update-succeed": "Update erfolgreich",- "user-not-found": "Benutzer nicht gefunden"+ "update-succeed": "Update erfolgreich"},"reference": {"add-references": "Referenzen hinzufügen",diff --git a/web/src/locales/el.json b/web/src/locales/el.jsonindex e16ce3cf9..c853cd97f 100644--- a/web/src/locales/el.json+++ b/web/src/locales/el.json@@ -328,8 +328,7 @@"restored-successfully": "Έγινε επαναφορά με επιτυχία","succeed-copy-content": "Το περιεχόμενο αντιγράφηκε με επιτυχία.","succeed-copy-link": "Ο σύνδεσμος αντιγράφηκε με επιτυχία.",- "update-succeed": "Η ενημέρωση ολοκληρώθηκε με επιτυχία",- "user-not-found": "Ο χρήστης δεν βρέθηκε"+ "update-succeed": "Η ενημέρωση ολοκληρώθηκε με επιτυχία"},"reference": {"add-references": "Προσθήκη παραπομπών",diff --git a/web/src/locales/en-GB.json b/web/src/locales/en-GB.jsonindex 658b04bea..6d878d406 100644--- a/web/src/locales/en-GB.json+++ b/web/src/locales/en-GB.json@@ -291,8 +291,7 @@"restored-successfully": "Restored successfully","succeed-copy-content": "Content copied successfully.","succeed-copy-link": "Link copied successfully.",- "update-succeed": "Update succeeded",- "user-not-found": "User not found"+ "update-succeed": "Update succeeded"},"reference": {"add-references": "Add references",diff --git a/web/src/locales/en.json b/web/src/locales/en.jsonindex c47d1d5ba..5b6b17f44 100644--- a/web/src/locales/en.json+++ b/web/src/locales/en.json@@ -465,8 +465,12 @@"restored-successfully": "Restored successfully","succeed-copy-content": "Content copied successfully.","succeed-copy-link": "Link copied successfully.",- "update-succeed": "Update succeeded",- "user-not-found": "User not found"+ "update-succeed": "Update succeeded"+ },+ "profile": {+ "no-shared-memos": "@{{username}} hasn't shared any memos yet.",+ "not-found-description": "There's no Memos user named @{{username}} on this instance.",+ "not-found-title": "No one here"},"reference": {"add-references": "Add references",diff --git a/web/src/locales/es.json b/web/src/locales/es.jsonindex 507373a79..1fb81f2e2 100644--- a/web/src/locales/es.json+++ b/web/src/locales/es.json@@ -291,8 +291,7 @@"restored-successfully": "Restaurado con éxito","succeed-copy-content": "Contenido copiado correctamente.","succeed-copy-link": "Enlace copiado correctamente.",- "update-succeed": "Actualización exitosa",- "user-not-found": "Usuario no encontrado"+ "update-succeed": "Actualización exitosa"},"reference": {"add-references": "Agregar referencias",diff --git a/web/src/locales/et.json b/web/src/locales/et.jsonindex 83130de15..2574272d8 100644--- a/web/src/locales/et.json+++ b/web/src/locales/et.json@@ -328,8 +328,7 @@"restored-successfully": "Taastatud edukalt","succeed-copy-content": "Sisu kopeerimine õnnestus.","succeed-copy-link": "Link on edukalt kopeeritud.",- "update-succeed": "Värskendus õnnestus",- "user-not-found": "Kasutajat ei leitud"+ "update-succeed": "Värskendus õnnestus"},"reference": {"add-references": "Lisa viited",diff --git a/web/src/locales/fa.json b/web/src/locales/fa.jsonindex 94ba95deb..37d92b769 100644--- a/web/src/locales/fa.json+++ b/web/src/locales/fa.json@@ -257,8 +257,7 @@"restored-successfully": "با موفقیت بازیابی شد","succeed-copy-content": "محتوا با موفقیت کپی شد.","succeed-copy-link": "پیوند با موفقیت کپی شد.",- "update-succeed": "بروزرسانی موفق بود",- "user-not-found": "کاربر یافت نشد"+ "update-succeed": "بروزرسانی موفق بود"},"reference": {"add-references": "افزودن منابع",diff --git a/web/src/locales/fi.json b/web/src/locales/fi.jsonindex 1f54a0689..dcf7f9086 100644--- a/web/src/locales/fi.json+++ b/web/src/locales/fi.json@@ -328,8 +328,7 @@"restored-successfully": "Palautettu onnistuneesti","succeed-copy-content": "Sisällön kopiointi onnistui.","succeed-copy-link": "Linkin kopioiminen onnistui.",- "update-succeed": "Päivitys onnistui",- "user-not-found": "Käyttäjää ei löydy"+ "update-succeed": "Päivitys onnistui"},"reference": {"add-references": "Lisää viitteitä",diff --git a/web/src/locales/fr.json b/web/src/locales/fr.jsonindex 1967a8b46..7bb365800 100644--- a/web/src/locales/fr.json+++ b/web/src/locales/fr.json@@ -291,8 +291,7 @@"restored-successfully": "Restauré avec succès","succeed-copy-content": "Contenu copié avec succès.","succeed-copy-link": "Lien copié avec succès.",- "update-succeed": "Mise à jour réussie",- "user-not-found": "Utilisateur non trouvé"+ "update-succeed": "Mise à jour réussie"},"reference": {"add-references": "Ajouter des références",diff --git a/web/src/locales/gl.json b/web/src/locales/gl.jsonindex 47d478ca9..13a386898 100644--- a/web/src/locales/gl.json+++ b/web/src/locales/gl.json@@ -291,8 +291,7 @@"restored-successfully": "Recuperación correcta","succeed-copy-content": "Contido copiado correctamente.","succeed-copy-link": "Ligazón copiada correctamente.",- "update-succeed": "Fíxose a actualización",- "user-not-found": "Non se atopa a usuaria"+ "update-succeed": "Fíxose a actualización"},"reference": {"add-references": "Engadir referencias",diff --git a/web/src/locales/he.json b/web/src/locales/he.jsonindex 2ba2cda6e..4913c7f7c 100644--- a/web/src/locales/he.json+++ b/web/src/locales/he.json@@ -454,8 +454,7 @@"restored-successfully": "שוחזר בהצלחה","succeed-copy-content": "התוכן הועתק בהצלחה.","succeed-copy-link": "הקישור הועתק בהצלחה.",- "update-succeed": "העדכון הצליח",- "user-not-found": "המשתמש לא נמצא"+ "update-succeed": "העדכון הצליח"},"reference": {"add-references": "הוסף הפניות",diff --git a/web/src/locales/hi.json b/web/src/locales/hi.jsonindex 61ae0cd03..7ebde1207 100644--- a/web/src/locales/hi.json+++ b/web/src/locales/hi.json@@ -257,8 +257,7 @@"restored-successfully": "सफलतापूर्वक पुनर्स्थापित किया गया","succeed-copy-content": "सामग्री सफलतापूर्वक कॉपी की गई।","succeed-copy-link": "लिंक सफलतापूर्वक कॉपी किया गया।",- "update-succeed": "अपडेट सफल हुआ",- "user-not-found": "उपयोगकर्ता नहीं मिला"+ "update-succeed": "अपडेट सफल हुआ"},"reference": {"add-references": "संदर्भ जोड़ें",diff --git a/web/src/locales/hr.json b/web/src/locales/hr.jsonindex aafafafa9..16f8a8c58 100644--- a/web/src/locales/hr.json+++ b/web/src/locales/hr.json@@ -291,8 +291,7 @@"restored-successfully": "Uspješno vraćeno","succeed-copy-content": "Sadržaj uspješno kopiran.","succeed-copy-link": "Link je uspješno kopiran.",- "update-succeed": "Ažuriranje uspješno",- "user-not-found": "Korisnik nije pronađen"+ "update-succeed": "Ažuriranje uspješno"},"reference": {"add-references": "Dodaj reference",diff --git a/web/src/locales/hu.json b/web/src/locales/hu.jsonindex 93f761460..fa0a7be52 100644--- a/web/src/locales/hu.json+++ b/web/src/locales/hu.json@@ -291,8 +291,7 @@"restored-successfully": "Sikeres visszaállítás","succeed-copy-content": "Tartalom sikeresen másolva.","succeed-copy-link": "Hivatkozás sikeresen másolva.",- "update-succeed": "Sikeres frissítés",- "user-not-found": "Felhasználó nem található"+ "update-succeed": "Sikeres frissítés"},"reference": {"add-references": "Referenciák hozzáadása",diff --git a/web/src/locales/id.json b/web/src/locales/id.jsonindex 574dbcf7f..ed427df79 100644--- a/web/src/locales/id.json+++ b/web/src/locales/id.json@@ -257,8 +257,7 @@"restored-successfully": "Berhasil dipulihkan","succeed-copy-content": "Konten berhasil disalin.","succeed-copy-link": "Tautan berhasil disalin.",- "update-succeed": "Pembaruan berhasil",- "user-not-found": "Pengguna tidak ditemukan"+ "update-succeed": "Pembaruan berhasil"},"reference": {"add-references": "Tambah referensi",diff --git a/web/src/locales/it.json b/web/src/locales/it.jsonindex fec51af4c..2d08cf8fb 100644--- a/web/src/locales/it.json+++ b/web/src/locales/it.json@@ -291,8 +291,7 @@"restored-successfully": "Ripristinato con successo","succeed-copy-content": "Contenuto copiato con successo.","succeed-copy-link": "Link copiato.",- "update-succeed": "Aggiornato con successo",- "user-not-found": "Utente non trovato"+ "update-succeed": "Aggiornato con successo"},"reference": {"add-references": "Aggiungi riferimenti",diff --git a/web/src/locales/ja.json b/web/src/locales/ja.jsonindex 60dfacb00..7af683169 100644--- a/web/src/locales/ja.json+++ b/web/src/locales/ja.json@@ -365,8 +365,7 @@"restored-successfully": "復元しました","succeed-copy-content": "コンテンツのコピーに成功しました。","succeed-copy-link": "リンクのコピーに成功しました。",- "update-succeed": "変更は保存されました",- "user-not-found": "ユーザーが見つかりませんでした"+ "update-succeed": "変更は保存されました"},"reference": {"add-references": "参照を追加",diff --git a/web/src/locales/ka-GE.json b/web/src/locales/ka-GE.jsonindex 530c8b88e..5bfb0b003 100644--- a/web/src/locales/ka-GE.json+++ b/web/src/locales/ka-GE.json@@ -291,8 +291,7 @@"restored-successfully": "წარმატებით აღდგა","succeed-copy-content": "კონტენტი წარმატებით კოპირდა.","succeed-copy-link": "ლინკი წარმატებით კოპირდა.",- "update-succeed": "განახლება წარმატებით დასრულდა",- "user-not-found": "მომხმარებელი ვერ მოიძებნა"+ "update-succeed": "განახლება წარმატებით დასრულდა"},"reference": {"add-references": "რეფერენციის დამატება",diff --git a/web/src/locales/ko.json b/web/src/locales/ko.jsonindex d569e666d..668c8303c 100644--- a/web/src/locales/ko.json+++ b/web/src/locales/ko.json@@ -257,8 +257,7 @@"restored-successfully": "성공적으로 복구했습니다","succeed-copy-content": "콘텐츠를 클립보드에 복사했습니다.","succeed-copy-link": "링크를 클립보드에 복사했습니다.",- "update-succeed": "업데이트 성공",- "user-not-found": "회원을 찾을 수 없습니다"+ "update-succeed": "업데이트 성공"},"reference": {"add-references": "참조 추가",diff --git a/web/src/locales/lt.json b/web/src/locales/lt.jsonindex 86bf5ce6a..384241cc7 100644--- a/web/src/locales/lt.json+++ b/web/src/locales/lt.json@@ -328,8 +328,7 @@"restored-successfully": "Sėkmingai atkurta","succeed-copy-content": "Turinys sėkmingai nukopijuotas.","succeed-copy-link": "Nuoroda sėkmingai nukopijuota.",- "update-succeed": "Atnaujinimas pavyko",- "user-not-found": "Vartotojas nerastas"+ "update-succeed": "Atnaujinimas pavyko"},"reference": {"add-references": "Pridėti nuorodas",diff --git a/web/src/locales/lv.json b/web/src/locales/lv.jsonindex a68fa2cd3..2c140cf8a 100644--- a/web/src/locales/lv.json+++ b/web/src/locales/lv.json@@ -328,8 +328,7 @@"restored-successfully": "Veiksmīgi atjaunots","succeed-copy-content": "Saturs ir veiksmīgi kopēts.","succeed-copy-link": "Saite ir veiksmīgi nokopēta.",- "update-succeed": "Atjaunināšana izdevās",- "user-not-found": "Lietotājs nav atrasts"+ "update-succeed": "Atjaunināšana izdevās"},"reference": {"add-references": "Pievienojiet atsauces",diff --git a/web/src/locales/mr.json b/web/src/locales/mr.jsonindex 5a645e7f6..4fa83fefa 100644--- a/web/src/locales/mr.json+++ b/web/src/locales/mr.json@@ -257,8 +257,7 @@"restored-successfully": "यशस्वीरित्या पुनर्संचयित केले","succeed-copy-content": "सामग्री यशस्वीरित्या कॉपी केली.","succeed-copy-link": "लिंक यशस्वीरित्या कॉपी केली.",- "update-succeed": "अपडेट यशस्वी झाले",- "user-not-found": "वापरकर्ता सापडला नाही"+ "update-succeed": "अपडेट यशस्वी झाले"},"reference": {"add-references": "संदर्भ जोडा",diff --git a/web/src/locales/nb.json b/web/src/locales/nb.jsonindex 4b588c2a2..f04bcdfcf 100644--- a/web/src/locales/nb.json+++ b/web/src/locales/nb.json@@ -291,8 +291,7 @@"restored-successfully": "Gjenoppretting vellykket","succeed-copy-content": "Innhold kopiert vellykket.","succeed-copy-link": "Link kopiert.",- "update-succeed": "Oppdatering vellykket",- "user-not-found": "Bruker ikke funnet"+ "update-succeed": "Oppdatering vellykket"},"reference": {"add-references": "Legg til referanser",diff --git a/web/src/locales/nl.json b/web/src/locales/nl.jsonindex 1c8cb2032..a0917ce69 100644--- a/web/src/locales/nl.json+++ b/web/src/locales/nl.json@@ -291,8 +291,7 @@"restored-successfully": "Succesvol teruggezet","succeed-copy-content": "Inhoud succesvol gekopieerd.","succeed-copy-link": "Link gekopieerd naar klembord.",- "update-succeed": "Update voltooid",- "user-not-found": "Gebruiker niet gevonden"+ "update-succeed": "Update voltooid"},"reference": {"add-references": "Referenties toevoegen",diff --git a/web/src/locales/pl.json b/web/src/locales/pl.jsonindex 3df281e5e..3d95193dd 100644--- a/web/src/locales/pl.json+++ b/web/src/locales/pl.json@@ -310,8 +310,7 @@"restored-successfully": "Przywrócono pomyślnie","succeed-copy-content": "Treść została pomyślnie skopiowana.","succeed-copy-link": "Link skopiowany pomyślnie.",- "update-succeed": "Aktualizacja zakończona sukcesem",- "user-not-found": "Użytkownik nie został znaleziony"+ "update-succeed": "Aktualizacja zakończona sukcesem"},"reference": {"add-references": "Dodaj odniesienia",diff --git a/web/src/locales/pt-BR.json b/web/src/locales/pt-BR.jsonindex b79d9c449..c24cd9006 100644--- a/web/src/locales/pt-BR.json+++ b/web/src/locales/pt-BR.json@@ -257,8 +257,7 @@"restored-successfully": "Restaurado com êxito","succeed-copy-content": "Conteúdo copiado com êxito.","succeed-copy-link": "Link copiado com êxito.",- "update-succeed": "Atualizado com êxito",- "user-not-found": "Usuário não encontrado"+ "update-succeed": "Atualizado com êxito"},"reference": {"add-references": "Adicionar referências",diff --git a/web/src/locales/pt-PT.json b/web/src/locales/pt-PT.jsonindex bf3ab202a..ee9337827 100644--- a/web/src/locales/pt-PT.json+++ b/web/src/locales/pt-PT.json@@ -291,8 +291,7 @@"restored-successfully": "Restaurado com sucesso","succeed-copy-content": "Conteúdo copiado com sucesso.","succeed-copy-link": "Link copiado com sucesso.",- "update-succeed": "Atualização bem-sucedida",- "user-not-found": "Utilizador não encontrado"+ "update-succeed": "Atualização bem-sucedida"},"reference": {"add-references": "Adicionar referências",diff --git a/web/src/locales/ro.json b/web/src/locales/ro.jsonindex c11d0b60f..ae0aab88e 100644--- a/web/src/locales/ro.json+++ b/web/src/locales/ro.json@@ -328,8 +328,7 @@"restored-successfully": "Restaurat cu succes","succeed-copy-content": "Conținutul a fost copiat cu succes.","succeed-copy-link": "Linkul a fost copiat cu succes.",- "update-succeed": "Actualizarea a reușit",- "user-not-found": "Utilizatorul nu a fost găsit"+ "update-succeed": "Actualizarea a reușit"},"reference": {"add-references": "Adăugați referințe",diff --git a/web/src/locales/ru.json b/web/src/locales/ru.jsonindex f313b3fb1..e50b82c6b 100644--- a/web/src/locales/ru.json+++ b/web/src/locales/ru.json@@ -385,8 +385,7 @@"restored-successfully": "Успешно восстановлено.","succeed-copy-content": "Контент успешно скопирован.","succeed-copy-link": "Ссылка скопирована в буфер обмена.",- "update-succeed": "Успешно обновлено",- "user-not-found": "Пользователь не найден"+ "update-succeed": "Успешно обновлено"},"reference": {"add-references": "Добавить связь",diff --git a/web/src/locales/sk.json b/web/src/locales/sk.jsonindex 20e344722..3b921eb6b 100644--- a/web/src/locales/sk.json+++ b/web/src/locales/sk.json@@ -328,8 +328,7 @@"restored-successfully": "Úspešne obnovené","succeed-copy-content": "Obsah bol úspešne skopírovaný.","succeed-copy-link": "Odkaz bol úspešne skopírovaný.",- "update-succeed": "Aktualizácia bola úspešná",- "user-not-found": "Používateľ sa nenašiel"+ "update-succeed": "Aktualizácia bola úspešná"},"reference": {"add-references": "Pridajte referencie",diff --git a/web/src/locales/sl.json b/web/src/locales/sl.jsonindex 6812635ef..e1c3678f7 100644--- a/web/src/locales/sl.json+++ b/web/src/locales/sl.json@@ -291,8 +291,7 @@"restored-successfully": "Uspešno obnovljeno","succeed-copy-content": "Vsebina je uspešno skopirana.","succeed-copy-link": "Povezava je uspešno skopirana.",- "update-succeed": "Posodobitev je uspešna",- "user-not-found": "Ne najdem uporabnika"+ "update-succeed": "Posodobitev je uspešna"},"reference": {"add-references": "Dodaj referenco",diff --git a/web/src/locales/sr.json b/web/src/locales/sr.jsonindex 63aed42c9..57e27992f 100644--- a/web/src/locales/sr.json+++ b/web/src/locales/sr.json@@ -328,8 +328,7 @@"restored-successfully": "Успешно враћено","succeed-copy-content": "Садржај је успешно копиран.","succeed-copy-link": "Линк је успешно копиран.",- "update-succeed": "Ажурирање је успело",- "user-not-found": "Корисник није пронађен"+ "update-succeed": "Ажурирање је успело"},"reference": {"add-references": "Додајте референце",diff --git a/web/src/locales/sv.json b/web/src/locales/sv.jsonindex 39ba9ff1b..e40f24ef0 100644--- a/web/src/locales/sv.json+++ b/web/src/locales/sv.json@@ -291,8 +291,7 @@"restored-successfully": "Återställdes framgångsrikt","succeed-copy-content": "Innehåll kopierades framgångsrikt.","succeed-copy-link": "Länk kopierades framgångsrikt.",- "update-succeed": "Uppdatering lyckades",- "user-not-found": "Användaren hittades inte"+ "update-succeed": "Uppdatering lyckades"},"reference": {"add-references": "Lägg till referenser",diff --git a/web/src/locales/th.json b/web/src/locales/th.jsonindex 0fed3b7ba..d40e2a824 100644--- a/web/src/locales/th.json+++ b/web/src/locales/th.json@@ -257,8 +257,7 @@"restored-successfully": "กู้คืนเรียบร้อยแล้ว","succeed-copy-content": "คัดลอกเนื้อหาเรียบร้อยแล้ว","succeed-copy-link": "คัดลอกลิงก์เรียบร้อยแล้ว",- "update-succeed": "อัปเดตเรียบร้อยแล้ว",- "user-not-found": "ไม่พบผู้ใช้งาน"+ "update-succeed": "อัปเดตเรียบร้อยแล้ว"},"reference": {"add-references": "เพิ่มข้อมูลอ้างอิง",diff --git a/web/src/locales/tr.json b/web/src/locales/tr.jsonindex 729df6d10..b12dab9e1 100644--- a/web/src/locales/tr.json+++ b/web/src/locales/tr.json@@ -291,8 +291,7 @@"restored-successfully": "Başarıyla geri yüklendi","succeed-copy-content": "İçerik başarıyla kopyalandı.","succeed-copy-link": "Bağlantı başarıyla kopyalandı.",- "update-succeed": "Güncelleme başarılı",- "user-not-found": "Kullanıcı bulunamadı"+ "update-succeed": "Güncelleme başarılı"},"reference": {"add-references": "Referans ekle",diff --git a/web/src/locales/uk.json b/web/src/locales/uk.jsonindex 2c7e47eb9..e46766a52 100644--- a/web/src/locales/uk.json+++ b/web/src/locales/uk.json@@ -291,8 +291,7 @@"restored-successfully": "Успішно відновлено","succeed-copy-content": "Вміст успішно скопійовано.","succeed-copy-link": "Посилання успішно скопійовано.",- "update-succeed": "Оновлення успішне",- "user-not-found": "Користувача не знайдено"+ "update-succeed": "Оновлення успішне"},"reference": {"add-references": "Додати посилання",diff --git a/web/src/locales/vi.json b/web/src/locales/vi.jsonindex de6eb6970..bfdda122f 100644--- a/web/src/locales/vi.json+++ b/web/src/locales/vi.json@@ -257,8 +257,7 @@"restored-successfully": "Khôi phục thành công","succeed-copy-content": "Đã sao chép nội dung thành công.","succeed-copy-link": "Sao chép liên kết thành công.",- "update-succeed": "Cập nhật thành công",- "user-not-found": "Không tìm thấy người dùng"+ "update-succeed": "Cập nhật thành công"},"reference": {"add-references": "Thêm tham chiếu",diff --git a/web/src/locales/zh-Hans.json b/web/src/locales/zh-Hans.jsonindex 208628197..c61b9ef73 100644--- a/web/src/locales/zh-Hans.json+++ b/web/src/locales/zh-Hans.json@@ -386,8 +386,7 @@"restored-successfully": "恢复成功","succeed-copy-content": "复制内容到剪贴板成功。","succeed-copy-link": "复制链接到剪贴板成功。",- "update-succeed": "更新成功",- "user-not-found": "未找到该用户"+ "update-succeed": "更新成功"},"reference": {"add-references": "添加引用",diff --git a/web/src/locales/zh-Hant.json b/web/src/locales/zh-Hant.jsonindex e55e1c423..2d8b430a2 100644--- a/web/src/locales/zh-Hant.json+++ b/web/src/locales/zh-Hant.json@@ -459,8 +459,7 @@"restored-successfully": "還原成功","succeed-copy-content": "內容複製到剪貼簿成功。","succeed-copy-link": "複製連結到剪貼簿成功。",- "update-succeed": "更新成功",- "user-not-found": "未找到該使用者"+ "update-succeed": "更新成功"},"reference": {"add-references": "引用參考資料",diff --git a/web/src/pages/UserProfile.tsx b/web/src/pages/UserProfile.tsxindex ab46e2d62..a7c3a875a 100644--- a/web/src/pages/UserProfile.tsx+++ b/web/src/pages/UserProfile.tsx@@ -1,16 +1,20 @@-import copy from "copy-to-clipboard";-import { ExternalLinkIcon } from "lucide-react";-import { Suspense } from "react";-import { toast } from "react-hot-toast";-import { useParams, useSearchParams } from "react-router-dom";+import { UserRoundIcon } from "lucide-react";+import { type ReactNode, Suspense } from "react";+import { Link, useParams, useSearchParams } from "react-router-dom";import MemoView from "@/components/MemoView";import PagedMemoList, { getMemoKey } from "@/components/PagedMemoList";import UserAvatar from "@/components/UserAvatar";-import { Button } from "@/components/ui/button";import { useMemoFilters, useMemoSorting } from "@/hooks";+import useCurrentUser from "@/hooks/useCurrentUser";+import { useDelayedFlag } from "@/hooks/useDelayedFlag";import { useUser } from "@/hooks/useUserQueries";+import { LOADING_INDICATOR_DELAY_MS } from "@/lib/constants";+import { userNamePrefix } from "@/lib/resource-names";+import { cn } from "@/lib/utils";+import { ROUTES } from "@/router/routes";import { State } from "@/types/proto/api/v1/common_pb";import { Memo } from "@/types/proto/api/v1/memo_service_pb";+import type { User } from "@/types/proto/api/v1/user_service_pb";import { useTranslate } from "@/utils/i18n";import { lazyWithReload } from "@/utils/lazy";@@ -18,48 +22,73 @@ type TabView = "memos" | "map";const UserMemoMap = lazyWithReload(() => import("@/components/UserMemoMap"));-interface User {- name: string;- username: string;- displayName: string;- avatarUrl?: string;- description?: string;-}+const PROFILE_TITLE_CLASSES = "text-xl font-semibold leading-7 tracking-[-0.01em] text-foreground";+const PROFILE_AVATAR_SLOT_CLASSES = "mt-0.5 size-10 shrink-0 rounded-lg";-const ProfileHeader = ({ user, onCopyProfileLink, shareLabel }: { user: User; onCopyProfileLink: () => void; shareLabel: string }) => (- <div className="border-b border-border/10 px-4 py-8 sm:px-6">- <div className="mx-auto flex max-w-2xl gap-4 sm:gap-6">- <UserAvatar className="h-20 w-20 shrink-0 rounded-2xl shadow-sm sm:h-24 sm:w-24" avatarUrl={user.avatarUrl} />- <div className="flex flex-1 flex-col gap-3">- <div>- <h1 className="text-2xl font-bold text-foreground sm:text-3xl">{user.displayName || user.username}</h1>- {user.displayName && <p className="text-sm text-muted-foreground">@{user.username}</p>}- </div>- {user.description && <p className="text-sm text-foreground/70">{user.description}</p>}- <Button variant="outline" size="sm" onClick={onCopyProfileLink} className="w-fit gap-2">- <ExternalLinkIcon className="h-4 w-4" />- {shareLabel}- </Button>- </div>+// The identity block sits on the content rail like everything else on the page: a 40px+// avatar slot beside a text column. The loaded, loading and not-found states all share+// this shell so they occupy the same space and swap without a jump.+const IdentityRow = ({ avatar, className, children }: { avatar: ReactNode; className?: string; children: ReactNode }) => (+ <div className={cn("flex w-full items-start gap-3", className)}>+ {avatar}+ <div className="min-w-0 flex-1">{children}</div>+ </div>+);++// The list's header, so in grid mode it spans every column.+const ProfileHeader = ({ user, className }: { user: User; className?: string }) => (+ <IdentityRow className={className} avatar={<UserAvatar className={PROFILE_AVATAR_SLOT_CLASSES} avatarUrl={user.avatarUrl} />}>+ <div className="flex min-w-0 flex-wrap items-baseline gap-x-2">+ <h1 className={cn("truncate", PROFILE_TITLE_CLASSES)}>{user.displayName || user.username}</h1>+ {user.displayName && <span className="text-ui text-muted-foreground">@{user.username}</span>}</div>+ {user.description && <p className="mt-0.5 line-clamp-2 max-w-[60ch] text-ui text-muted-foreground">{user.description}</p>}+ </IdentityRow>+);++const ProfileHeaderSkeleton = () => (+ <div aria-busy="true">+ <IdentityRow avatar={<span className={cn(PROFILE_AVATAR_SLOT_CLASSES, "animate-pulse bg-muted")} />}>+ <span className="mt-1 block h-5 w-40 animate-pulse rounded bg-muted" />+ <span className="mt-2 block h-3.5 w-3/5 animate-pulse rounded bg-muted" />+ </IdentityRow></div>);+const ProfileNotFound = ({ username }: { username: string }) => {+ const t = useTranslate();+ return (+ <IdentityRow+ avatar={+ <span+ className={cn(PROFILE_AVATAR_SLOT_CLASSES, "grid place-items-center border border-dashed border-input text-muted-foreground/60")}+ >+ <UserRoundIcon className="size-5" strokeWidth={1.6} />+ </span>+ }+ >+ <h1 className={PROFILE_TITLE_CLASSES}>{t("profile.not-found-title")}</h1>+ <p className="mt-0.5 max-w-[60ch] text-ui text-muted-foreground">{t("profile.not-found-description", { username })}</p>+ <Link to={ROUTES.EXPLORE} className="mt-3 block w-fit text-ui text-primary hover:underline">+ {t("common.explore")}+ </Link>+ </IdentityRow>+ );+};+const UserProfile = () => {const t = useTranslate();- const username = useParams().username;+ const username = useParams().username ?? "";const [searchParams] = useSearchParams();+ const currentUser = useCurrentUser();const activeTab = (searchParams.get("view") === "map" ? "map" : "memos") as TabView;- const { data: user, isLoading, error } = useUser(`users/${username}`, { enabled: !!username });-- if (error && !isLoading) {- toast.error(t("message.user-not-found"));- }+ const { data: user, isLoading } = useUser(`${userNamePrefix}${username}`, { enabled: !!username });+ const showSkeleton = useDelayedFlag(isLoading, LOADING_INDICATOR_DELAY_MS);const memoFilter = useMemoFilters({creatorName: user?.name,- includeMemoViews: false,+ includeMemoViews: true,includePinned: true,});@@ -68,45 +97,38 @@ const UserProfile = () => {state: State.NORMAL,});- const handleCopyProfileLink = () => {- if (!user) return;- copy(`${window.location.origin}/u/${encodeURIComponent(user.username)}`);- toast.success(t("message.copied"));- };-- if (isLoading) return null;+ if (user && activeTab === "memos") {+ // Visitors only see what the backend lets them see, so an empty list means nothing+ // shared rather than nothing written. The owner sees everything and gets the default.+ const isOwner = currentUser?.name === user.name;+ return (+ <PagedMemoList+ renderer={(memo: Memo, { compact }) => (+ <MemoView key={getMemoKey(memo)} memo={memo} showVisibility showPinned showSpace compact={compact} />+ )}+ listSort={listSort}+ orderBy={orderBy}+ filter={memoFilter}+ emptyMessage={isOwner ? undefined : t("profile.no-shared-memos", { username: user.username })}+ renderHeader={({ useGrid }) => <ProfileHeader user={user} className={useGrid ? undefined : "mb-4"} />}+ />+ );+ }+ // Everything that is not the list shares the list's single-column reading rail.return (- <section className="flex min-h-screen w-full flex-col bg-background">- {user ? (+ <section className="mx-auto flex w-full max-w-2xl flex-col gap-4">+ {isLoading ? (+ showSkeleton && <ProfileHeaderSkeleton />+ ) : !user ? (+ <ProfileNotFound username={username} />+ ) : (<>- <ProfileHeader user={user} onCopyProfileLink={handleCopyProfileLink} shareLabel={t("common.share")} />-- <div className="mt-4 flex-1">- <div className="mx-auto w-full max-w-2xl">- {activeTab === "memos" ? (- <PagedMemoList- renderer={(memo: Memo, { compact }) => (- <MemoView key={getMemoKey(memo)} memo={memo} showVisibility showPinned showSpace compact={compact} />- )}- listSort={listSort}- orderBy={orderBy}- filter={memoFilter}- />- ) : (- <div className="">- <Suspense fallback={<div className="h-[60dvh] sm:h-[500px] rounded-xl border border-border bg-muted/30" />}>- <UserMemoMap creator={user.name} className="h-[60dvh] sm:h-[500px] rounded-xl" />- </Suspense>- </div>- )}- </div>- </div>+ <ProfileHeader user={user} />+ <Suspense fallback={<div className="h-[60dvh] rounded-xl border border-border bg-muted/30 sm:h-[500px]" />}>+ <UserMemoMap creator={user.name} className="h-[60dvh] rounded-xl sm:h-[500px]" />+ </Suspense></>- ) : (- <div className="flex flex-1 items-center justify-center">- <p className="text-muted-foreground">{t("message.user-not-found")}</p>- </div>)}</section>);diff --git a/web/src/router/index.tsx b/web/src/router/index.tsxindex aab24b40f..4fc277ce3 100644--- a/web/src/router/index.tsx+++ b/web/src/router/index.tsx@@ -84,7 +84,7 @@ export const routeConfig: RouteObject[] = [children: [{ path: Routes.ABOUT, element: <About /> }],},{ path: Routes.EXPLORE, element: <Explore /> },- { path: "u/:username", element: <UserProfile /> },+ { path: Routes.USER_PROFILE, element: <UserProfile /> },{element: <RequireAuthRoute />,children: [diff --git a/web/src/router/routes.ts b/web/src/router/routes.tsindex 9fda3a7d0..90a549568 100644--- a/web/src/router/routes.ts+++ b/web/src/router/routes.ts@@ -7,6 +7,7 @@ export const ROUTES = {VIEWS: "/views",SETTING: "/setting",EXPLORE: "/explore",+ USER_PROFILE: "/u/:username",AUTH: "/auth",AUTH_SIGNUP: "/auth/signup",AUTH_ADMIN: "/auth/admin",diff --git a/web/tests/column-grid.test.tsx b/web/tests/column-grid.test.tsxindex d0bd0e49c..16ef9c0a8 100644--- a/web/tests/column-grid.test.tsx+++ b/web/tests/column-grid.test.tsx@@ -37,6 +37,31 @@ describe("<ColumnGrid>", () => {expect(grid.children[0].querySelector('[data-testid="composer"]')).not.toBeNull();});+ it("spans the header across the packed columns and starts every column below it", () => {+ // 532px fits two 260px columns with a 12px gap; every measured height is 100px.+ const clientWidth = vi.spyOn(HTMLElement.prototype, "clientWidth", "get").mockReturnValue(532);+ const offsetHeight = vi.spyOn(HTMLElement.prototype, "offsetHeight", "get").mockReturnValue(100);++ const { getByTestId } = render(+ <ColumnGrid+ items={[item("a"), item("b")]}+ getKey={getKey}+ renderItem={(i) => <div data-testid={`card-${i.id}`}>{i.id}</div>}+ header={<div data-testid="identity" />}+ />,+ );++ const header = getByTestId("identity").parentElement as HTMLElement;+ expect(header.style.width).toBe("532px");+ expect(header.style.left).toBe("0px");+ // Header height plus one grid gap: both columns begin on the same line beneath it.+ expect(getByTestId("card-a").parentElement?.style.transform).toContain("translate3d(0px, 112px");+ expect(getByTestId("card-b").parentElement?.style.transform).toContain("translate3d(272px, 112px");++ clientWidth.mockRestore();+ offsetHeight.mockRestore();+ });+it("renders nothing for an empty list", () => {const { container } = render(<ColumnGrid items={[]} getKey={getKey} renderItem={() => <div data-testid="card" />} />);diff --git a/web/tests/memo-views.test.ts b/web/tests/memo-views.test.tsindex 17eb37f35..d27eb2975 100644--- a/web/tests/memo-views.test.ts+++ b/web/tests/memo-views.test.ts@@ -5,6 +5,8 @@ import {BUILTIN_TASKS_VIEW_ID,getMemoScopePath,getMemoViewId,+ getProfileUsername,+ isMemoCollectionRoute,isMemoScopeRoute,resolveMemoScope,} from "@/lib/memo-views";@@ -29,6 +31,18 @@ describe("memo scopes", () => {expect(getMemoScopePath("home")).toBe("/");expect(getMemoScopePath("explore")).toBe("/explore");});++ it("treats user profiles as collection routes where views and filters apply in place", () => {+ expect(isMemoCollectionRoute("/")).toBe(true);+ expect(isMemoCollectionRoute("/archived")).toBe(true);+ expect(isMemoCollectionRoute("/u/steven")).toBe(true);+ expect(isMemoCollectionRoute("/u/steven/?view=map")).toBe(true);+ expect(getProfileUsername("/u/j%C3%BAlia/")).toBe("júlia");+ expect(getProfileUsername("/u/steven/memos")).toBeUndefined();+ expect(isMemoScopeRoute("/u/steven")).toBe(false);+ expect(isMemoCollectionRoute("/memos/123")).toBe(false);+ expect(isMemoCollectionRoute("/attachments")).toBe(false);+ });});describe("memo views", () => {diff --git a/web/tests/sidebar-row-state.test.tsx b/web/tests/sidebar-row-state.test.tsxindex 536057867..d261f2655 100644--- a/web/tests/sidebar-row-state.test.tsx+++ b/web/tests/sidebar-row-state.test.tsx@@ -96,8 +96,13 @@ describe("MemoFilters", () => {expect(screen.getByText("Last week")).toBeInTheDocument();});- it("stays quiet about a view off the collection routes, where it does not apply", () => {+ it("announces a view on a user profile, where it narrows that user's memos", () => {renderChips("/u/alice", BUILTIN_TASKS_VIEW_ID);+ expect(screen.getByText("common.tasks")).toBeInTheDocument();+ });++ it("stays quiet about a view off the collection routes, where it does not apply", () => {+ renderChips("/attachments", BUILTIN_TASKS_VIEW_ID);expect(screen.queryByText("common.tasks")).not.toBeInTheDocument();});