Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: hide the preset parameter visibility switch when it has no effect#18574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
SasSwart wants to merge4 commits intomain
base:main
Choose a base branch
Loading
fromjjs/hide-presets-toggle
Open
Show file tree
Hide file tree
Changes fromall 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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -277,6 +277,8 @@ export const PresetsWithDefault: Story = {
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
// Wait for the switch to be available since preset parameters are populated asynchronously
await canvas.findByLabelText("Show preset parameters");
// Toggle off the show preset parameters switch
await userEvent.click(canvas.getByLabelText("Show preset parameters"));
},
Expand Down
39 changes: 21 additions & 18 deletionssite/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -387,25 +387,28 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
selectedOption={presetOptions[selectedPresetIndex]}
/>
</Stack>
<div
css={{
display:"flex",
alignItems:"center",
gap:"8px",
}}
>
<Switch
id="show-preset-parameters"
checked={showPresetParameters}
onCheckedChange={setShowPresetParameters}
/>
<label
htmlFor="show-preset-parameters"
css={styles.description}
{/* Only show the preset parameter visibility toggle if preset parameters are actually being modified, otherwise it is ineffectual */}
Copy link
Contributor

Choose a reason for hiding this comment

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

Small nit 🔎

Suggested change
{/* Only show the preset parameter visibility toggle if preset parameters are actually being modified, otherwise itis ineffectual */}
{/* Only show the preset parameter visibility toggle if preset parameters are actually being modified, otherwise ithas no effect. */}

{presetParameterNames.length>0&&(
<div
css={{
display:"flex",
alignItems:"center",
gap:"8px",
}}
>
Show preset parameters
</label>
</div>
<Switch
id="show-preset-parameters"
checked={showPresetParameters}
onCheckedChange={setShowPresetParameters}
/>
<label
htmlFor="show-preset-parameters"
css={styles.description}
>
Show preset parameters
</label>
</div>
)}
</Stack>
</Stack>
)}
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -562,7 +562,6 @@ export const CreateWorkspacePageViewExperimental: FC<
<div className="flex flex-col gap-2">
<div className="flex gap-2 items-center">
<Label className="text-sm">Preset</Label>
<FeatureStageBadge contentType={"beta"} size="sm" />
</div>
<div className="flex flex-col gap-4">
<div className="max-w-lg">
Expand DownExpand Up@@ -594,16 +593,19 @@ export const CreateWorkspacePageViewExperimental: FC<
</SelectContent>
</Select>
</div>
<span className="flex items-center gap-3">
<Switch
id="show-preset-parameters"
checked={showPresetParameters}
onCheckedChange={setShowPresetParameters}
/>
<Label htmlFor="show-preset-parameters">
Show preset parameters
</Label>
</span>
{/* Only show the preset parameter visibility toggle if preset parameters are actually being modified, otherwise it is ineffectual */}
{presetParameterNames.length > 0 && (
<span className="flex items-center gap-3">
<Switch
id="show-preset-parameters"
checked={showPresetParameters}
onCheckedChange={setShowPresetParameters}
/>
<Label htmlFor="show-preset-parameters">
Show preset parameters
</Label>
</span>
)}
</div>
</div>
)}
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp