Skip to content

Add Curator Viewer dashboard starter UI#5

Merged
FallingZYJ merged 1 commit into
mainfrom
codex/2026-01-27create-file-organization-program
Jan 27, 2026
Merged

Add Curator Viewer dashboard starter UI#5
FallingZYJ merged 1 commit into
mainfrom
codex/2026-01-27create-file-organization-program

Conversation

@FallingZYJ
Copy link
Copy Markdown
Owner

Motivation

  • Provide a lightweight, TypeScript Next.js viewer UI to monitor Curator runs, cost projections, and dataset health in a compact dashboard layout.
  • Scaffold a frontend that can be extended to stream real-time run and dataset metadata from the Curator backend.

Description

  • Add a small Next.js TypeScript app under src/bespokelabs/curator/viewer/static including package.json, tsconfig.json, next.config.js, and next-env.d.ts to define the viewer project configuration.
  • Add page scaffolding in pages/_app.tsx and pages/index.tsx and two React components: components/Dashboard.tsx (metrics grid, operational overview, recent activity, and async data-load scaffold) and components/ErrorBoundary.tsx (React error boundary for the viewer).
  • Add dark-theme global CSS and component CSS modules in styles/* to style the dashboard and error UI.
  • Pin Next/React/TypeScript dev dependencies for the static viewer so it can be run locally with the provided npm scripts.

Testing

  • Ran npm install in viewer/static, which completed but emitted warnings and reported one critical vulnerability from the pinned dependencies.
  • Started the local dev server with npm run dev -- --hostname 0.0.0.0 --port 3000 and the Next dev server compiled and served the dashboard successfully.
  • Executed a Playwright script that loaded http://127.0.0.1:3000 and saved a screenshot to artifacts/curator-dashboard.png to validate the page renders.
  • No unit or automated backend tests were run for these UI-only changes.

Codex Task

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @FallingZYJ, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes the foundational user interface for the Curator Viewer, leveraging Next.js and TypeScript to create a lightweight, interactive dashboard. The primary goal is to provide a centralized view for monitoring Curator runs, cost projections, and dataset health, laying the groundwork for future enhancements like real-time data streaming.

Highlights

  • New Next.js Application: Introduces a new Next.js TypeScript application for the Curator Viewer dashboard, providing a dedicated frontend for monitoring.
  • Dashboard UI Components: Adds core React components: Dashboard.tsx for displaying key metrics, operational overview, and recent activity, and ErrorBoundary.tsx for robust error handling across the application.
  • Project Configuration & Scaffolding: Includes essential Next.js configuration files (package.json, tsconfig.json, next.config.js, next-env.d.ts) and basic page scaffolding (_app.tsx, index.tsx) to set up the project structure.
  • Dark Theme Styling: Implements a dark-theme aesthetic through global CSS and component-specific CSS modules, ensuring a consistent and modern visual experience for the dashboard.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@FallingZYJ FallingZYJ merged commit afc459a into main Jan 27, 2026
1 check passed
@FallingZYJ FallingZYJ deleted the codex/2026-01-27create-file-organization-program branch January 27, 2026 23:59
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a solid foundation for the Curator Viewer dashboard using Next.js and TypeScript. The code is clean, well-structured, and follows modern practices. My review includes a critical note on addressing a reported security vulnerability in the dependencies, and a couple of medium-severity suggestions for the Dashboard component to improve the data loading scaffold and optimize rendering performance. Once these points are addressed, this will be a great addition.

Comment thread src/bespokelabs/curator/viewer/static/package.json
Comment on lines +69 to +72
const refreshedData: DashboardData = {
metrics: DEFAULT_DASHBOARD_DATA.metrics,
activities: DEFAULT_DASHBOARD_DATA.activities
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This useEffect is intended as a scaffold for asynchronous data loading, but its current implementation is a bit confusing. It creates a new refreshedData object but reuses the same metrics and activities arrays from DEFAULT_DASHBOARD_DATA. Since the component state is already initialized with this data, this effect only triggers an unnecessary re-render without actually changing the data content.

To make this a more realistic and useful scaffold for fetching new data, I suggest creating a deep copy of the default data. This better simulates receiving a completely new data object from an API. The JSON.parse(JSON.stringify(...)) approach is a concise way to do this for serializable data.

        const refreshedData: DashboardData = JSON.parse(JSON.stringify(DEFAULT_DASHBOARD_DATA));

Comment on lines +150 to +158
{dashboardData.activities.map((activity) => (
<div key={activity.title} className={styles.activityItem}>
<div className={styles.activityText}>
<p className={styles.activityTitle}>{activity.title}</p>
<p className={styles.activityDescription}>{activity.description}</p>
</div>
<span className={styles.activityTimestamp}>{activity.timestamp}</span>
</div>
))}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For performance optimization and consistency with how metricCards is handled, I recommend memoizing this list of activity items using the useMemo hook. This will prevent the .map() function from running on every render of the Dashboard component, recalculating the list only when dashboardData.activities actually changes.

When mapping over arrays to create elements, it's important to use a stable and unique key. Here activity.title is used. This is acceptable if titles are guaranteed to be unique within the list. If the backend data provides a unique ID for each activity, using that would be more robust.

You can add this before the return statement:

const activityItems = useMemo(
  () =>
    dashboardData.activities.map((activity) => (
      <div key={activity.title} className={styles.activityItem}>
        <div className={styles.activityText}>
          <p className={styles.activityTitle}>{activity.title}</p>
          <p className={styles.activityDescription}>{activity.description}</p>
        </div>
        <span className={styles.activityTimestamp}>{activity.timestamp}</span>
      </div>
    )),
  [dashboardData.activities]
);

And then replace the current mapping with {activityItems}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant