Skip to content
Merged
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
2 changes: 2 additions & 0 deletions db/migrations/002_add_workflow_id.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE jobs ADD COLUMN workflow_instance_id UUID;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Missing index on workflow_instance_id

Adding a UUID column to a table typically implies it will be used as a foreign key or a filter criterion to associate jobs with a specific workflow instance. Without an index, queries filtering by 'workflow_instance_id' will require a full table scan, leading to severe performance degradation as the 'jobs' table grows.

Suggested change
ALTER TABLE jobs ADD COLUMN workflow_instance_id UUID;
ALTER TABLE jobs ADD COLUMN workflow_instance_id UUID;
CREATE INDEX idx_jobs_workflow_instance_id ON jobs(workflow_instance_id);

CREATE INDEX IF NOT EXISTS idx_jobs_workflow_instance_id ON jobs(workflow_instance_id);
4 changes: 4 additions & 0 deletions db/migrations/003_global_settings.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE TABLE IF NOT EXISTS global_settings (
key TEXT PRIMARY KEY,
value TEXT NOT NULL
);
2,137 changes: 935 additions & 1,202 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.14.3",
"@cloudflare/vitest-pool-workers": "^0.16.20",
"@tailwindcss/vite": "^4.2.2",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
Expand All @@ -39,8 +39,8 @@
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1",
"@vitest/browser": "^4.1.4",
"@vitest/browser-playwright": "^4.1.4",
"@vitest/browser": "^4.1.9",
"@vitest/browser-playwright": "^4.1.9",
"chalk": "^5.6.2",
"concurrently": "^9.2.1",
"jsdom": "^29.0.2",
Expand All @@ -50,7 +50,7 @@
"tailwindcss": "^4.2.2",
"typescript": "^6.0.2",
"vite": "^8.0.8",
"vitest": "^4.1.4",
"vitest": "^4.1.9",
"wrangler": "^4.81.1"
},
"dependencies": {
Expand All @@ -64,6 +64,7 @@
"hono": "^4.12.12",
"jsonrepair": "^3.13.3",
"lucide-react": "^1.8.0",
"motion": "^12.42.2",
"picomatch": "^4.0.4",
"postgres": "^3.4.9",
"react": "^19.2.5",
Expand Down
36 changes: 0 additions & 36 deletions scripts/setup-cloudflare.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,19 +305,6 @@ async function main() {

// 3. Queues
console.log(chalk.cyan.bold('📨 Queues'));
const dlqSpinner = ora('Creating DLQ queue (codra-review-dlq)...').start();
try {
await execAsync('npx wrangler queues create codra-review-dlq');
dlqSpinner.succeed();
} catch (e) {
if (e.stderr && (e.stderr.includes('already taken') || e.stderr.includes('already exists'))) {
dlqSpinner.succeed('DLQ queue (codra-review-dlq) already exists.');
} else {
dlqSpinner.fail();
console.error(chalk.yellow(' ⚠️ ' + (e.stderr || e.message)));
}
}

const jobsSpinner = ora('Creating jobs queue (codra-review-jobs)...').start();
try {
await execAsync('npx wrangler queues create codra-review-jobs');
Expand All @@ -331,21 +318,6 @@ async function main() {
}
}

let dlqQueueId = null;
const queuesOutputSpinner = ora('Fetching queue information...').start();
try {
const { stdout } = await execAsync('npx wrangler queues list');
queuesOutputSpinner.succeed();
const lines = stdout.split('\n');
for (const line of lines) {
if (line.includes('codra-review-dlq')) {
dlqQueueId = extractId(line);
}
}
} catch (e) {
queuesOutputSpinner.fail('Failed to fetch queues list.');
console.error(chalk.yellow(' ⚠️ Could not automatically fetch DLQ queue ID. You may need to manually update CF_DLQ_ID.'));
}
console.log('');

// 4. Hyperdrive
Expand Down Expand Up @@ -481,14 +453,6 @@ async function main() {
configChanged = true;
}

if (dlqQueueId) {
wranglerConfig = wranglerConfig.replace(
/"CF_DLQ_ID":\s*"[^"]+"/,
`"CF_DLQ_ID": "${dlqQueueId}"`
);
configChanged = true;
}

if (configChanged) {
fs.writeFileSync(WRANGLER_JSONC_PATH, wranglerConfig, 'utf-8');
configSpinner.succeed('Updated wrangler.jsonc with new resource IDs.');
Expand Down
48 changes: 32 additions & 16 deletions src/client/app.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&family=JetBrains+Mono:ital,wght@0,400;0,500;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:ital,wght@0,400;0,500;1,400&display=swap');

@import "tailwindcss";

Expand Down Expand Up @@ -134,7 +134,7 @@
Tailwind v4 theme tokens (@theme inline = dynamic)
───────────────────────────────────────────────────── */
@theme inline {
--font-sans: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
--font-sans: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
--font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

--color-background: var(--background);
Expand Down Expand Up @@ -723,19 +723,21 @@
will-change: transform;
}

.dashboard-sidebar-action:hover,
.dashboard-sidebar-action:focus-visible {
background-color: color-mix(in oklch, oklch(100% 0 0) 10%, transparent) !important;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Excessive use of !important declarations

The patch introduces numerous '!important' flags across almost every new style rule (lines 729, 730, 736, 740, 765, 766, 770, 777, 783). This is a major anti-pattern that breaks the natural CSS cascade, creates specificity wars, and makes the codebase extremely difficult to maintain or override in the future. Specificity should be managed through a consistent selector strategy rather than forcing overrides.

Suggested change
background-color: color-mix(in oklch, oklch(100% 0 0) 10%, transparent) !important;
Remove !important and increase selector specificity or reorganize the CSS load order to ensure these styles take precedence naturally.

transform: translate3d(0, -2px, 0) !important;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Excessive use of !important

The patch introduces a significant number of '!important' flags (lines 729, 730, 736, 740, 765, 766, 770, 777, 783). This is a major maintainability anti-pattern that breaks the CSS cascade, makes debugging specificity issues difficult, and suggests a struggle with selector weight rather than a structured design system.

Suggested change
transform: translate3d(0, -2px, 0) !important;
Remove !important and increase selector specificity naturally or utilize Tailwind's @layer directives to ensure styles are applied in the correct order.

/* Collapsed sidebar only: SharedLayoutBg pill handles background */
.dashboard-sidebar-collapsed .dashboard-sidebar-action:hover,
.dashboard-sidebar-collapsed .dashboard-sidebar-action:focus-visible {
background-color: transparent !important;
transform: none !important;
}

.dark .dashboard-sidebar-action:hover,
.dark .dashboard-sidebar-action:focus-visible {
background-color: color-mix(in oklch, oklch(100% 0 0) 10%, transparent) !important;
/* Collapsed active button hovered: deep green */
.dashboard-sidebar-collapsed .dashboard-sidebar-action[aria-current="page"]:hover,
.dashboard-sidebar-collapsed .dashboard-sidebar-action[aria-current="page"]:focus-visible {
background-color: oklch(30% 0.35 115 / 0.35) !important;
}

.dashboard-sidebar-action:active {
transform: translate3d(0, 0, 0) !important;
.dashboard-sidebar-collapsed .dashboard-sidebar-action:active {
transform: none !important;
}

.dashboard-sidebar-action-icon,
Expand All @@ -756,22 +758,36 @@
transition-timing-function: var(--ease-out-quart);
}

/* Expanded sidebar: SharedLayoutBg pill is the sole hover affordance.
No transform, no background — the pill handles everything. */
.dashboard-sidebar:not(.dashboard-sidebar-collapsed) .dashboard-sidebar-action:hover,
.dashboard-sidebar:not(.dashboard-sidebar-collapsed) .dashboard-sidebar-action:focus-visible {
background-color: transparent !important;
transform: none !important;
}

.dashboard-sidebar:not(.dashboard-sidebar-collapsed) .dashboard-sidebar-action:active {
transform: none !important;
}

.dashboard-sidebar:not(.dashboard-sidebar-collapsed) .dashboard-sidebar-action:hover .dashboard-sidebar-action-icon,
.dashboard-sidebar:not(.dashboard-sidebar-collapsed) .dashboard-sidebar-action:focus-visible .dashboard-sidebar-action-icon,
.dashboard-sidebar:not(.dashboard-sidebar-collapsed) .dashboard-sidebar-action:hover .dashboard-sidebar-action-label,
.dashboard-sidebar:not(.dashboard-sidebar-collapsed) .dashboard-sidebar-action:focus-visible .dashboard-sidebar-action-label {
transform: translate3d(4px, 0, 0) !important;
transform: none !important;
}

/* Active button hovered: show a slightly stronger lime tint instead of the zinc pill */
.dashboard-sidebar:not(.dashboard-sidebar-collapsed) .dashboard-sidebar-action[aria-current="page"]:hover,
.dashboard-sidebar:not(.dashboard-sidebar-collapsed) .dashboard-sidebar-action[aria-current="page"]:focus-visible {
background-color: oklch(30% 0.35 115 / 0.35) !important;
}

.dashboard-sidebar-tooltip:not(.dashboard-sidebar-action-label) {
display: none !important;
}

@media (min-width: 1024px) {
.dashboard-sidebar-collapsed .dashboard-sidebar-action:hover .dashboard-sidebar-action-icon,
.dashboard-sidebar-collapsed .dashboard-sidebar-action:focus-visible .dashboard-sidebar-action-icon {
transform: scale(1.12) !important;
}

.dashboard-sidebar-collapsed .dashboard-sidebar-tooltip {
position: absolute !important;
Expand Down
21 changes: 10 additions & 11 deletions src/client/components/features/dashboard/updates-email-prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,21 @@ export function UpdatesEmailPrompt() {

return (
<section className="surface overflow-hidden">
<div className="flex flex-col gap-4 px-4 py-4 sm:px-5 lg:flex-row lg:items-center lg:justify-between">
<div className="flex flex-col gap-4 px-4 py-4 sm:px-5 md:flex-row md:items-center md:justify-between md:gap-6">
<div className="flex min-w-0 items-start gap-3">
<span className="mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary">
<span className="mt-0.5 hidden sm:flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary">
<Mail size={16} strokeWidth={2.1} />
</span>
<div className="min-w-0">
<h2 className="text-sm font-semibold text-foreground">Get important Codra updates</h2>
<p className="mt-1 max-w-2xl text-sm text-muted-foreground">
Add an email for release notes, security fixes, and upgrade heads-up. You can opt out from any update email later. No spam.
<p className="mt-0.5 text-sm text-muted-foreground leading-relaxed">
Add an email for release notes, security fixes, and upgrade heads-up.{' '}
<span className="hidden sm:inline">You can opt out from any update email later. No spam.</span>
</p>
</div>
</div>

<form onSubmit={subscribe} className="flex min-w-0 flex-col gap-2 sm:flex-row sm:items-center lg:w-[31rem]">
<form onSubmit={subscribe} className="flex w-full min-w-0 flex-col gap-2 sm:flex-row sm:items-center md:w-auto md:shrink-0 md:basis-[26rem]">
<Input
type="email"
required
Expand All @@ -72,12 +73,10 @@ export function UpdatesEmailPrompt() {
className="h-9 min-w-0 flex-1"
aria-label="Email for Codra release updates"
/>
<div className="flex shrink-0 gap-2">
<Button type="submit" size="sm" disabled={submitting} className="flex-1 gap-2 sm:flex-none">
{submitting ? <RefreshCw size={13} className="animate-spin" /> : <Check size={13} />}
Save email
</Button>
</div>
<Button type="submit" size="sm" disabled={submitting} className="w-full gap-2 sm:w-auto sm:shrink-0">
{submitting ? <RefreshCw size={13} className="animate-spin" /> : <Check size={13} />}
Save email
</Button>
</form>
</div>
</section>
Expand Down
Loading
Loading