Skip to content

Conversation

@owtaylor
Copy link
Contributor

This pull request includes the following changes:

  • Refactors the code to utilize context for metrics and sample manifest.

This addresses the issue described in issue #1.

@owtaylor owtaylor force-pushed the owtaylor/context-hooks branch from 897a889 to 27d58e5 Compare June 11, 2025 18:37
Copy link
Contributor Author

@owtaylor owtaylor left a comment

Choose a reason for hiding this comment

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

Generally looks good, a few things could be improved (talking to agent rather than myself)

const newStore = await fetchMetrics();
setStore(newStore);
} catch (error) {
console.log("Error loading metrics", error);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's add an error?: string field to MetricsStore and Manifest so that the web page can display an error rather than just being stuck in a loading state.

Copy link
Contributor Author

@owtaylor owtaylor Jun 12, 2025

Choose a reason for hiding this comment

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

And please make the pages display the errors rather than content if the error fields are set

import { createContext, useContext, useEffect, useState } from "react";
import { BASE } from "../site";

interface Manifest {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please rename this to SampleManifest

postprocessors: string[];
}

const emptyManifest: Manifest = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is no point to this since useSampleManifest() returns Manifest | undefined - we can just use undefined.

owtaylor added a commit that referenced this pull request Jun 12, 2025
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.

2 participants