Skip to content

Commit ef880d0

Browse files
committed
fix(apollo-wind): address PR #219 review feedback
- Type internalRowSelection state as Record<string, boolean> (data-table) - Sanitize CSS tokens and remove dangerouslySetInnerHTML (chart) - Fix zero-value hidden by truthiness check in chart tooltip - Add onTabChange prop and wire tab buttons (flow-properties-expanded) - Add type="button" to all <button> elements in custom components - Rename Panel → MaestroPanel to avoid generic naming collisions - Remove unused imports (Input, FileText, MoreHorizontal, CreditCard, Settings) Made-with: Cursor
1 parent 1adfd58 commit ef880d0

20 files changed

Lines changed: 102 additions & 93 deletions

packages/apollo-wind/src/components/custom/chat-composer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ export function ChatComposer({
6868
<div className="flex items-center justify-between">
6969
{/* Left actions */}
7070
<div className="flex items-center gap-1">
71-
<button
71+
<button type="button"
7272
type="button"
7373
className="flex h-8 w-8 items-center justify-center rounded-2xl border border-border-inverse bg-surface-inverse transition-opacity hover:opacity-80"
7474
aria-label="Add attachment"
7575
>
7676
<Plus className="h-5 w-5 text-foreground-inverse" />
7777
</button>
78-
<button
78+
<button type="button"
7979
type="button"
8080
className="flex h-8 w-8 items-center justify-center rounded-2xl border border-border-inverse bg-surface-inverse transition-opacity hover:opacity-80"
8181
aria-label="Add workflow"
@@ -85,7 +85,7 @@ export function ChatComposer({
8585
</div>
8686

8787
{/* Submit button */}
88-
<button
88+
<button type="button"
8989
type="button"
9090
className="flex h-8 w-8 items-center justify-center rounded-2xl bg-brand transition-opacity hover:opacity-90"
9191
onClick={handleSubmit}

packages/apollo-wind/src/components/custom/chat-prompt-suggestions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function PromptSuggestions({
3737
return (
3838
<div className={cn('flex flex-col items-start gap-2', className)}>
3939
{suggestions.map((suggestion) => (
40-
<button
40+
<button type="button"
4141
key={suggestion.id}
4242
className="flex h-10 items-center rounded-xl border border-border bg-surface-overlay px-4 py-2.5 text-sm font-medium leading-5 text-foreground transition-colors hover:bg-surface-hover"
4343
onClick={() => onSelect?.(suggestion)}

packages/apollo-wind/src/components/custom/chat-steps-view.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function ActionButton({
8989
onClick?: () => void;
9090
}) {
9191
return (
92-
<button
92+
<button type="button"
9393
className="flex h-10 items-center gap-2 rounded-xl border border-border px-4 py-2 text-sm font-medium leading-5 text-foreground-subtle transition-colors hover:border-border-hover hover:text-foreground-hover"
9494
onClick={onClick}
9595
>
@@ -231,7 +231,7 @@ export function StepsView({
231231
<div className="flex min-h-[78px] shrink-0 items-center gap-8 overflow-x-auto px-10 py-5">
232232
{/* Back + Title */}
233233
<div className="flex shrink-0 items-center gap-4">
234-
<button
234+
<button type="button"
235235
type="button"
236236
className="shrink-0 text-foreground transition-colors hover:text-foreground"
237237
onClick={onBack}

packages/apollo-wind/src/components/custom/flow-properties-bar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function PropertiesBar({
6262

6363
{/* Right: Properties / Variables tabs */}
6464
<div className="flex h-10 items-center rounded-xl bg-surface-overlay border border-border-deep p-1">
65-
<button
65+
<button type="button"
6666
className={cn(
6767
'flex h-8 items-center gap-2 rounded-[10px] px-4 py-2 text-sm font-medium leading-5 text-foreground-subtle transition-colors hover:text-foreground-hover',
6868
activeTab === 'properties' && 'text-foreground-subtle'
@@ -75,7 +75,7 @@ export function PropertiesBar({
7575
<TableProperties className="h-5 w-5" />
7676
<span>Properties</span>
7777
</button>
78-
<button
78+
<button type="button"
7979
className={cn(
8080
'flex h-7 items-center gap-2 rounded-xl px-4 py-2 text-sm font-medium leading-5 text-foreground-subtle transition-colors',
8181
activeTab === 'variables' && 'text-foreground-subtle'

packages/apollo-wind/src/components/custom/flow-properties-expanded.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export interface PropertiesExpandedProps {
2525
nodeType?: string;
2626
/** Active top tab: 'properties' | 'variables' */
2727
activeTab?: 'properties' | 'variables';
28+
/** Callback when top tab is changed */
29+
onTabChange?: (tab: 'properties' | 'variables') => void;
2830
/** Callback when close button is clicked */
2931
onClose?: () => void;
3032
}
@@ -44,6 +46,7 @@ function MiniTab({
4446
}) {
4547
return (
4648
<button
49+
type="button"
4750
className={cn(
4851
'flex h-6 items-center rounded-lg px-2 text-xs font-medium leading-5',
4952
active ? 'bg-surface text-foreground' : 'text-foreground-subtle'
@@ -141,6 +144,7 @@ export function PropertiesExpanded({
141144
nodeName = 'Validate invoice',
142145
nodeType = 'AI Agent',
143146
activeTab = 'properties',
147+
onTabChange,
144148
onClose,
145149
}: PropertiesExpandedProps) {
146150
return (
@@ -171,23 +175,27 @@ export function PropertiesExpanded({
171175
<div className="flex items-center gap-2">
172176
<div className="flex h-10 items-center rounded-xl border border-border-deep bg-surface-overlay p-1">
173177
<button
178+
type="button"
174179
className={cn(
175180
'flex h-8 items-center gap-2 rounded-[10px] px-3 py-2 text-sm font-medium leading-5 transition-colors',
176181
activeTab === 'properties'
177182
? 'border border-border bg-surface text-foreground'
178183
: 'text-foreground-subtle'
179184
)}
185+
onClick={() => onTabChange?.('properties')}
180186
>
181187
<TableProperties className="h-5 w-5" />
182188
<span>Properties</span>
183189
</button>
184190
<button
191+
type="button"
185192
className={cn(
186193
'flex h-8 items-center gap-2 rounded-[10px] px-3 py-2 text-sm font-medium leading-5 transition-colors',
187194
activeTab === 'variables'
188195
? 'border border-border bg-surface text-foreground'
189196
: 'text-foreground-subtle'
190197
)}
198+
onClick={() => onTabChange?.('variables')}
191199
>
192200
<Variable className="h-5 w-5" />
193201
<span>Variables</span>

packages/apollo-wind/src/components/custom/flow-properties-simple.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function FieldItem({
105105
{field.required && '*'}
106106
</span>
107107
{field.showGraphControl && (
108-
<button
108+
<button type="button"
109109
className="flex h-6 w-6 items-center justify-center rounded-lg bg-surface-overlay text-foreground-muted transition-colors hover:text-foreground"
110110
onClick={() => onGraphControl?.(field.label)}
111111
aria-label="Graph control"
@@ -148,7 +148,7 @@ function FieldItem({
148148
placeholder={field.placeholder}
149149
className="h-full flex-1 rounded-none border-0 bg-transparent text-sm font-medium text-foreground-muted shadow-none placeholder:text-foreground-subtle focus-visible:ring-0"
150150
/>
151-
<button
151+
<button type="button"
152152
type="button"
153153
className="flex h-full w-[50px] items-center justify-center border-l border-border text-foreground-muted transition-colors hover:text-foreground"
154154
aria-label="Browse files"
@@ -198,7 +198,7 @@ const sampleJsonLines = [
198198

199199
function EditorToolbarButton({ icon, label }: { icon: React.ReactNode; label: string }) {
200200
return (
201-
<button
201+
<button type="button"
202202
className="flex h-8 w-8 items-center justify-center rounded-lg text-foreground-muted transition-colors hover:text-foreground"
203203
aria-label={label}
204204
>
@@ -217,7 +217,7 @@ function JsonEditorDrawer({ open, onClose }: { open: boolean; onClose: () => voi
217217
<span className="text-base font-semibold leading-5 tracking-[-0.4px] text-foreground">
218218
JSON editor
219219
</span>
220-
<button
220+
<button type="button"
221221
className="flex h-10 w-10 items-center justify-center rounded-xl bg-surface-overlay text-foreground-muted transition-colors hover:text-foreground"
222222
onClick={onClose}
223223
aria-label="Close editor"
@@ -243,7 +243,7 @@ function JsonEditorDrawer({ open, onClose }: { open: boolean; onClose: () => voi
243243
<FileJson className="h-4 w-4" />
244244
<span className="text-sm font-medium leading-none">script.js</span>
245245
</div>
246-
<button
246+
<button type="button"
247247
className="flex h-5 w-5 items-center justify-center text-foreground-muted transition-colors hover:text-foreground"
248248
aria-label="Refresh"
249249
>
@@ -274,13 +274,13 @@ function JsonEditorDrawer({ open, onClose }: { open: boolean; onClose: () => voi
274274

275275
{/* ── Footer ──────────────────────────────────────────── */}
276276
<div className="flex items-center justify-end gap-2 px-6 py-4">
277-
<button
277+
<button type="button"
278278
className="flex h-10 items-center gap-2 rounded-xl border border-border px-4 py-2 text-sm font-medium leading-5 text-foreground-subtle transition-colors hover:text-foreground"
279279
onClick={onClose}
280280
>
281281
<span>Cancel</span>
282282
</button>
283-
<button
283+
<button type="button"
284284
className="flex h-10 items-center gap-2 rounded-xl bg-brand px-4 py-2 text-sm font-semibold leading-5 text-foreground-inverse transition-colors hover:bg-brand/90"
285285
onClick={onClose}
286286
>
@@ -346,7 +346,7 @@ export function PropertiesSimple({
346346
{title}
347347
</span>
348348
</div>
349-
<button
349+
<button type="button"
350350
className="flex h-10 w-10 items-center justify-center rounded-xl bg-surface-overlay text-foreground-muted transition-colors hover:text-foreground"
351351
onClick={onClose}
352352
aria-label="Close properties"

packages/apollo-wind/src/components/custom/global-header.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function HeaderIconButton({
7979
disabled?: boolean;
8080
}) {
8181
return (
82-
<button
82+
<button type="button"
8383
className={cn(
8484
'flex h-8 w-8 items-center justify-center rounded-lg text-foreground-muted transition-colors',
8585
disabled ? 'cursor-default opacity-50' : 'hover:text-foreground'
@@ -102,7 +102,7 @@ function NotificationsDropdown({ themeClass }: { themeClass: string }) {
102102
return (
103103
<DropdownMenu>
104104
<DropdownMenuTrigger asChild>
105-
<button
105+
<button type="button"
106106
className="flex h-8 w-8 items-center justify-center rounded-lg text-foreground-muted transition-colors hover:text-foreground"
107107
aria-label="Notifications"
108108
>
@@ -152,7 +152,7 @@ function HelpDropdown({ themeClass }: { themeClass: string }) {
152152
return (
153153
<DropdownMenu>
154154
<DropdownMenuTrigger asChild>
155-
<button
155+
<button type="button"
156156
className="flex h-8 w-8 items-center justify-center rounded-lg text-foreground-muted transition-colors hover:text-foreground"
157157
aria-label="Help"
158158
>
@@ -197,7 +197,7 @@ function TenantSelector({ tenantName, themeClass }: { tenantName: string; themeC
197197
return (
198198
<Popover>
199199
<PopoverTrigger asChild>
200-
<button className="flex items-center gap-1 rounded-lg px-2 py-1 text-sm text-foreground-muted transition-colors hover:text-foreground">
200+
<button type="button" className="flex items-center gap-1 rounded-lg px-2 py-1 text-sm text-foreground-muted transition-colors hover:text-foreground">
201201
<span>
202202
Tenant: <span className="font-medium">{selected}</span>
203203
</span>
@@ -210,7 +210,7 @@ function TenantSelector({ tenantName, themeClass }: { tenantName: string; themeC
210210
className={cn(themeClass, 'w-56 border-border bg-surface-overlay p-1')}
211211
>
212212
{tenants.map((tenant) => (
213-
<button
213+
<button type="button"
214214
key={tenant.id}
215215
className={cn(
216216
'flex w-full items-center rounded-md px-3 py-2 text-sm transition-colors hover:bg-surface-hover',
@@ -236,7 +236,7 @@ function AvatarDropdown({ themeClass }: { themeClass: string }) {
236236
return (
237237
<DropdownMenu>
238238
<DropdownMenuTrigger asChild>
239-
<button className="rounded-full focus:outline-none" aria-label="User menu">
239+
<button type="button" className="rounded-full focus:outline-none" aria-label="User menu">
240240
<Avatar className="h-6 w-6 bg-brand">
241241
<AvatarFallback className="bg-brand text-[10px] font-bold text-foreground-on-accent">
242242
UI
@@ -327,7 +327,7 @@ export function MaestroHeader({
327327
>
328328
{/* Left: waffle + title */}
329329
<div className="flex items-center gap-3">
330-
<button
330+
<button type="button"
331331
className="flex h-8 w-8 items-center justify-center rounded-lg text-foreground-muted transition-colors hover:text-foreground"
332332
onClick={() => menuContent && setMenuOpen((prev) => !prev)}
333333
aria-label="App launcher"

packages/apollo-wind/src/components/custom/panel-delegate.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function ExpandedNavItem({
8080

8181
if (!isExpandable) {
8282
return (
83-
<button
83+
<button type="button"
8484
className="flex h-10 w-full items-center gap-2 rounded-2xl px-1 text-foreground-muted transition-colors hover:bg-surface-hover"
8585
onClick={onToggle}
8686
>
@@ -95,7 +95,7 @@ function ExpandedNavItem({
9595
return (
9696
<Collapsible open={isOpen} onOpenChange={() => onToggle()}>
9797
<CollapsibleTrigger asChild>
98-
<button className="flex h-10 w-full items-center justify-between rounded-2xl px-1 text-foreground-muted transition-colors hover:bg-surface-hover">
98+
<button type="button" className="flex h-10 w-full items-center justify-between rounded-2xl px-1 text-foreground-muted transition-colors hover:bg-surface-hover">
9999
<div className="flex items-center gap-2">
100100
<div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg">
101101
{item.icon}
@@ -112,7 +112,7 @@ function ExpandedNavItem({
112112
<CollapsibleContent>
113113
<div className="flex flex-col">
114114
{item.children?.map((child) => (
115-
<button
115+
<button type="button"
116116
key={child.id}
117117
className={cn(
118118
'flex h-10 items-center rounded-2xl pl-12 pr-3 text-sm font-medium text-foreground-muted transition-colors hover:bg-surface-hover',
@@ -143,7 +143,7 @@ function CollapsedNavItem({
143143
return (
144144
<Tooltip>
145145
<TooltipTrigger asChild>
146-
<button
146+
<button type="button"
147147
className={cn(
148148
'flex h-12 w-full items-center justify-center text-foreground-muted transition-colors hover:text-foreground',
149149
isActive && 'text-brand-foreground'
@@ -247,22 +247,22 @@ export function DelegatePanel({
247247
{panelOpen && (
248248
<div className="flex flex-1 items-center justify-between">
249249
<div className="flex items-center gap-[18px]">
250-
<button
250+
<button type="button"
251251
type="button"
252252
className="text-foreground-muted transition-colors hover:text-foreground"
253253
aria-label="New conversation"
254254
>
255255
<MessageCirclePlus className="h-5 w-5" />
256256
</button>
257-
<button
257+
<button type="button"
258258
type="button"
259259
className="text-foreground-muted transition-colors hover:text-foreground"
260260
aria-label="Picture in picture"
261261
>
262262
<PictureInPicture2 className="h-5 w-5" />
263263
</button>
264264
</div>
265-
<button
265+
<button type="button"
266266
type="button"
267267
className="text-foreground-muted transition-colors hover:text-foreground"
268268
onClick={() => setPanelOpen(false)}
@@ -301,7 +301,7 @@ export function DelegatePanel({
301301
{/* Expand button */}
302302
<Tooltip>
303303
<TooltipTrigger asChild>
304-
<button
304+
<button type="button"
305305
className="flex h-12 w-full items-center justify-center text-foreground-muted transition-colors hover:text-foreground"
306306
onClick={() => setPanelOpen(true)}
307307
>

packages/apollo-wind/src/components/custom/panel-flow.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function IconRail({
8181
{navItems.map((item) => (
8282
<Tooltip key={item.id}>
8383
<TooltipTrigger asChild>
84-
<button
84+
<button type="button"
8585
className={cn(
8686
'flex h-12 w-full items-center justify-center text-foreground-muted transition-colors hover:text-foreground',
8787
activeId === item.id && 'text-brand-foreground'
@@ -161,22 +161,22 @@ function ChatInput() {
161161
</div>
162162
<div className="flex items-center justify-between">
163163
<div className="flex items-center gap-2">
164-
<button
164+
<button type="button"
165165
type="button"
166166
className="flex h-8 w-8 items-center justify-center rounded-lg text-foreground-muted hover:text-foreground"
167167
aria-label="Add attachment"
168168
>
169169
<Plus className="h-5 w-5" />
170170
</button>
171-
<button
171+
<button type="button"
172172
type="button"
173173
className="flex h-8 w-8 items-center justify-center rounded-lg text-foreground-muted hover:text-foreground"
174174
aria-label="Add workflow"
175175
>
176176
<Workflow className="h-5 w-5" />
177177
</button>
178178
</div>
179-
<button
179+
<button type="button"
180180
type="button"
181181
className="flex h-8 w-8 items-center justify-center rounded-full bg-brand text-foreground-on-accent"
182182
aria-label="Submit message"
@@ -209,7 +209,7 @@ function ExpandedPanel({
209209
<span className="font-bold text-foreground">Flow</span>
210210
<span className="font-medium text-foreground-subtle">Autopilot</span>
211211
</div>
212-
<button
212+
<button type="button"
213213
className="text-foreground-muted transition-colors hover:text-foreground"
214214
onClick={onClose}
215215
aria-label="Close panel"

0 commit comments

Comments
 (0)