Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,18 @@ export function NewWorkspaceModal() {
const isOpen = useNewWorkspaceModalOpen();
const closeModal = useCloseNewWorkspaceModal();
const preSelectedProjectId = usePreSelectedProjectId();
const [selectedProjectId, setSelectedProjectId] = useState<string | null>(
const [selectedProjectId, _setSelectedProjectId] = useState<string | null>(
null,
);
const [title, setTitle] = useState("");
const [branchName, setBranchName] = useState("");
const [branchNameEdited, setBranchNameEdited] = useState(false);
const [mode, setMode] = useState<Mode>("new");
const [baseBranch, setBaseBranch] = useState<string | null>(null);
const selectProject = (projectId: string | null) => {
_setSelectedProjectId(projectId);
setBaseBranch(null);
};
const [baseBranchOpen, setBaseBranchOpen] = useState(false);
const [branchSearch, setBranchSearch] = useState("");
const [showAdvanced, setShowAdvanced] = useState(false);
Expand Down Expand Up @@ -129,17 +133,12 @@ export function NewWorkspaceModal() {

useEffect(() => {
if (isOpen && !selectedProjectId && preSelectedProjectId) {
setSelectedProjectId(preSelectedProjectId);
selectProject(preSelectedProjectId);
}
}, [isOpen, selectedProjectId, preSelectedProjectId]);

const effectiveBaseBranch = baseBranch ?? branchData?.defaultBranch ?? null;

// biome-ignore lint/correctness/useExhaustiveDependencies: intentionally reset when project changes
useEffect(() => {
setBaseBranch(null);
}, [selectedProjectId]);

const branchSlug = branchNameEdited
? sanitizeBranchName(branchName)
: generateSlugFromTitle(title);
Expand All @@ -152,7 +151,7 @@ export function NewWorkspaceModal() {
: branchSlug;

const resetForm = () => {
setSelectedProjectId(null);
_setSelectedProjectId(null);
setTitle("");
setBranchName("");
setBranchNameEdited(false);
Expand Down Expand Up @@ -221,7 +220,7 @@ export function NewWorkspaceModal() {
}

if (successes.length > 0) {
setSelectedProjectId(successes[0].project.id);
selectProject(successes[0].project.id);
}
}
} catch (error) {
Expand Down Expand Up @@ -300,7 +299,7 @@ export function NewWorkspaceModal() {
.map((project) => (
<DropdownMenuItem
key={project.id}
onClick={() => setSelectedProjectId(project.id)}
onClick={() => selectProject(project.id)}
>
{project.name}
{project.id === selectedProjectId && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ function ProjectPage() {

<div className="flex-1 flex overflow-y-auto">
<div className="flex-1 flex items-center justify-center">
{/* biome-ignore lint/a11y/noStaticElementInteractions: onKeyDown for Enter-to-submit */}
<div className="w-full max-w-md mx-6" onKeyDown={handleKeyDown}>
<div role="form" className="w-full max-w-md mx-6" onKeyDown={handleKeyDown}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

role="form" missing accessible name — landmark won't be announced by screen readers

Per the WAI-ARIA spec, a form landmark is only exposed (and navigable) by assistive technologies when it carries an accessible name via aria-label or aria-labelledby. Without one, the role is silently dropped by most screen readers.

The <h1> on line 159 is the natural label — adding an id to it and referencing it with aria-labelledby is the minimal fix:

♿ Proposed fix
-<div role="form" className="w-full max-w-md mx-6" onKeyDown={handleKeyDown}>
-    <h1 className="text-3xl font-semibold text-foreground tracking-tight mb-2">
-        Create your first workspace
-    </h1>
+<div role="form" aria-labelledby="create-workspace-heading" className="w-full max-w-md mx-6" onKeyDown={handleKeyDown}>
+    <h1 id="create-workspace-heading" className="text-3xl font-semibold text-foreground tracking-tight mb-2">
+        Create your first workspace
+    </h1>

Alternatively, a native <form> element provides the same semantics without requiring an explicit role (its landmark is implicit when labelled) and allows using onSubmit instead of an onKeyDown intercept, which is cleaner:

✨ Optional: prefer native <form>
-<div role="form" className="w-full max-w-md mx-6" onKeyDown={handleKeyDown}>
+<form
+  aria-labelledby="create-workspace-heading"
+  className="w-full max-w-md mx-6"
+  onSubmit={(e) => { e.preventDefault(); handleCreateWorkspace(); }}
+>
     <h1 ...>Create your first workspace</h1>
     ...
     <Button
       size="lg"
-      onClick={handleCreateWorkspace}
+      type="submit"
       ...
     >
-<div>
+</form>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div role="form" className="w-full max-w-md mx-6" onKeyDown={handleKeyDown}>
<div role="form" aria-labelledby="create-workspace-heading" className="w-full max-w-md mx-6" onKeyDown={handleKeyDown}>
<h1 id="create-workspace-heading" className="text-3xl font-semibold text-foreground tracking-tight mb-2">
Create your first workspace
</h1>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/project/`$projectId/page.tsx
at line 158, The container currently uses role="form" on a div (role="form")
with onKeyDown={handleKeyDown} so screen readers won't expose it because it
lacks an accessible name; either add an accessible name by assigning an id to
the page heading (the <h1>) and reference it via aria-labelledby on the
role="form" element, or replace the div with a native <form> element and move
the keyboard handler to an onSubmit handler (update handleKeyDown usage
accordingly) so the landmark is properly exposed and submission is handled
semantically.

<h1 className="text-3xl font-semibold text-foreground tracking-tight mb-2">
Create your first workspace
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ export function CollectionsProvider({ children }: { children: ReactNode }) {
setIsSwitching(true);
try {
await authClient.organization.setActive({ organizationId });
// Wait for target org's collections to finish initial Electric sync.
// If already preloaded by the background useEffect, this resolves instantly.
await preloadCollections(organizationId);
await refetchSession();
await Promise.all([
preloadCollections(organizationId),
refetchSession(),
]);
} finally {
setIsSwitching(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ export function ApiKeysSettings({ visibleItems }: ApiKeysSettingsProps) {
{showApiKeysList &&
(isLoading ? (
<div className="space-y-2 border rounded-lg">
{[1, 2, 3].map((i) => (
<div key={i} className="flex items-center gap-4 p-4">
{["skeleton-1", "skeleton-2", "skeleton-3"].map((id) => (
<div key={id} className="flex items-center gap-4 p-4">
<Skeleton className="h-8 w-8 rounded" />
<div className="flex-1 space-y-2">
<Skeleton className="h-4 w-48" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button } from "@superset/ui/button";
import { Input } from "@superset/ui/input";
import { useCallback, useEffect, useState } from "react";
import { useCallback, useState } from "react";
import { electronTrpc } from "renderer/lib/electron-trpc";
import { MONACO_EDITOR_OPTIONS } from "renderer/providers/MonacoProvider";
import {
Expand Down Expand Up @@ -69,11 +69,6 @@ export function FontSettingSection({ variant }: FontSettingSectionProps) {
const [fontDraft, setFontDraft] = useState<string | null>(null);
const [fontSizeDraft, setFontSizeDraft] = useState<string | null>(null);

// biome-ignore lint/correctness/useExhaustiveDependencies: sync draft state when fontSettings changes
useEffect(() => {
setFontSizeDraft(null);
}, [fontSettings]);

const currentFamily = fontSettings?.[config.familyKey] ?? null;
const currentSize = fontSettings?.[config.sizeKey] ?? null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,23 @@ const COMPARISON_SECTIONS: ComparisonSection[] = [
},
];

function ComparisonValueCell({ value }: { value: ComparisonValue }) {
if (value === null || value === false) {
return <span className="sr-only">Not included</span>;
}

if (value === true) {
return <HiCheck className="h-3.5 w-3.5 text-muted-foreground" />;
}

return (
<>
<HiCheck className="h-3.5 w-3.5 text-muted-foreground" />
<span className="text-sm">{value}</span>
</>
);
}

function PlansPage() {
const [isYearly, setIsYearly] = useState(true);
const [isUpgrading, setIsUpgrading] = useState(false);
Expand Down Expand Up @@ -310,23 +327,6 @@ function PlansPage() {
}
};

const renderComparisonValue = (value: ComparisonValue) => {
if (value === null || value === false) {
return <span className="sr-only">Not included</span>;
}

if (value === true) {
return <HiCheck className="h-3.5 w-3.5 text-muted-foreground" />;
}

return (
<>
<HiCheck className="h-3.5 w-3.5 text-muted-foreground" />
<span className="text-sm">{value}</span>
</>
);
};

const highlightColumnIndex = 1;
const highlightColumnStart = highlightColumnIndex + 2;
const gridColumnsClass = "grid grid-cols-[240px_repeat(3,_1fr)]";
Expand Down Expand Up @@ -534,7 +534,7 @@ function PlansPage() {
key={`${row.label}-${valueIndex}`}
className="flex items-center justify-start gap-2 px-4 py-2.5"
>
{renderComparisonValue(value)}
<ComparisonValueCell value={value} />
</div>
))}
{!isLastRow && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useMemo } from "react";
import { useWorkspaceShortcuts } from "renderer/hooks/useWorkspaceShortcuts";
import { PortsList } from "./PortsList";
import { ProjectSection } from "./ProjectSection";
Expand All @@ -20,18 +19,16 @@ export function WorkspaceSidebar({
}: WorkspaceSidebarProps) {
const { groups } = useWorkspaceShortcuts();

// Calculate shortcut base indices for each project group using cumulative offsets
const projectShortcutIndices = useMemo(
() =>
groups.reduce<{ indices: number[]; cumulative: number }>(
(acc, group) => ({
indices: [...acc.indices, acc.cumulative],
cumulative: acc.cumulative + group.workspaces.length,
}),
{ indices: [], cumulative: 0 },
).indices,
[groups],
);
const projectShortcutIndices = groups.reduce<{
indices: number[];
cumulative: number;
}>(
(acc, group) => ({
indices: [...acc.indices, acc.cumulative],
cumulative: acc.cumulative + group.workspaces.length,
}),
{ indices: [], cumulative: 0 },
).indices;

return (
<SidebarDropZone className="flex flex-col h-full bg-background">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ export function MessagePartsRenderer({

if (part.type === "text") {
nodes.push(
<MessageResponse key={i} isAnimating={isLastAssistant && isStreaming}>
<MessageResponse
key={`text-${i}`}
isAnimating={isLastAssistant && isStreaming}
>
{part.text}
</MessageResponse>,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,16 @@ export function BasePaneWindow({
onDragStart={() => setDragging(paneId, tabId)}
onDragEnd={() => clearDragging()}
>
{/* biome-ignore lint/a11y/useKeyWithClickEvents lint/a11y/noStaticElementInteractions: Focus handler for pane */}
<div
role="group"
ref={containerRef}
className={contentClassName}
style={isDragging ? { pointerEvents: "none" } : undefined}
onClick={handleFocus}
onKeyDown={(e) => {
if (e.target !== e.currentTarget) return;
if (e.key === "Enter" || e.key === " ") handleFocus();
}}
Comment on lines +111 to +114
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

onKeyDown Enter/Space path is unreachable — missing tabIndex

The guard e.target !== e.currentTarget means "only fire when the div itself is the keyboard event target." Because this div has no tabIndex, it cannot receive keyboard focus through standard navigation; e.target === e.currentTarget is never true in practice, so handleFocus() is never called from the keyboard. The handler satisfies the linter syntactically but not functionally.

To make the keyboard shortcut reachable, add tabIndex={0} to the div (or tabIndex={-1} for programmatic-only focus):

🛠️ Proposed fix
 <div
   role="group"
+  tabIndex={0}
   ref={containerRef}
   className={contentClassName}
   style={isDragging ? { pointerEvents: "none" } : undefined}
   onClick={handleFocus}
   onKeyDown={(e) => {
     if (e.target !== e.currentTarget) return;
     if (e.key === "Enter" || e.key === " ") handleFocus();
   }}
 >

Note: adding tabIndex={0} inserts the pane container into the tab order, which may interfere with Tab navigation inside pane content (terminals, editors). If that's undesirable, tabIndex={-1} allows programmatic focus without affecting the tab order, though keyboard users won't be able to tab to the pane itself.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
onKeyDown={(e) => {
if (e.target !== e.currentTarget) return;
if (e.key === "Enter" || e.key === " ") handleFocus();
}}
<div
role="group"
tabIndex={0}
ref={containerRef}
className={contentClassName}
style={isDragging ? { pointerEvents: "none" } : undefined}
onClick={handleFocus}
onKeyDown={(e) => {
if (e.target !== e.currentTarget) return;
if (e.key === "Enter" || e.key === " ") handleFocus();
}}
>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/components/BasePaneWindow/BasePaneWindow.tsx`
around lines 111 - 114, The onKeyDown handler on the pane container is never
invoked from keyboard because the div cannot be focused; update the pane
container element (the div that registers onKeyDown) to include an explicit
tabIndex (e.g., tabIndex={0} to make it reachable by Tab or tabIndex={-1} if you
only want programmatic focus), so that e.target === e.currentTarget can be true
and handleFocus() will run; ensure the change is applied where onKeyDown and
handleFocus are defined (BasePaneWindow component) and consider accessibility
impact on internal focusable content when choosing 0 vs -1.

>
{children}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,9 +711,9 @@ export function AppMockup({ activeDemo = "Use Any Agents" }: AppMockupProps) {
}}
transition={{ duration: 0.3, ease: "easeOut" }}
>
{FILE_CHANGES.map((file, i) => (
{FILE_CHANGES.map((file) => (
<FileChangeItem
key={`${file.path}-${i}`}
key={file.path}
path={file.path}
add={file.add}
del={file.del}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function ProductDemo({ scrollYProgress }: ProductDemoProps) {
{/* Mockup with scroll-driven scale */}
<motion.div
className="relative"
style={{ scale, willChange: "transform" }}
style={{ scale }}
>
<div className="relative">
{/* Large diffuse back-shadow */}
Expand All @@ -47,7 +47,7 @@ export function ProductDemo({ scrollYProgress }: ProductDemoProps) {
{/* Selector pills - below mockup, shift up as mockup scales */}
<motion.div
className="flex items-center gap-2 -mt-2 sm:-mt-4 px-4 sm:px-0 sm:justify-center overflow-x-auto pb-1 scrollbar-hide"
style={{ y: pillsY, willChange: "transform" }}
style={{ y: pillsY }}
>
{DEMO_OPTIONS.map((option) => (
<SelectorPill
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export function TrustedBySection() {
<div
key={client.name}
className="flex items-center justify-center opacity-60 hover:opacity-100 transition-opacity cursor-pointer whitespace-nowrap h-10 sm:h-14 gap-1.5 sm:gap-2 mx-5 sm:mx-10"
style={{ willChange: "transform" }}
>
<Image
src={client.logo}
Expand Down
7 changes: 7 additions & 0 deletions apps/web/src/app/auth/desktop/success/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import { auth } from "@superset/auth/server";
import { db } from "@superset/db/client";
import { sessions } from "@superset/db/schema/auth";
import type { Metadata } from "next";
import { headers } from "next/headers";

import { DesktopRedirect } from "./components/DesktopRedirect";

export const metadata: Metadata = {
title: "Desktop Authentication",
description: "Completing authentication for Superset Desktop",
robots: "noindex",
};

export default async function DesktopSuccessPage({
searchParams,
}: {
Expand Down
7 changes: 7 additions & 0 deletions apps/web/src/app/oauth/consent/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { auth } from "@superset/auth/server";
import { db } from "@superset/db/client";
import type { Metadata } from "next";
import { headers } from "next/headers";
import Image from "next/image";
import { redirect } from "next/navigation";
Expand All @@ -8,6 +9,12 @@ import { env } from "@/env";
import { api } from "@/trpc/server";
import { ConsentForm } from "./components/ConsentForm";

export const metadata: Metadata = {
title: "Authorize Application",
description: "Grant access to your Superset account",
robots: "noindex",
};

interface ConsentPageProps {
searchParams: Promise<Record<string, string>>;
}
Expand Down
Loading