Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Commit 3ec5062

Browse files
takaokoujiGemini
andcommitted
feat: implement URL parameter override, KoshienTestModal migration, and accessibility enhancements
- Allow ?showAllExtensions=true/false to override localStorage settings - Migrate KoshienTestModal to use headerActions pattern - Add aria-label to 'Show all extensions' checkbox for screen readers Co-Authored-By: Gemini <noreply@google.com>
1 parent 6ded493 commit 3ec5062

3 files changed

Lines changed: 60 additions & 5 deletions

File tree

src/components/koshien-test-modal/koshien-test-modal.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,16 @@
2121
flex: 1;
2222
min-height: 0;
2323
}
24+
25+
.reload-button {
26+
font-weight: normal;
27+
font-size: 0.75rem;
28+
}
29+
30+
.stop-icon {
31+
position: relative;
32+
margin: 0.25rem;
33+
user-select: none;
34+
transform-origin: 50%;
35+
transform: rotate(45deg);
36+
}

src/components/koshien-test-modal/koshien-test-modal.jsx

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import PropTypes from 'prop-types';
22
import React from 'react';
3-
import {defineMessages, injectIntl, intlShape} from 'react-intl';
3+
import {defineMessages, injectIntl, intlShape, FormattedMessage} from 'react-intl';
44

55
import Box from '../box/box.jsx';
6+
import Button from '../button/button.jsx';
67
import Modal from '../../containers/modal.jsx';
78

9+
import reloadIcon from '../../lib/assets/icon--reload.svg';
10+
import stopIcon from '../close-button/icon--close.svg';
11+
812
import styles from './koshien-test-modal.css';
913

1014
const messages = defineMessages({
@@ -33,16 +37,42 @@ const KoshienTestModal = props => {
3337
setLoading(false);
3438
}, []);
3539

40+
const headerActions = loading ? (
41+
<Button
42+
className={styles.reloadButton}
43+
iconClassName={styles.stopIcon}
44+
iconSrc={stopIcon}
45+
onClick={handleStop}
46+
>
47+
<FormattedMessage
48+
defaultMessage="Stop"
49+
description="Stop button in modal"
50+
id="gui.modal.stop"
51+
/>
52+
</Button>
53+
) : (
54+
<Button
55+
className={styles.reloadButton}
56+
iconSrc={reloadIcon}
57+
onClick={handleReload}
58+
>
59+
<FormattedMessage
60+
defaultMessage="Reload"
61+
description="Reload button in modal"
62+
id="gui.modal.reload"
63+
/>
64+
</Button>
65+
);
66+
3667
return (
3768
<Modal
3869
className={styles.modalContent}
3970
contentLabel={intl.formatMessage(messages.title)}
4071
fullScreen
72+
headerActions={headerActions}
4173
headerClassName={styles.header}
4274
id="koshienTestModal"
4375
loading={loading}
44-
onReload={handleReload}
45-
onStop={handleStop}
4676
onRequestClose={onRequestClose}
4777
>
4878
<Box

src/containers/extension-library.jsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,17 @@ class ExtensionLibrary extends React.PureComponent {
7171
const extensionsParam = query.get('extensions') || '';
7272
const showMeshV2 = extensionsParam.split(',').includes('meshV2');
7373

74+
const showAllExtensionsParam = query.get('showAllExtensions');
75+
const showAllExtensions = showAllExtensionsParam === 'true' ? true :
76+
showAllExtensionsParam === 'false' ? false :
77+
this.props.showAllExtensions;
78+
7479
const extensionLibraryThumbnailData = extensionLibraryContent
7580
.filter(extension => {
7681
if (extension.extensionId === 'meshV2' && !showMeshV2) {
7782
return false;
7883
}
79-
if (!this.props.showAllExtensions && extension.defaultHidden) {
84+
if (!showAllExtensions && extension.defaultHidden) {
8085
return false;
8186
}
8287
return true;
@@ -86,10 +91,17 @@ class ExtensionLibrary extends React.PureComponent {
8691
...extension
8792
}));
8893

94+
const checkboxLabel = this.props.intl.formatMessage({
95+
defaultMessage: 'Show all extensions',
96+
description: 'Checkbox label to show all extensions including hidden ones',
97+
id: 'gui.extensionLibrary.showAllExtensions'
98+
});
99+
89100
const headerActions = (
90101
<label className={styles.showAllExtensionsLabel}>
91102
<input
92-
checked={this.props.showAllExtensions}
103+
aria-label={checkboxLabel}
104+
checked={showAllExtensions}
93105
className={styles.showAllExtensionsCheckbox}
94106
type="checkbox"
95107
onChange={this.handleToggleShowAllExtensions}

0 commit comments

Comments
 (0)