Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 41 additions & 8 deletions player/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default function App({ bootstrap = null }) {
const [runRequest, setRunRequest] = useState(null);
const [bootstrapAutoLoadPending, setBootstrapAutoLoadPending] = useState(() => resolvedBootstrap.autoLoadPublicReplay);
const [deckTab, setDeckTab] = useState('source');
const [isGuideModalOpen, setIsGuideModalOpen] = useState(false);
const localBridgeAvailable = hasLocalRepoBridge(globalThis);
const copy = getPlayerCopy(language);
const modeDefinitions = copy.modeDefinitions;
Expand Down Expand Up @@ -475,14 +476,15 @@ export default function App({ bootstrap = null }) {
<p className="source-mode-caption">
{modeDefinitions.find((item) => item.id === sourceMode)?.description}
</p>
<details className="player-collapsible">
<summary className="player-collapsible__summary">{copy.sourceGuide.toggleLabel}</summary>
<SourceModeGuide
mode={sourceMode}
sourceState={sourceGuideState}
language={language}
/>
</details>
<div className="player-collapsible">
<button
type="button"
className="player-collapsible__summary player-collapsible__summary--button"
onClick={() => setIsGuideModalOpen(true)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Move keyboard focus into the guide modal

When a keyboard user activates this button, focus remains on the now-obscured trigger; because the dialog is mounted after the rest of the page, the next Tab traverses the underlying source form and other controls before reaching the visible close button. aria-modal="true" does not provide this behavior automatically, so opening should focus the dialog or close button, trap focus within it, handle Escape, and restore focus to the trigger when closed.

Useful? React with 👍 / 👎.

>
{copy.sourceGuide.toggleLabel}
</button>
</div>
<SourceInputPanel
mode={sourceMode}
language={language}
Expand Down Expand Up @@ -564,6 +566,37 @@ export default function App({ bootstrap = null }) {
</section>
</main>
</div>
{isGuideModalOpen && (
<div
className="player-modal-backdrop"
role="presentation"
onClick={() => setIsGuideModalOpen(false)}
>
<div
className="player-modal"
role="dialog"
aria-modal="true"
aria-labelledby="source-mode-guide-title"
onClick={(event) => event.stopPropagation()}
>
<div className="player-modal__bar">
<button
type="button"
className="player-modal__close"
aria-label={copy.common.close}
onClick={() => setIsGuideModalOpen(false)}
>
✕
</button>
</div>
<SourceModeGuide
mode={sourceMode}
sourceState={sourceGuideState}
language={language}
/>
</div>
</div>
)}
</div>
);
}
Expand Down
7 changes: 5 additions & 2 deletions player/src/App.ui.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -439,15 +439,18 @@ describeIfApp('Player Shell UI', () => {
});
});

test('source guide stays collapsed by default and expands on demand', async () => {
test('source guide is not rendered until opened, then shows in a modal', async () => {
const { user } = renderPlayerApp(App);

expect(screen.getByRole('heading', { name: 'Choose the right input path' })).not.toBeVisible();
expect(screen.queryByRole('heading', { name: 'Choose the right input path' })).not.toBeInTheDocument();
// 히어로 다이어트: 부제·메타 칩이 사라졌다
expect(screen.queryByText('Read-only replay')).not.toBeInTheDocument();

await user.click(screen.getByText('Source guide'));
expect(screen.getByRole('heading', { name: 'Choose the right input path' })).toBeVisible();

await user.click(screen.getByRole('button', { name: 'Close' }));
expect(screen.queryByRole('heading', { name: 'Choose the right input path' })).not.toBeInTheDocument();
});

test('네이티브 셸에서만 전환 버튼이 보인다', () => {
Expand Down
2 changes: 2 additions & 0 deletions player/src/lib/playerI18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const PLAYER_COPY = {
notLoaded: 'Not loaded',
activeMode: 'Active mode',
selectRepository: 'Select repository',
close: 'Close',
},
app: {
errors: {
Expand Down Expand Up @@ -412,6 +413,7 @@ const PLAYER_COPY = {
notLoaded: '불러오지 않음',
activeMode: '현재 모드',
selectRepository: '저장소 선택',
close: '닫기',
},
app: {
errors: {
Expand Down
57 changes: 57 additions & 0 deletions player/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ textarea {
.player-column {
display: grid;
gap: 20px;
align-items: start;
align-content: start;
}

.player-card {
Expand Down Expand Up @@ -1411,3 +1413,58 @@ textarea {
.player-collapsible--inline {
background: rgba(8, 12, 24, 0.4);
}

.player-collapsible__summary--button {
display: block;
width: 100%;
border: 0;
background: none;
text-align: left;
font: inherit;
}

.player-modal-backdrop {
position: fixed;
inset: 0;
z-index: 40;
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
background: rgba(2, 6, 23, 0.72);
backdrop-filter: blur(4px);
}

.player-modal {
position: relative;
width: 100%;
max-width: 920px;
max-height: calc(100vh - 48px);
overflow-y: auto;
border-radius: 22px;
}

.player-modal__bar {
position: sticky;
top: 0;
z-index: 1;
display: flex;
justify-content: flex-end;
padding-bottom: 12px;
}

.player-modal__close {
width: 36px;
height: 36px;
border: 1px solid var(--player-panel-border);
border-radius: 999px;
background: var(--player-bg-elevated);
color: var(--player-text);
font-size: 16px;
line-height: 1;
cursor: pointer;
}

.player-modal__close:hover {
border-color: var(--player-panel-border-strong);
}
14 changes: 7 additions & 7 deletions src/components/maestro/FooterHelp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ export default function FooterHelp({ lanes = [] }) {
Tip: 노트를 <strong className="text-gray-300">탭</strong>하면 Diff, 하단 레인 버튼으로 승인/반려.
</span>
</div>
<div className="hidden md:flex space-x-4">
<span className="flex items-center"><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mx-1">1</kbd><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mr-1">2</kbd><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700">3</kbd> 프로젝트 전환</span>
<span className="flex items-center"><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mx-1 text-gray-300">{laneKeys || 'Click'}</kbd> 승인</span>
<span className="flex items-center"><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mx-1 text-gray-300">Shift + {laneKeys || 'Click'}</kbd> 반려(피드백)</span>
<span className="flex items-center"><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mr-1 text-gray-300">Ctrl+Z</kbd> 취소</span>
<span className="flex items-center"><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mr-1 text-gray-300">H</kbd> 히스토리 패널</span>
<span className="flex items-center"><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mx-1 text-gray-300">Tap</kbd> 하단 레인 버튼으로 승인/반려</span>
<div className="hidden md:flex flex-wrap justify-end gap-x-4 gap-y-1">
<span className="flex items-center whitespace-nowrap"><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mx-1">1</kbd><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mr-1">2</kbd><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700">3</kbd> 프로젝트 전환</span>
<span className="flex items-center whitespace-nowrap"><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mx-1 text-gray-300">{laneKeys || 'Click'}</kbd> 승인</span>
<span className="flex items-center whitespace-nowrap"><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mx-1 text-gray-300">Shift + {laneKeys || 'Click'}</kbd> 반려(피드백)</span>
<span className="flex items-center whitespace-nowrap"><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mr-1 text-gray-300">Ctrl+Z</kbd> 취소</span>
<span className="flex items-center whitespace-nowrap"><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mr-1 text-gray-300">H</kbd> 히스토리 패널</span>
<span className="flex items-center whitespace-nowrap"><kbd className="bg-gray-800 px-1.5 py-0.5 rounded border border-gray-700 mx-1 text-gray-300">Tap</kbd> 하단 레인 버튼으로 승인/반려</span>
</div>
</footer>
);
Expand Down
Loading