Fix settings navigation routing

Replace hash links in the settings side navigation with button-driven in-page scrolling so the hash router does not leave the settings page.
This commit is contained in:
Eyejoker
2026-05-02 03:11:15 +09:00
committed by GitHub
parent 1a2f879d11
commit 921d738bb0
3 changed files with 34 additions and 27 deletions

View File

@@ -32,31 +32,15 @@ interface AccountData {
}
const SETTINGS_NAV_ITEMS = [
{ targetId: 'settings-general', title: '일반', detail: '표시 · 언어' },
{
href: '#settings-general',
title: '일반',
detail: '표시 · 언어',
},
{
href: '#settings-models',
targetId: 'settings-models',
title: '모델',
detail: 'owner · reviewer · arbiter',
},
{
href: '#settings-moa',
title: 'MoA',
detail: '참조 모델 · 연결 테스트',
},
{
href: '#settings-codex',
title: 'Codex',
detail: 'fast mode · /goal',
},
{
href: '#settings-accounts',
title: '계정',
detail: 'Claude · Codex',
},
{ targetId: 'settings-moa', title: 'MoA', detail: '참조 모델 · 연결 테스트' },
{ targetId: 'settings-codex', title: 'Codex', detail: 'fast mode · /goal' },
{ targetId: 'settings-accounts', title: '계정', detail: 'Claude · Codex' },
] as const;
export interface SettingsPanelProps {
@@ -171,13 +155,25 @@ function SettingsHero() {
}
function SettingsNav() {
const scrollToSection = (targetId: string) => {
document
.getElementById(targetId)
?.scrollIntoView({ behavior: 'smooth', block: 'start' });
};
return (
<aside className="settings-nav" aria-label="설정 섹션">
{SETTINGS_NAV_ITEMS.map((item) => (
<a href={item.href} key={item.href}>
<button
aria-controls={item.targetId}
data-settings-target={item.targetId}
key={item.targetId}
onClick={() => scrollToSection(item.targetId)}
type="button"
>
<strong>{item.title}</strong>
<small>{item.detail}</small>
</a>
</button>
))}
</aside>
);