Skip to content

Commit 55e8d72

Browse files
committed
fix dialog overflow
1 parent e08b880 commit 55e8d72

8 files changed

Lines changed: 28 additions & 2 deletions

File tree

apps/web/src/app/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,7 @@ export function App() {
769769

770770
if (getNodeAtPath(document, targetPath).children.length > 0) {
771771
Modal.confirm({
772+
centered: true,
772773
title: t('deleteBranchConfirmTitle'),
773774
content: t('deleteBranchConfirmContent'),
774775
okText: t('ok'),
@@ -784,6 +785,7 @@ export function App() {
784785

785786
function handlePruneBranch(targetPath = path): void {
786787
Modal.confirm({
788+
centered: true,
787789
title: t('pruneBranchConfirmTitle'),
788790
content: t('pruneBranchConfirmContent'),
789791
okText: t('pruneBranch'),

apps/web/src/features/app-shell/AppStatusModals.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export function AppStatusModals({
1919
return (
2020
<>
2121
<Modal
22+
centered
2223
open={googleDrivePending != null}
2324
title={t('googleDrive')}
2425
footer={
@@ -33,6 +34,7 @@ export function AppStatusModals({
3334
{googleDrivePending === 'open' ? t('googleDriveOpenWaiting') : t('googleDriveSaveWaiting')}
3435
</Modal>
3536
<Modal
37+
centered
3638
open={kataGoAutotuningOpen}
3739
title={t('katagoAutotuning')}
3840
footer={

apps/web/src/features/files/promptSaveFileName.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export function promptSaveFileName({
1818

1919
return new Promise((resolve) => {
2020
Modal.confirm({
21+
centered: true,
2122
title,
2223
icon: null,
2324
content: (

apps/web/src/features/game-info/GameInfoModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export function GameInfoModal({open, values, onCancel, onSave}: GameInfoModalPro
3838

3939
return (
4040
<Modal
41+
centered
4142
title={t('gameInformation')}
4243
open={open}
4344
onCancel={onCancel}

apps/web/src/features/katago/KataGoSettingsModal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export function KataGoSettingsModal({open, onCancel, onCurrentAssetUninstalled}:
107107
message.success(t('katagoSettingsSaved'));
108108
if (!inventory.katago.some((asset) => asset.installed) || !inventory.models.some((asset) => asset.installed)) {
109109
Modal.warning({
110+
centered: true,
110111
title: t('aiAnalysisUnavailableTitle'),
111112
content: t('aiAnalysisUnavailableContent'),
112113
onOk: onCancel,
@@ -223,6 +224,7 @@ export function KataGoSettingsModal({open, onCancel, onCurrentAssetUninstalled}:
223224

224225
return (
225226
<Modal
227+
centered
226228
title={t('aiConfig')}
227229
open={open}
228230
onCancel={onCancel}

apps/web/src/features/settings/SettingsModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function SettingsModal({
8888
}
8989

9090
return (
91-
<Modal title={t('settings')} open={open} onCancel={onCancel} footer={null} width={420} destroyOnHidden>
91+
<Modal centered title={t('settings')} open={open} onCancel={onCancel} footer={null} width={420} destroyOnHidden>
9292
<Button block onClick={onKeyboardShortcutsClick}>
9393
{t('keyboardShortcuts')}
9494
</Button>

apps/web/src/features/shortcuts/KeyboardShortcutsModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export function KeyboardShortcutsModal({
7373

7474
return (
7575
<Modal
76+
centered
7677
title={t('keyboardShortcuts')}
7778
open={open}
7879
onCancel={onCancel}

apps/web/src/styles/global.css

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,24 @@ textarea,
123123
width: 100px;
124124
}
125125

126+
.ant-modal {
127+
padding-bottom: 0;
128+
}
129+
130+
.ant-modal .ant-modal-content {
131+
display: flex;
132+
flex-direction: column;
133+
max-height: calc(100dvh - 24px);
134+
overflow: hidden;
135+
}
136+
137+
.ant-modal .ant-modal-body {
138+
flex: 1;
139+
max-height: calc(100dvh - 112px);
140+
min-height: 0;
141+
overflow-y: auto;
142+
}
143+
126144
.keyboard-shortcuts-list {
127145
display: grid;
128146
gap: 6px;
@@ -1086,4 +1104,3 @@ button.ant-btn.left-panel-toggle {
10861104
min-width: max-content !important;
10871105
}
10881106
}
1089-

0 commit comments

Comments
 (0)