Skip to content

feat: redesign share dialog, OG image, agent chart - #2243

Merged
smakosh merged 6 commits into
mainfrom
feat/share-redesign-and-agent-chart
May 10, 2026
Merged

smakosh merged 6 commits into
mainfrom
feat/share-redesign-and-agent-chart

Conversation

@smakosh

@smakosh smakosh commented May 10, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Playground share dialog: redesigned to match the LLM Gateway theme — larger heading, prompt preview card, truncated https://chat.llmgateway.io/share/… URL pill, and a row of social share buttons (Copy / X / LinkedIn / Reddit) similar to ChatGPT's share modal. Mobile responsive.
  • Dynamic OG image for /share/[shareId] (opengraph-image.tsx): uses the LLM Gateway logo, the shared chat title/prompt as the headline, and a small response preview card. generateMetadata now also fetches the share to set per-share title / description and twitter:summary_large_image.
  • DevPass agent detail: new AgentModelUsageChart component shows a stacked Model Usage Overview chart (matching the apps/ui chart) with a metric switcher (Requests / Cost / Tokens) and a 1h / 4h / 1d / 7d / 30d range picker. Wired in above the existing model usage table on the agent detail view.

Test plan

  • Open a chat in the playground, share it, confirm the dialog renders correctly on mobile and desktop, and that the URL is visibly truncated.
  • Verify Copy / X / LinkedIn / Reddit buttons open the correct share targets.
  • Visit a /share/[shareId] URL and confirm the OG image loads with the prompt + response preview + LLM Gateway branding.
  • In DevPass dashboard, open a Coding Agent's detail view and confirm the new chart renders with the time-range buttons and metric dropdown working.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Agent model usage chart in agent details with selectable ranges/metrics and stacked model breakdown.
    • OpenGraph image generation for shared chats and enriched share dialog with social buttons (X, LinkedIn, Reddit) and copyable truncated URL.
    • New styled Select UI component.
  • Improvements

    • Dynamic shared-chat metadata and preview prompt derived from chat content.
    • Collapsible DevPass card with persisted collapsed state and updated dashboard behavior.
    • Admin KPIs now include cancelling-but-still-active subscribers.

Review Change Stack

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 10, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3040c23d-cb7b-426d-b377-06af8195593c

📥 Commits

Reviewing files that changed from the base of the PR and between ac74c21 and 7653c55.

📒 Files selected for processing (3)
  • apps/api/src/routes/admin.ts
  • ee/admin/src/app/devpass/page.tsx
  • packages/db/src/seed.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/db/src/seed.ts

Walkthrough

Adds a stacked AgentModelUsageChart to the dashboard (selectable ranges/metrics, buckets logs into slots, aggregates per-model metrics) and enhances shared chat pages with dynamic metadata, a 1200x630 OpenGraph image endpoint, and a redesigned share dialog including truncated URL display, copy and social share buttons (X, LinkedIn, Reddit).

Changes

Agent Model Usage Chart

Layer / File(s) Summary
Chart Setup & Time Range Helpers
apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx
Client module, time-range constants (1h,4h,24h,7d,30d), metric options, color palette, and slot/key formatting helpers.
Data Aggregation
apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx
buildChartData() initializes slot rows, buckets logs into hourly/daily slots, and aggregates per-slot and per-model request/cost/token counts; orders models by total cost.
Tooltip & Formatting
apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx
Custom tooltip formats slot totals and per-model breakdown filtered to positive values with metric-specific formatting.
Chart Component & Data Fetch
apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx
Component state for range/metric, computes query params, fetches /logs via useApi, and builds chart rows and subtitle.
Bar Chart Rendering
apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx
Configures Recharts axes/ticks, attaches custom tooltip, and renders stacked Bar per model with consistent colors and rounded top corners.
Dashboard Integration
apps/code/src/app/dashboard/components/CodingAgents.tsx
Imports and renders AgentModelUsageChart inside AgentDetail above the ModelUsageBreakdown table.

Share Chat Social Features & Metadata

Layer / File(s) Summary
Page Metadata Contracts
apps/playground/src/app/share/[shareId]/page.tsx
generateMetadata() fetches shared chat snapshot (no-store), derives normalized/truncated title/description, and returns expanded Metadata including alternates.canonical, openGraph, and twitter.
OpenGraph Image Endpoint
apps/playground/src/app/share/[shareId]/opengraph-image.tsx
Adds ShareOgImage endpoint with helpers to normalize/clip text, fetch snapshot (no-store), and render a styled 1200x630 PNG ImageResponse with an error fallback.
Share Dialog Props Contract
apps/playground/src/components/playground/chat-header.tsx, apps/playground/src/components/playground/share-chat-dialog.tsx
Extends ChatHeaderProps and ShareChatDialogProps with optional chatTitle and previewPrompt; ChatHeader passes these to ShareChatDialog.
Share Dialog Data Extraction
apps/playground/src/components/playground/chat-page-client.tsx
Adds getFirstUserMessageText() to extract the first user message text as a preview and passes it (plus chat title) into ChatHeader.
Share Dialog UI & Social Sharing
apps/playground/src/components/playground/share-chat-dialog.tsx
Adds truncateShareUrl and clipPreview helpers, inline XIcon/RedditIcon SVGs, a reusable ShareSocialButton, and reworks dialog body to show preview card, truncated share URL with copy action, social share buttons (X, LinkedIn, Reddit), and create/delete actions rendered in-content with loading states.

Radix Select Wrapper

Layer / File(s) Summary
Select Primitives & Trigger
apps/code/src/components/ui/select.tsx
Adds Select, SelectGroup, SelectValue, and SelectTrigger with a size prop and chevron icon support.
Content, Items & Scrolling
apps/code/src/components/ui/select.tsx
Implements SelectContent inside a Portal, adds SelectLabel, SelectItem with ItemIndicator, SelectSeparator, and scroll up/down buttons/wrappers.

DevPass Card & Dashboard Wiring

Layer / File(s) Summary
Page Cookie Read & Prop Pass
apps/ui/src/app/dashboard/[orgId]/[projectId]/page.tsx
Reads DEVPASS_CARD_COLLAPSED_COOKIE via cookies() and computes initialDevPassCollapsed, passing it into DashboardClient.
DashboardClient Prop & DevPass Propagation
apps/ui/src/components/dashboard/dashboard-client.tsx
Adds initialDevPassCollapsed to DashboardClientProps and forwards it to DevPassCard as defaultCollapsed.
DevPass Card Collapsible UI
apps/ui/src/components/dashboard/devpass-card.tsx, apps/ui/src/lib/cookies.ts
Refactors DevPassCard to accept defaultCollapsed, track internal collapsed state, toggle and persist cookie (1-year max-age), and render collapsed/expanded UI without a top-level link wrapper.

DevPass Seed: Weighted Models

Layer / File(s) Summary
Seed Data Restructure & Selection
packages/db/src/seed.ts
Refactors DEVPASS_AGENTS to include weighted models arrays per agent, introduces DevpassAgentModel type, and selects a model via weightedRandomChoice(agent.models) during log seeding.

Admin KPI & EE UI

Layer / File(s) Summary
KPI Comment & Query
apps/api/src/routes/admin.ts
Expands KPI comment and removes devPlanCancelled = false from activeRows query so cancelled-but-not-expired DevPass subscriptions are included in the active base.
EE Admin UI
ee/admin/src/app/devpass/page.tsx
Conditionally renders kpis.cancelledPending as an amber “X cancelling” indicator when > 0 in the Active subscribers KPI card.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • steebchen-bot
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the three main changes: share dialog redesign, OG image implementation, and agent chart addition. It is concise, specific, and directly relates to the primary objectives of the PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/share-redesign-and-agent-chart

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
apps/playground/src/components/playground/share-chat-dialog.tsx (1)

39-57: ⚡ Quick win

Simplify URL truncation logic.

The truncateShareUrl function has complexity that may not be necessary. The condition on line 49 compares prefix.length > URL_DISPLAY_PREFIX.length, but since URL_DISPLAY_PREFIX is a constant defined above, this logic could be simplified. The current implementation extracts the origin and path segments, then conditionally replaces the prefix—but for this use case, a direct string manipulation approach might be clearer.

Consider simplifying to directly format the display URL:

 function truncateShareUrl(url: string): string {
-	if (!url) {
-		return "";
-	}
-	try {
-		const parsed = new URL(url);
-		const segments = parsed.pathname.split("/").filter(Boolean);
-		const last = segments[segments.length - 1] ?? "";
-		const prefix = `${parsed.origin}/${segments.slice(0, -1).join("/")}/`;
-		const visiblePrefix =
-			prefix.length > URL_DISPLAY_PREFIX.length
-				? URL_DISPLAY_PREFIX
-				: prefix.replace(/\/+$/, "/");
-		const shortId = last.length > 8 ? `${last.slice(0, 6)}…` : last;
-		return `${visiblePrefix}${shortId}`;
-	} catch {
-		return url.length > 40 ? `${url.slice(0, 37)}…` : url;
-	}
+	if (!url) {
+		return "";
+	}
+	const shareIdMatch = url.match(/\/share\/([^/?#]+)/);
+	if (!shareIdMatch) {
+		return url.length > 40 ? `${url.slice(0, 37)}…` : url;
+	}
+	const shareId = shareIdMatch[1];
+	const shortId = shareId.length > 8 ? `${shareId.slice(0, 6)}…` : shareId;
+	return `${URL_DISPLAY_PREFIX}${shortId}`;
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/playground/src/components/playground/share-chat-dialog.tsx` around lines
39 - 57, The truncateShareUrl function contains overcomplicated prefix logic;
simplify it by parsing the URL with new URL(url), extracting the origin and last
path segment (use parsed.pathname.split("/").filter(Boolean) to get last),
compute shortId as last.length > 8 ? `${last.slice(0,6)}…` : last, then build a
displayPrefix as `${parsed.origin}/${segments.slice(0,-1).join("/")}/` and clamp
it to URL_DISPLAY_PREFIX by using a simple length check to replace with
URL_DISPLAY_PREFIX when longer (remove the regex trim/replace step), and finally
return `${displayPrefix}${shortId}`; keep the existing catch fallback that
truncates non-URLs to 40 chars. Use the existing symbols truncateShareUrl,
URL_DISPLAY_PREFIX, parsed, segments, last, and shortId to locate and update the
code.
apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx (1)

295-296: 💤 Low value

useMemo with new Date() creates confusion.

The endDate memo captures "now" only when range changes, not continuously. While this works with the current staleTime setting, it's misleading because new Date() is non-deterministic and the dependency on range doesn't reflect a true data dependency—it's a side effect to trigger refetches.

Consider removing the useMemo entirely (let endDate always be current) or using TanStack Query's refetch intervals if you need periodic updates.

♻️ Proposed refactor: remove useMemo
 	const api = useApi();
 	const startDate = useMemo(() => getRangeStart(range).toISOString(), [range]);
-	// eslint-disable-next-line react-hooks/exhaustive-deps
-	const endDate = useMemo(() => new Date().toISOString(), [range]);
+	const endDate = new Date().toISOString();
 	const sourceParam = sources.join(",");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx` around lines
295 - 296, The current useMemo for endDate inside AgentModelUsageChart is
misleading because new Date() is non-deterministic and only updates when range
changes; remove the useMemo and make endDate computed directly (const endDate =
new Date().toISOString()) so it always reflects "now", or if you need periodic
updates instead of on-render, configure the data fetch with TanStack Query's
refetchInterval rather than relying on useMemo; update any references to endDate
accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx`:
- Around line 189-192: The current aggregation in modelTotals.set(modelId,
(modelTotals.get(modelId) ?? 0) + cost + tokens + 1) mixes incompatible units
(cost, tokens, and a count); change the metric to a single meaningful value —
e.g., aggregate by total cost only — by replacing the summed expression with
just cost (or a normalized weighted combination if you prefer) and update any
related variable names/labels/comments (e.g., modelTotals, modelId, cost,
tokens) so the chart/sort uses total cost as the sorting metric.

---

Nitpick comments:
In `@apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx`:
- Around line 295-296: The current useMemo for endDate inside
AgentModelUsageChart is misleading because new Date() is non-deterministic and
only updates when range changes; remove the useMemo and make endDate computed
directly (const endDate = new Date().toISOString()) so it always reflects "now",
or if you need periodic updates instead of on-render, configure the data fetch
with TanStack Query's refetchInterval rather than relying on useMemo; update any
references to endDate accordingly.

In `@apps/playground/src/components/playground/share-chat-dialog.tsx`:
- Around line 39-57: The truncateShareUrl function contains overcomplicated
prefix logic; simplify it by parsing the URL with new URL(url), extracting the
origin and last path segment (use parsed.pathname.split("/").filter(Boolean) to
get last), compute shortId as last.length > 8 ? `${last.slice(0,6)}…` : last,
then build a displayPrefix as
`${parsed.origin}/${segments.slice(0,-1).join("/")}/` and clamp it to
URL_DISPLAY_PREFIX by using a simple length check to replace with
URL_DISPLAY_PREFIX when longer (remove the regex trim/replace step), and finally
return `${displayPrefix}${shortId}`; keep the existing catch fallback that
truncates non-URLs to 40 chars. Use the existing symbols truncateShareUrl,
URL_DISPLAY_PREFIX, parsed, segments, last, and shortId to locate and update the
code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c7dfe4fa-0f1e-41f0-9b40-cdd31bb89de1

📥 Commits

Reviewing files that changed from the base of the PR and between ab5a8a2 and 595e8ab.

📒 Files selected for processing (7)
  • apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx
  • apps/code/src/app/dashboard/components/CodingAgents.tsx
  • apps/playground/src/app/share/[shareId]/opengraph-image.tsx
  • apps/playground/src/app/share/[shareId]/page.tsx
  • apps/playground/src/components/playground/chat-header.tsx
  • apps/playground/src/components/playground/chat-page-client.tsx
  • apps/playground/src/components/playground/share-chat-dialog.tsx

Comment thread apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx Outdated
@smakosh smakosh self-assigned this May 10, 2026
smakosh and others added 2 commits May 10, 2026 14:09
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
apps/playground/src/components/playground/share-chat-dialog.tsx (1)

39-57: ⚡ Quick win

Consider clarifying the prefix selection logic.

The condition at lines 49-52 uses string length comparison to decide between showing the canonical llmgateway.io prefix versus the actual URL origin. While functional, the intent is not immediately clear—you're using length as a proxy for "should we display branded canonical URL."

A more explicit approach would improve maintainability:

♻️ Clearer alternative using explicit domain check
-	const displayPrefix =
-		builtPrefix.length > URL_DISPLAY_PREFIX.length
-			? URL_DISPLAY_PREFIX
-			: builtPrefix;
+	// Show canonical branding for production URLs, actual origin for dev/localhost
+	const displayPrefix =
+		parsed.origin === "https://chat.llmgateway.io"
+			? URL_DISPLAY_PREFIX
+			: builtPrefix;

Or, if the length-based heuristic is intentional for flexibility:

+	// Use canonical prefix when actual origin is longer (for consistent branding)
 	const displayPrefix =
 		builtPrefix.length > URL_DISPLAY_PREFIX.length
 			? URL_DISPLAY_PREFIX
 			: builtPrefix;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/playground/src/components/playground/share-chat-dialog.tsx` around lines
39 - 57, The prefix selection in truncateShareUrl is unclear: instead of using
builtPrefix.length > URL_DISPLAY_PREFIX.length to choose between parsed.origin
and URL_DISPLAY_PREFIX, make the intent explicit by checking parsed.origin (or
parsed.hostname) against an allowed/canonical domain list (or by testing
startsWith the branded domain) and use that to select displayPrefix, or add a
concise comment explaining the length-based heuristic; update truncateShareUrl
and reference URL_DISPLAY_PREFIX and parsed.origin/hostname so the logic is
readable and maintainable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/playground/src/components/playground/share-chat-dialog.tsx`:
- Around line 39-57: The prefix selection in truncateShareUrl is unclear:
instead of using builtPrefix.length > URL_DISPLAY_PREFIX.length to choose
between parsed.origin and URL_DISPLAY_PREFIX, make the intent explicit by
checking parsed.origin (or parsed.hostname) against an allowed/canonical domain
list (or by testing startsWith the branded domain) and use that to select
displayPrefix, or add a concise comment explaining the length-based heuristic;
update truncateShareUrl and reference URL_DISPLAY_PREFIX and
parsed.origin/hostname so the logic is readable and maintainable.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9e2b7537-c69f-4721-9964-f1a428baf05f

📥 Commits

Reviewing files that changed from the base of the PR and between 595e8ab and cda0829.

📒 Files selected for processing (2)
  • apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx
  • apps/playground/src/components/playground/share-chat-dialog.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx

smakosh and others added 2 commits May 10, 2026 14:46
@smakosh
smakosh enabled auto-merge May 10, 2026 12:50

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
packages/db/src/seed.ts (1)

1286-1290: ⚡ Quick win

Encode non-empty models at the type level

Line 1289 allows models: DevpassAgentModel[], but Line 1474 assumes non-empty input. Tighten the type to prevent accidental empty arrays and runtime failures.

Suggested fix
-	const DEVPASS_AGENTS: Array<{
+	const DEVPASS_AGENTS: Array<{
 		source: string;
 		weight: number;
-		models: DevpassAgentModel[];
+		models: [DevpassAgentModel, ...DevpassAgentModel[]];
 	}> = [

Also applies to: 1474-1474

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/db/src/seed.ts` around lines 1286 - 1290, The DEVPASS_AGENTS
declaration currently types models as DevpassAgentModel[] but some consumers
(e.g., the code referencing DEVPASS_AGENTS around the logic that expects at
least one model) assume a non-empty array; tighten the type to a required
non-empty tuple type (e.g., [DevpassAgentModel, ...DevpassAgentModel[]]) for the
models property in the DEVPASS_AGENTS element type so the compiler prevents
empty arrays and update any related signatures or callers if needed (refer to
DEVPASS_AGENTS and DevpassAgentModel to locate the change).
apps/ui/src/components/dashboard/devpass-card.tsx (1)

28-33: ⚡ Quick win

Consider adding the secure flag to the cookie in production.

The cookie is set without the secure flag, which means it can be transmitted over HTTP. For a UI preference cookie this is low-risk, but adding secure when running over HTTPS follows security best practices and prevents potential downgrade attacks.

🔒 Proposed enhancement
 const toggle = () => {
   const next = !collapsed;
   setCollapsed(next);
   const maxAge = 60 * 60 * 24 * 365;
-  document.cookie = `${DEVPASS_CARD_COLLAPSED_COOKIE}=${next ? "1" : "0"}; path=/; max-age=${maxAge}; samesite=lax`;
+  const isSecure = window.location.protocol === 'https:';
+  const secure = isSecure ? '; secure' : '';
+  document.cookie = `${DEVPASS_CARD_COLLAPSED_COOKIE}=${next ? "1" : "0"}; path=/; max-age=${maxAge}; samesite=lax${secure}`;
 };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/ui/src/components/dashboard/devpass-card.tsx` around lines 28 - 33, The
cookie written in toggle (uses collapsed, setCollapsed,
DEVPASS_CARD_COLLAPSED_COOKIE) lacks the secure flag; update the document.cookie
assignment to append "; secure" when running over HTTPS (e.g., check
window.location.protocol === "https:" or NODE_ENV === "production") so the
cookie is only sent over TLS in production, preserving the existing path,
max-age, and samesite attributes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/db/src/seed.ts`:
- Around line 1475-1476: The lookup for modelDef currently matches only on model
id which can pick the wrong provider's entry; update the find on MODELS used to
set modelDef to match both model and provider (e.g., m.model ===
agentModel.model && m.provider === agentModel.provider) so seeded metrics use
the correct usedProvider/cost data, keeping the existing fallback to MODELS[0]
if no exact match is found.

---

Nitpick comments:
In `@apps/ui/src/components/dashboard/devpass-card.tsx`:
- Around line 28-33: The cookie written in toggle (uses collapsed, setCollapsed,
DEVPASS_CARD_COLLAPSED_COOKIE) lacks the secure flag; update the document.cookie
assignment to append "; secure" when running over HTTPS (e.g., check
window.location.protocol === "https:" or NODE_ENV === "production") so the
cookie is only sent over TLS in production, preserving the existing path,
max-age, and samesite attributes.

In `@packages/db/src/seed.ts`:
- Around line 1286-1290: The DEVPASS_AGENTS declaration currently types models
as DevpassAgentModel[] but some consumers (e.g., the code referencing
DEVPASS_AGENTS around the logic that expects at least one model) assume a
non-empty array; tighten the type to a required non-empty tuple type (e.g.,
[DevpassAgentModel, ...DevpassAgentModel[]]) for the models property in the
DEVPASS_AGENTS element type so the compiler prevents empty arrays and update any
related signatures or callers if needed (refer to DEVPASS_AGENTS and
DevpassAgentModel to locate the change).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d8d39199-0bf6-4dac-a400-af0420bd92ba

📥 Commits

Reviewing files that changed from the base of the PR and between cda0829 and ac74c21.

📒 Files selected for processing (7)
  • apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx
  • apps/code/src/components/ui/select.tsx
  • apps/ui/src/app/dashboard/[orgId]/[projectId]/page.tsx
  • apps/ui/src/components/dashboard/dashboard-client.tsx
  • apps/ui/src/components/dashboard/devpass-card.tsx
  • apps/ui/src/lib/cookies.ts
  • packages/db/src/seed.ts
✅ Files skipped from review due to trivial changes (2)
  • apps/code/src/components/ui/select.tsx
  • apps/ui/src/lib/cookies.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/code/src/app/dashboard/components/AgentModelUsageChart.tsx

Comment thread packages/db/src/seed.ts Outdated
@smakosh
smakosh added this pull request to the merge queue May 10, 2026
@smakosh
smakosh removed this pull request from the merge queue due to a manual request May 10, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@smakosh
smakosh enabled auto-merge May 10, 2026 13:17
@smakosh
smakosh added this pull request to the merge queue May 10, 2026
Merged via the queue into main with commit 72ef12f May 10, 2026
12 checks passed
@smakosh
smakosh deleted the feat/share-redesign-and-agent-chart branch May 10, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant