From 660fa9478f5fc6ec8891693d902e807d203077a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kayla=20=E3=81=AF=E3=81=AA?= Date: Wed, 13 May 2026 10:56:50 -0600 Subject: [PATCH] style(site): use shorthand for boolean JSX props (#25096) --- site/AGENTS.md | 3 +++ site/src/components/Loader/Loader.tsx | 2 +- site/src/components/Paywall/PopoverPaywall.tsx | 2 +- site/src/components/SelectMenu/SelectMenu.tsx | 2 +- site/src/components/UserAutocomplete/UserAutocomplete.tsx | 2 +- site/src/modules/resources/AgentExternal.tsx | 2 +- site/src/modules/resources/AgentRow.tsx | 2 +- site/src/modules/resources/SSHButton/SSHButton.tsx | 2 +- .../ClassicParameterFlowDeprecationWarning.test.tsx | 2 +- .../workspaces/DynamicParameter/DynamicParameter.test.tsx | 6 +++--- .../WorkspaceMoreActions/WorkspaceMoreActions.tsx | 2 +- .../AgentsPage/components/AgentCreateForm.stories.tsx | 2 +- .../components/LimitsTab/GroupLimitsSection.tsx | 2 +- .../components/LimitsTab/UserOverridesSection.tsx | 2 +- .../AgentsPage/components/Sidebar/AgentsSidebar.test.tsx | 2 +- site/src/pages/AuditPage/AuditLogRow/AuditLogRow.tsx | 2 +- site/src/pages/TaskPage/TaskPage.tsx | 2 +- .../WorkspacePage/WorkspaceActions/WorkspaceActions.tsx | 8 ++++---- 18 files changed, 25 insertions(+), 22 deletions(-) diff --git a/site/AGENTS.md b/site/AGENTS.md index 194765ff2e..4d39493e52 100644 --- a/site/AGENTS.md +++ b/site/AGENTS.md @@ -101,6 +101,9 @@ Debug logs and pprof dumps use the same job name and commit SHA convention. - Do not use emdash (U+2014), endash (U+2013), or ` -- ` as punctuation in code, comments, string literals, or documentation. Use commas, semicolons, or periods instead. Restructure the sentence if needed. +- For JSX boolean props that are `true`, use the shorthand form + (``) instead of ``. The two are + equivalent; the shorthand is the React convention and reduces noise. - **Avoid unnecessary indirection.** Inline single-use module-level constants, single-use aliases, and one-line helpers that just return a single field at the call site. Do not create wrapper hooks that only diff --git a/site/src/components/Loader/Loader.tsx b/site/src/components/Loader/Loader.tsx index b771b5fec6..3ba241dcf3 100644 --- a/site/src/components/Loader/Loader.tsx +++ b/site/src/components/Loader/Loader.tsx @@ -32,7 +32,7 @@ export const Loader: FC = ({ className, )} > - + ); }; diff --git a/site/src/components/Paywall/PopoverPaywall.tsx b/site/src/components/Paywall/PopoverPaywall.tsx index 2ce494cc5b..59929e8b78 100644 --- a/site/src/components/Paywall/PopoverPaywall.tsx +++ b/site/src/components/Paywall/PopoverPaywall.tsx @@ -17,7 +17,7 @@ export const PopoverPaywall: FC = ({ message={message} description={description} documentationLink={documentationLink} - compact={true} + compact /> ); }; diff --git a/site/src/components/SelectMenu/SelectMenu.tsx b/site/src/components/SelectMenu/SelectMenu.tsx index 4b03a9a709..78b2bf2659 100644 --- a/site/src/components/SelectMenu/SelectMenu.tsx +++ b/site/src/components/SelectMenu/SelectMenu.tsx @@ -80,7 +80,7 @@ export const SelectMenuSearch: FC = ({ "w-full border border-solid border-border [&_input]:text-sm", className, )} - autoFocus={true} + autoFocus {...props} /> ); diff --git a/site/src/components/UserAutocomplete/UserAutocomplete.tsx b/site/src/components/UserAutocomplete/UserAutocomplete.tsx index c8365316ad..7a0bf3f2b4 100644 --- a/site/src/components/UserAutocomplete/UserAutocomplete.tsx +++ b/site/src/components/UserAutocomplete/UserAutocomplete.tsx @@ -86,7 +86,7 @@ export const MemberAutocomplete: FC = ({ error={membersQuery.error} isFetching={membersQuery.isFetching} - shouldFilter={true} + shouldFilter setFilter={setFilter} users={membersQuery.data?.members} {...props} diff --git a/site/src/modules/resources/AgentExternal.tsx b/site/src/modules/resources/AgentExternal.tsx index 5a39a50c36..1ea0645096 100644 --- a/site/src/modules/resources/AgentExternal.tsx +++ b/site/src/modules/resources/AgentExternal.tsx @@ -38,7 +38,7 @@ export const AgentExternal: FC = ({ agent, workspace }) => { secret={false} redactPattern={/CODER_AGENT_TOKEN="([^"]+)"/g} redactReplacement={`CODER_AGENT_TOKEN="********"`} - showRevealButton={true} + showRevealButton /> ); diff --git a/site/src/modules/resources/AgentRow.tsx b/site/src/modules/resources/AgentRow.tsx index 69739a53e5..46c306613e 100644 --- a/site/src/modules/resources/AgentRow.tsx +++ b/site/src/modules/resources/AgentRow.tsx @@ -523,7 +523,7 @@ export const AgentRow: FC = ({ > {runningScriptsCount} diff --git a/site/src/modules/resources/SSHButton/SSHButton.tsx b/site/src/modules/resources/SSHButton/SSHButton.tsx index 0a6761d0d9..39cca8cbf8 100644 --- a/site/src/modules/resources/SSHButton/SSHButton.tsx +++ b/site/src/modules/resources/SSHButton/SSHButton.tsx @@ -32,7 +32,7 @@ export const AgentSSHButton: FC = ({ return ( - +