Files
viberoom-web/src/widgets/app-utility-rail/ui/AppUtilityRailWidget.tsx
corpi a2bebb3485 feat(app-hub): 허브 도구 레일과 입장 동선을 정리
맥락:\n- 상단 헤더 요소가 많아 허브의 핵심 흐름(공간 선택 → 목표 입력 → 입장)이 분산되었습니다.\n- 메모/통계/설정 진입을 상단이 아닌 보조 동선으로 옮겨 감성 톤을 유지할 필요가 있었습니다.\n\n변경사항:\n- 우측 아이콘 레일과 우측 드로어를 추가해 Inbox/Stats/Settings를 동일 패턴으로 제공했습니다.\n- TopBar에서 메모 버튼을 제거하고, 멤버십/PRO 동선은 ProfileMenu 드롭다운으로 정리했습니다.\n- Selected Space 박스를 슬림화하고 설명을 1줄로 제한해 시선 분산을 줄였습니다.\n- 추천 공간 카드에 텍스트 가독성 오버레이와 선택 표시(은은한 테두리/체크)를 적용했습니다.\n- Quick Entry에서 커스텀 CTA 무게를 낮추고 전체 톤을 가볍게 조정했습니다.\n- docs/work.template.md를 추가하고 docs/work.md의 현재 작업 지시를 갱신했습니다.\n\n검증:\n- npm run build\n- npx tsc --noEmit\n\n세션-상태: /app 허브가 상단 과밀 없이 레일+드로어 보조 동선으로 정리되었습니다.\n세션-다음: 드로어 패널의 실제 데이터 연결 시 도메인 상태와 연동을 진행합니다.\n세션-리스크: 드로어 포커스 트랩/키보드 동선은 추가 접근성 점검이 필요합니다.
2026-03-02 12:17:35 +09:00

122 lines
4.0 KiB
TypeScript

'use client';
import type { RecentThought } from '@/entities/session';
import type { AppHubVisualMode } from '@/shared/config/appHubVisualMode';
import { cn } from '@/shared/lib/cn';
import { AppUtilityDrawer } from './AppUtilityDrawer';
import { type AppUtilityPanelId } from '../model/types';
import { InboxDrawerPanel } from './panels/InboxDrawerPanel';
import { SettingsDrawerPanel } from './panels/SettingsDrawerPanel';
import { StatsDrawerPanel } from './panels/StatsDrawerPanel';
interface AppUtilityRailWidgetProps {
visualMode: AppHubVisualMode;
activePanel: AppUtilityPanelId | null;
thoughts: RecentThought[];
thoughtCount: number;
onOpenPanel: (panel: AppUtilityPanelId) => void;
onClosePanel: () => void;
onClearInbox: () => void;
}
const RAIL_ITEMS: Array<{
id: AppUtilityPanelId;
icon: string;
label: string;
}> = [
{ id: 'inbox', icon: '📨', label: 'Inbox' },
{ id: 'stats', icon: '📊', label: 'Stats' },
{ id: 'settings', icon: '⚙', label: 'Settings' },
];
const PANEL_TITLE_MAP: Record<AppUtilityPanelId, string> = {
inbox: '임시 보관함',
stats: '집중 요약',
settings: '설정',
};
export const AppUtilityRailWidget = ({
visualMode,
activePanel,
thoughts,
thoughtCount,
onOpenPanel,
onClosePanel,
onClearInbox,
}: AppUtilityRailWidgetProps) => {
const cinematic = visualMode === 'cinematic';
return (
<>
<div className="fixed right-3 top-1/2 z-30 -translate-y-1/2">
<div
className={cn(
'flex w-12 flex-col items-center gap-2 rounded-2xl border py-2 backdrop-blur-xl',
cinematic
? 'border-white/18 bg-slate-950/34 shadow-[0_18px_32px_rgba(2,6,23,0.42)]'
: 'border-brand-dark/12 bg-white/54 shadow-[0_18px_32px_rgba(15,23,42,0.14)]',
)}
>
{RAIL_ITEMS.map((item) => {
const selected = activePanel === item.id;
return (
<button
key={item.id}
type="button"
title={item.label}
aria-label={item.label}
onClick={() => onOpenPanel(item.id)}
className={cn(
'relative inline-flex h-9 w-9 items-center justify-center rounded-xl border text-base transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-300/75',
selected
? cinematic
? 'border-sky-200/64 bg-sky-200/22'
: 'border-brand-primary/44 bg-brand-primary/14'
: cinematic
? 'border-white/18 bg-white/8 hover:bg-white/14'
: 'border-brand-dark/14 bg-white/72 hover:bg-white',
)}
>
<span aria-hidden>{item.icon}</span>
{item.id === 'inbox' && thoughtCount > 0 ? (
<span
className={cn(
'absolute -right-1 -top-1 inline-flex min-w-[1rem] items-center justify-center rounded-full px-1 py-0.5 text-[9px] font-semibold',
cinematic
? 'bg-sky-200/28 text-sky-50'
: 'bg-brand-primary/18 text-brand-primary',
)}
>
{thoughtCount > 99 ? '99+' : `${thoughtCount}`}
</span>
) : null}
</button>
);
})}
</div>
</div>
<AppUtilityDrawer
open={activePanel !== null}
title={activePanel ? PANEL_TITLE_MAP[activePanel] : ''}
visualMode={visualMode}
onClose={onClosePanel}
>
{activePanel === 'inbox' ? (
<InboxDrawerPanel
visualMode={visualMode}
thoughts={thoughts}
onClear={onClearInbox}
/>
) : null}
{activePanel === 'stats' ? <StatsDrawerPanel visualMode={visualMode} /> : null}
{activePanel === 'settings' ? (
<SettingsDrawerPanel visualMode={visualMode} />
) : null}
</AppUtilityDrawer>
</>
);
};