Skip to content

feat(frontend): Template cards, a gallery rail, and a template detail page - #5774

Closed
ardaerzin wants to merge 1 commit into
oss/agents-pagefrom
oss/templates
Closed

feat(frontend): Template cards, a gallery rail, and a template detail page#5774
ardaerzin wants to merge 1 commit into
oss/agents-pagefrom
oss/templates

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

Context

Third app lane. Templates were a strip and a gallery with no detail view; a template's fields (instructions, providers, example session) had nowhere to render.

Changes

Template cards take the agent card shape, the gallery gets the detail page's rail, and a new detail page renders each template from the fields it declares: markdown instructions, provider marks, and an example session honestly labelled as an example. The six templates from the design get example sessions. The route is registered in OSS and EE (a page needs both files or it 404s in EE).

Tests / notes

  • @agenta/oss tsc adds nothing on this lane. The EE route is a re-export shim over the OSS page.

What to QA

  • Open the templates gallery, pick a template: the detail page shows the rail, markdown instructions, and the example session.
  • On EE, open the same template detail route: it renders (not 404).
  • Regression: creating an agent from a template still lands in the playground with the template applied.

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 6, 2026
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview Aug 6, 2026 9:00pm

Request Review

@dosubot dosubot Bot added the feature request New feature or request label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d0523df8-2501-4a7e-ace3-93b1e8e19fe3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added detailed pages for viewing agent templates, including metadata, integrations, triggers, example sessions, instructions, and available tools.
    • Added navigation from template cards to dedicated detail pages.
    • Added responsive sidebar navigation and category browsing for template galleries.
    • Added a “Use this template” action and not-found handling.
  • Style

    • Refined template cards, spacing, typography, hover states, and responsive grid layouts.

Walkthrough

The PR adds an agent-template detail page and route. The gallery now navigates to template details instead of opening the setup drawer. Template cards and grids use updated responsive layouts and spacing.

Changes

Agent template detail flow

Layer / File(s) Summary
Template detail rendering
web/oss/src/components/pages/agent-home/components/TemplateDetail/index.tsx
Adds template lookup, empty-state handling, navigation, agent creation routing, metadata, integrations, triggers, example sessions, instructions, and tools.
Template detail route wiring
web/oss/src/pages/w/[workspace_id]/p/[project_id]/apps/agent-templates/[template_key].tsx, web/ee/src/pages/w/[workspace_id]/p/[project_id]/apps/agent-templates/[template_key].tsx
Adds the OSS dynamic route and re-exports it from the EE route.
Gallery navigation and layout
web/oss/src/components/pages/agent-home/components/TemplatesGallery/index.tsx
Navigates selected templates to detail routes and replaces the centered rail with a sidebar and scrollable content area.
Template card presentation
web/oss/src/components/pages/agent-home/components/TemplatesSection/TemplateCard.tsx, web/oss/src/components/pages/agent-home/components/TemplatesSection/index.tsx, web/oss/src/components/pages/agent-home/components/TemplatesGallery/TemplateSection.tsx
Updates card styling, metadata placement, grid spacing, and row sizing.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TemplatesGallery
  participant TemplateDetailPage
  participant TemplateDetail
  TemplatesGallery->>TemplateDetailPage: navigate with template key
  TemplateDetailPage->>TemplateDetail: pass normalized template key
  TemplateDetail->>TemplateDetail: resolve and render template details
  TemplateDetail-->>TemplatesGallery: provide detail view and actions
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main frontend changes: template cards, a gallery rail, and a template detail page.
Description check ✅ Passed The description directly explains the template detail page, gallery changes, route registration, example sessions, and regression expectations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 60.00%.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch oss/templates

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.

@dosubot dosubot Bot added the frontend label Aug 6, 2026
@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (7)
web/oss/src/components/pages/agent-home/components/TemplateDetail/index.tsx (3)

1-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Verify that React.ReactNode resolves without a React import.

SectionLabel uses the React namespace type at line 12, but the file does not import React. This compiles only if the TypeScript config permits UMD global access or the project ships a React global type shim. Import the type explicitly to remove the dependency on that setting.

🔧 Proposed fix
+import type {ReactNode} from "react"
+
-const SectionLabel = ({children}: {children: React.ReactNode}) => (
+const SectionLabel = ({children}: {children: ReactNode}) => (
#!/bin/bash
# Check tsconfig settings and whether other files rely on the bare React namespace without importing React.
fd -H -t f 'tsconfig*.json' web | while read -r f; do
  echo "== $f"
  jq '.compilerOptions | {jsx, allowUmdGlobalAccess, types, strict}' "$f" 2>/dev/null || cat "$f"
done

# Find other component files that use React.<Type> but never import React.
rg -l --type=tsx 'React\.' web/oss/src/components | while read -r f; do
  rg -q '^import .*\bReact\b' "$f" || echo "no React import: $f"
done

46-48: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Shorten the inline layout comments.

These three comments explain visual intent over multiple lines. Reduce each to one short line.

As per coding guidelines: "Keep in-code comments to at most one short line; use longer comments only for genuinely surprising constraints such as bugs, races, or ordering requirements."

Also applies to: 177-178, 188-191

Source: Coding guidelines


78-87: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Encode the template key in the query string.

template.key goes straight into the URL. If a key ever contains &, #, or a space, the query breaks. Use encodeURIComponent.

🔧 Proposed fix
-                        onClick={() =>
-                            void router.push(`${baseAppURL}?new=1&template=${template.key}`)
-                        }
+                        onClick={() =>
+                            void router.push(
+                                `${baseAppURL}?new=1&template=${encodeURIComponent(template.key)}`,
+                            )
+                        }
web/oss/src/pages/w/[workspace_id]/p/[project_id]/apps/agent-templates/[template_key].tsx (1)

9-16: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider a loading state while the router hydrates.

On the first client render of a dynamic route, query.template_key is undefined, so the page renders null. The page then swaps to content. Render a skeleton or a PageLayout shell instead to avoid the blank frame. Use router.isReady to distinguish "not hydrated" from "missing key".

web/oss/src/components/pages/agent-home/components/TemplatesGallery/index.tsx (1)

95-104: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the now-dead setup-drawer path.

handleSelectTemplate navigates to the detail route and no longer sets setupTemplate. setSetupTemplate is called only with null (lines 109 and 218), so setupTemplate stays null forever. As a result:

  • TemplateSetupDrawer at lines 215-220 always renders with template={null} and open={false}.
  • handleTemplateCreate at lines 107-113 is unreachable, and message from App.useApp() at line 36 becomes unused.

The comment at lines 95-96 also still describes the removed builder-mode and setup-drawer behavior.

Remove the drawer, the state, and the callback, or state explicitly why the drawer must stay mounted.

♻️ Proposed cleanup
-    // Template card click: builder mode → straight to a seeded playground; else open the setup
-    // drawer. Gated by NEXT_PUBLIC_AGENT_TEMPLATE_BUILDER.
-    const [setupTemplate, setSetupTemplate] = useState<AgentTemplate | null>(null)
-    // A card opens the template rather than creating from it: the detail page is where you find
-    // out what it needs before committing, which is the point of having one.
+    // A card opens the template detail page instead of creating from it.
     const handleSelectTemplate = useCallback(
         (template: AgentTemplate) =>
             void router.push(`${baseAppURL}/agent-templates/${template.key}`),
         [router, baseAppURL],
     )
-
-    // TODO(Phase B): create the ephemeral draft from the template + open the playground.
-    const handleTemplateCreate = useCallback(
-        ({template, name}: TemplateSetupResult) => {
-            setSetupTemplate(null)
-            message.info(`Create "${name}" from ${template.name} — wiring in the next phase`)
-        },
-        [message],
-    )

Then remove the TemplateSetupDrawer block at lines 215-220, the TemplateSetupDrawer import at line 22, and the App usage at line 36.

web/oss/src/components/pages/agent-home/components/TemplatesSection/TemplateCard.tsx (2)

10-17: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Shorten the doc comment.

This comment is eight lines of design rationale. Reduce it to one short line.

📝 Proposed replacement
-/**
- * A template, in the same card shape an agent uses.
- *
- * A template IS an agent you haven't made yet, so the two read as one object type: monogram
- * straddling the top edge, name, description, then a footer of the connections it needs. The
- * design's "1.2k uses" has no telemetry behind it — the footer carries what the template actually
- * declares (its tools and when it fires) instead of an invented popularity number.
- */
+/** A template rendered in the same card shape as an agent. */

As per coding guidelines: "Keep in-code comments to at most one short line; use longer comments only for genuinely surprising constraints such as bugs, races, or ordering requirements."

Source: Coding guidelines


23-23: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the unused group class.

The card sets group, but no descendant uses a group-hover: or group-focus: variant. Drop it, or add the intended variant styles.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 09669b44-a28f-4c78-8d35-f236b1524daa

📥 Commits

Reviewing files that changed from the base of the PR and between eb04b4b and 5efd846.

📒 Files selected for processing (7)
  • web/ee/src/pages/w/[workspace_id]/p/[project_id]/apps/agent-templates/[template_key].tsx
  • web/oss/src/components/pages/agent-home/components/TemplateDetail/index.tsx
  • web/oss/src/components/pages/agent-home/components/TemplatesGallery/TemplateSection.tsx
  • web/oss/src/components/pages/agent-home/components/TemplatesGallery/index.tsx
  • web/oss/src/components/pages/agent-home/components/TemplatesSection/TemplateCard.tsx
  • web/oss/src/components/pages/agent-home/components/TemplatesSection/index.tsx
  • web/oss/src/pages/w/[workspace_id]/p/[project_id]/apps/agent-templates/[template_key].tsx

Comment thread web/oss/src/components/pages/agent-home/components/TemplatesGallery/index.tsx Outdated
@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 (1)
web/oss/src/components/pages/agent-home/components/TemplateDetail/index.tsx (1)

46-48: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Keep normal implementation rationale out of multi-line comments.

  • web/oss/src/components/pages/agent-home/components/TemplateDetail/index.tsx#L46-L48: Remove the layout rationale or reduce it to one short line.
  • web/oss/src/components/pages/agent-home/components/TemplateDetail/index.tsx#L188-L191: Remove the Markdown rendering rationale or reduce it to one short line.

As per coding guidelines: "Keep in-code comments to at most one short line; use longer comments only for genuinely surprising constraints such as bugs, races, or ordering requirements."

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0c6d4035-2eec-4cac-82a6-5eb9526c67a4

📥 Commits

Reviewing files that changed from the base of the PR and between 39f787a and d1e4ec9.

📒 Files selected for processing (7)
  • web/ee/src/pages/w/[workspace_id]/p/[project_id]/apps/agent-templates/[template_key].tsx
  • web/oss/src/components/pages/agent-home/components/TemplateDetail/index.tsx
  • web/oss/src/components/pages/agent-home/components/TemplatesGallery/TemplateSection.tsx
  • web/oss/src/components/pages/agent-home/components/TemplatesGallery/index.tsx
  • web/oss/src/components/pages/agent-home/components/TemplatesSection/TemplateCard.tsx
  • web/oss/src/components/pages/agent-home/components/TemplatesSection/index.tsx
  • web/oss/src/pages/w/[workspace_id]/p/[project_id]/apps/agent-templates/[template_key].tsx
🚧 Files skipped from review as they are similar to previous changes (6)
  • web/ee/src/pages/w/[workspace_id]/p/[project_id]/apps/agent-templates/[template_key].tsx
  • web/oss/src/components/pages/agent-home/components/TemplatesGallery/TemplateSection.tsx
  • web/oss/src/components/pages/agent-home/components/TemplatesSection/index.tsx
  • web/oss/src/components/pages/agent-home/components/TemplatesSection/TemplateCard.tsx
  • web/oss/src/pages/w/[workspace_id]/p/[project_id]/apps/agent-templates/[template_key].tsx
  • web/oss/src/components/pages/agent-home/components/TemplatesGallery/index.tsx

… page

Template cards take the agent card shape, the gallery gets the detail page's rail, and a detail page renders each template from the fields it declares — example session included, honestly labelled. The route is registered in OSS and EE so neither edition 404s.
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 9, 2026
@mmabrouk

mmabrouk commented Aug 9, 2026

Copy link
Copy Markdown
Member

Landed in release/v0.112.0 as part of the 0.112.0 release. The release branch now contains this work at commit ae71a92. Closing here since there is nothing left to merge.

@mmabrouk mmabrouk closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request frontend lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants