feat(symbol-page): aria-pressed PeriodTabs + sticky orderbook in 1D mode

PeriodTabs (reviewer 488fb32 concern):
- Drop role=tablist/tab/aria-selected. These imply a full ARIA tab
  pattern (tabpanel, aria-controls, roving tabIndex, internal Arrow
  focus traversal) which we don't implement — page-level left/right keys
  drive period change instead. Switch to plain button group with
  aria-pressed={active}, which accurately describes a segmented
  toggle. Comment updated to match.

OrderbookPanel sticky (new slice):
- Add optional sticky prop. When true, panel uses 'sticky top-4' with
  a slightly heavier bg-zinc-900/80 + backdrop-blur so it stays
  legible over the panels scrolling behind it.
- page.tsx passes sticky={isIntraday} — only 1D (10m bars) mode
  benefits, since orderbook timeliness drops on daily+ charts and the
  fixed slot would harm sidebar layout stability there.
This commit is contained in:
claude-owner
2026-05-30 20:13:44 +09:00
parent 488fb32acb
commit 31e7a67a0d
3 changed files with 19 additions and 7 deletions

View File

@@ -16,11 +16,16 @@ import { api, type OrderbookLevel, type OrderbookResponse } from "../lib/api";
type Props = {
code: string;
// 1D(10분봉) 모드일 때만 sticky 로 띄움 — 종목 페이지가 길어 스크롤해도 매수/매도 호가가
// 시야에 남도록. 일봉 이상에선 호가의 실시간 가치가 낮아 일반 흐름으로 두는 게 사이드바
// 다른 패널(PriceTargets/AlertsPanel/InvestmentNote/RelatedStocks) 의 위치 안정성을 해치지
// 않음.
sticky?: boolean;
};
const POLL_MS = 10_000;
export function OrderbookPanel({ code }: Props) {
export function OrderbookPanel({ code, sticky = false }: Props) {
const [data, setData] = useState<OrderbookResponse | null>(null);
const [err, setErr] = useState<string | null>(null);
const [loading, setLoading] = useState(true);
@@ -51,7 +56,13 @@ export function OrderbookPanel({ code }: Props) {
}, [code]);
return (
<div className="rounded-md border border-zinc-800 bg-zinc-900/40 p-3">
<div
className={
sticky
? "sticky top-4 rounded-md border border-zinc-800 bg-zinc-900/80 p-3 backdrop-blur"
: "rounded-md border border-zinc-800 bg-zinc-900/40 p-3"
}
>
<div className="mb-2 flex items-center justify-between gap-2">
<span className="text-xs font-medium text-zinc-300"></span>
<span className="text-[10px] text-zinc-500">