diff --git a/apps/catalog/src/CatalogApp.tsx b/apps/catalog/src/CatalogApp.tsx index 2452a7f..8514490 100644 --- a/apps/catalog/src/CatalogApp.tsx +++ b/apps/catalog/src/CatalogApp.tsx @@ -35,7 +35,6 @@ import { ResizableViewport, SceneAnnotation, HeaderNavigation, - HeaderProfile, HeaderWorkspace, Icon, IconButton, @@ -2163,7 +2162,6 @@ export function CatalogApp() { } right={ () => urls.current.forEach(url => URL.revokeObjectURL(url)), []); return <>
- setOpen(true) }]} /> diff --git a/docs/ADOPTION.md b/docs/ADOPTION.md index 7522ea4..0611c13 100644 --- a/docs/ADOPTION.md +++ b/docs/ADOPTION.md @@ -113,5 +113,14 @@ UI preferences belong to browser-local storage; site content and deployment credentials stay in the existing CMS model. Immutable npm snapshots retain package semver and are identified by source commit plus archive SHA-256. -CMS uses `UserProfileMenu variant="header"`: profile label, menu icon, avatar. +CMS uses `UserProfileMenu`: profile label, menu icon, avatar. The menu opens settings; the application does not add a fourth action. + + +Device Core and CMS share the complete `UserProfileMenu` header, not local copies. +The reference composition is the existing rounded profile group in Launcher/Hub +and Engine (`EnginePlatformHeader.tsx` / `TopBar.tsx`); its reusable geometry is +already in AppHeader, HeaderProfileButton, IconButton and HeaderAvatar. The owner +confirmed the order profile → inbox → avatar and settings inside the middle +icon's menu on 2026-11-05. No application CSS overrides are needed. +Device Core retains session identity, profile URL, permissions and logout actions. diff --git a/docs/COMPONENTS.md b/docs/COMPONENTS.md index 02d6173..049768c 100644 --- a/docs/COMPONENTS.md +++ b/docs/COMPONENTS.md @@ -228,7 +228,13 @@ Pill navigation для верхней панели и компактного п ## UserProfileMenu -Каноническая выпадашка профиля для правой группы `AppHeader`. Она использует +Каноническая правая группа `AppHeader`: «Профиль» → inbox → аватар. +`UserProfileMenu` владеет всей группой, включая `HeaderProfile`; приложение +передаёт только identity и действия. Настройки находятся в меню, отдельной +шестерёнки после аватара нет. Нельзя добавлять внешнюю обёртку или локальные +отступы. Все три элемента открывают меню; Escape возвращает фокус на вызвавшую кнопку. + +Она использует общий portal `Dropdown`, показывает identity cover с аватаром, именем и подписью и принимает список application-owned действий. @@ -527,6 +533,6 @@ Window: `rect` / `onRectCommit` — восстановление и фиксац ## Flat surface profile and profile trigger -The shared theme supports `edges: "flat"` for borderless surfaces, including portal windows. Keyboard focus changes the fill and foreground instead of adding an outline. The living catalog exposes this alongside the Mission appearance switch. `UserProfileMenu variant="header"` composes the canonical profile label, independent inbox/menu button and avatar. CMS puts settings inside that menu. No additional settings button or HeaderProfile wrapper is needed; spacing comes from existing HeaderProfileButton and IconButton geometry. +The shared theme supports `edges: "flat"` for borderless surfaces, including portal windows. Keyboard focus changes the fill and foreground instead of adding an outline. The living catalog exposes this alongside the Mission appearance switch. `UserProfileMenu` composes the canonical profile label, independent inbox/menu button and avatar. CMS puts settings inside that menu. No additional settings button or HeaderProfile wrapper is needed; spacing comes from existing HeaderProfileButton and IconButton geometry. `Select variant="split" shape="pill"` aligns a compact workspace/site selector with adjacent round actions, preserving the shared dimensions and keyboard behavior. diff --git a/packages/ui-react/src/AppHeader.tsx b/packages/ui-react/src/AppHeader.tsx index 5071f6b..8d15bc1 100644 --- a/packages/ui-react/src/AppHeader.tsx +++ b/packages/ui-react/src/AppHeader.tsx @@ -1,4 +1,4 @@ -import type { ButtonHTMLAttributes, ReactNode } from "react"; +import type { ButtonHTMLAttributes, ReactNode, Ref } from "react"; export interface AppHeaderProps { brand: ReactNode; @@ -74,10 +74,11 @@ export function HeaderNavigation({ label, value, items, onChan export interface HeaderProfileProps { children: ReactNode; + ref?: Ref; } -export function HeaderProfile({ children }: HeaderProfileProps) { - return
{children}
; +export function HeaderProfile({ children, ref }: HeaderProfileProps) { + return
{children}
; } export interface HeaderProfileButtonProps extends Omit, "className" | "style"> {} diff --git a/packages/ui-react/src/UserProfileMenu.tsx b/packages/ui-react/src/UserProfileMenu.tsx index 3361441..5bcc4e0 100644 --- a/packages/ui-react/src/UserProfileMenu.tsx +++ b/packages/ui-react/src/UserProfileMenu.tsx @@ -16,7 +16,7 @@ export interface UserProfileMenuAction { export interface UserProfileMenuProps { displayName: string; - /** Canonical profile label, independent menu icon, then avatar. Owns HeaderProfile. */ + /** Header is canonical. "default" retains the legacy compact trigger outside headers. */ variant?: "default" | "header"; subtitle?: string; avatarUrl?: string; @@ -29,7 +29,7 @@ export interface UserProfileMenuProps { export function UserProfileMenu({ displayName, - variant = "default", + variant = "header", subtitle, avatarUrl, coverImageUrl, @@ -45,19 +45,22 @@ export function UserProfileMenu({ offset={10} surfaceClassName="nodedc-user-profile-menu" trigger={({ open, toggle, setTriggerRef, setAnchorRef, surfaceId }) => variant === "header" ? ( - - + + { setTriggerRef(event.currentTarget); toggle(); }}> {triggerLabel ?? "Профиль"} { setTriggerRef(node); setAnchorRef(node); }} + ref={setTriggerRef} label={`Меню пользователя ${label}`} aria-haspopup="menu" aria-expanded={open} aria-controls={surfaceId} - onClick={toggle} + onClick={(event) => { setTriggerRef(event.currentTarget); toggle(); }} > - + ) : (