Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #51: Task 7 (Trial 2): Remove performance analysis components from regression analysis view #52

Closed
wants to merge 2 commits into from
Closed
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: 1 addition & 1 deletion src/components/RegressionMockup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default function RegressionMockup() {

return (
<div key={index} className="mb-8 p-4 border rounded-lg">
<OriginDisplay summary={summary} />
<OriginDisplay summary={summary} isRegressionView={true} />

{summary.commitScreenShot && (
<div className="mt-4">
Expand Down
21 changes: 13 additions & 8 deletions src/components/performance/OriginDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import { ExpandableSection } from "@/pageComponents/team/id/runs/ExpandableSecti

interface OriginDisplayProps {
summary: OriginSummary;
isRegressionView?: boolean;
}

export function OriginDisplay(props: OriginDisplayProps) {
const { summary } = props;
const { summary, isRegressionView = false } = props;

const steps = useMemo(() => {
// Fixup the dependency steps to paper over some unknown
Expand Down Expand Up @@ -82,13 +83,17 @@ export function OriginDisplay(props: OriginDisplayProps) {

return (
<div className="m-2 gap-4 px-4 py-2 bg-slate-800 hover:bg-slate-700 text-white rounded-lg">
<OriginSummaryDisplay summary={summary}></OriginSummaryDisplay>
<ExpandableSection
grow={false}
label={<h4 className="text-2xl font-bold">Detailed Steps</h4>}
>
<ul>{timelineEntries}</ul>
</ExpandableSection>
{!isRegressionView && (
<>
<OriginSummaryDisplay summary={summary}></OriginSummaryDisplay>
<ExpandableSection
grow={false}
label={<h4 className="text-2xl font-bold">Detailed Steps</h4>}
>
<ul>{timelineEntries}</ul>
</ExpandableSection>
</>
)}
</div>
);
}
7 changes: 6 additions & 1 deletion src/components/performance/OriginSummaryDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ function getOriginTitle(origin: DependencyChainOrigin) {

interface OriginSummaryProps {
summary: OriginSummary;
isRegressionView?: boolean;
}

export function OriginSummaryDisplay(props: OriginSummaryProps) {
const { summary } = props;
const { summary, isRegressionView = false } = props;

const {
startTime,
Expand Down Expand Up @@ -72,6 +73,10 @@ export function OriginSummaryDisplay(props: OriginSummaryProps) {

const otherTime = workerThreadTime + timerTime + unknownTime;

if (isRegressionView) {
return null;
}

return (
<>
<h3 className="text-4xl font-bold">{title}</h3>
Expand Down
Loading