Skip to content

Assessment Flow (Middle Section - minimal intro and outro)#271

Merged
LOTaher merged 21 commits into
mainfrom
261/assessment-flow
Apr 3, 2026
Merged

Assessment Flow (Middle Section - minimal intro and outro)#271
LOTaher merged 21 commits into
mainfrom
261/assessment-flow

Conversation

@bderbs30
Copy link
Copy Markdown
Collaborator

@bderbs30 bderbs30 commented Apr 1, 2026

Changes

Created the assessment flow (mainly the middle section but added a simple intro and outro part)

  • Currently, we don't have text sections, so the logic for that will need to be added (for the timer)
  • Updated the unique link within the assessment (it doesn't really make sense to have the full link since its env dependent so if we have it showing to local host it would only work locally and vice versa - thats why we should just use id and construct the link from there based on the env - when we send emails we'll construct based off current env)
  • the panels are resizable but we don't show an indicator (its only on hover so user will have to discover this)

Notes

  • refreshing doesn't auto submit (I think I need to make an edit to the schema to have a start time and start the assessment

  • It does auto submit if we run out of time tho

  • No longer using routed intro outro and task bc having it in a single flow made state (such as the timer) easier to keep track of)

  • didn't reuse the testcase and code editor panels from the previous task and assessment template editor bc the data that we take in is different and what we show is also different (different enough to warrant new components) we'd essentially be creating new components within them imo)

Screen

https://sandboxneu.slack.com/archives/C09E7L2RK16/p1775078268444749?thread_ts=1775078043.152429&cid=C09E7L2RK16

Checklist

Please go through all items before requesting reviewers:

  • All commits are tagged with the ticket number
  • No linting errors / newline warnings
  • All code follows repository-configured formatting
  • No merge conflicts
  • All checks passing
  • Screenshots included for UI changes
  • Remove non-applicable sections of this template
  • PR assigned to yourself
  • Reviewers requested & Slack ping sent
  • PR linked to the issue (fill in 'Closes #')
  • If design-related, notify the designer in Slack

Closes

Closes #261

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 1, 2026

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

Project Deployment Actions Updated (UTC)
sarge Ready Ready Preview, Comment Apr 3, 2026 0:43am

Request Review

className="flex w-full items-center gap-3 text-left"
>
{isLoading && (
<Loader2 className="text-sarge-gray-500 size-4.5 flex-shrink-0 animate-spin" />
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

would it be better to use ternary logic instead of the && operator here @cherman23 @LOTaher

@@ -0,0 +1,17 @@
import { HighlightGuard } from '@/lib/components/core/HighlightGuard';
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Could just move this into the main layout however I've been breaking things out lmk what you think

Comment thread src/lib/hooks/useAssessment.ts Outdated
AssessmentQuestion,
} from '@/lib/types/candidate-assessment.types';

export type AssessmentPhase = 'intro' | 'assessment' | 'outro';
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

might be good to move these types into the candidate assessment types (thoughts?)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I agree with this, types should def be managed in the same place

}
}

async function setAssessmentStatus(status: AssessmentStatus) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

wait I'm realizing I prob shouldn't have removed this since we want to keep the admins up to date if the user took the oa (TODO for me btw)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

hmmm actually second thought this is fine - we don't have an in progress enum anyways so if font wants to know if someone is taking but I don't think that info is any useful rlly

Copy link
Copy Markdown
Collaborator

@LOTaher LOTaher left a comment

Choose a reason for hiding this comment

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

Few requested changes. Want to chat during standup about a few things

main: React.ReactNode;
};

export default function AssessmentFlowLayout({ navbar, sidebar, main }: AssessmentFlowLayoutProps) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this necessary? Seems like we can just inline this component no?

@@ -0,0 +1,101 @@
import { Loader2, CircleCheck, CircleX, AlarmClock } from 'lucide-react';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I thought the purpose of us component-izing our task template page was to reuse our test case section? Would we be able to do that instead and just add extra parameters? If that's too big of an ask then I'd rather we combine these components and have a parameter to determine whether it should behave like its in an OA or editable

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah we can talk abt this I realized that this might be hard to abstract away to use with the oa - but we can abstract for the task and assessment template stuff since its admin side data objects and we present similar info)

@@ -0,0 +1,151 @@
'use client';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same feedback as the test case card

@@ -0,0 +1,95 @@
import {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Main seems somewhat unclear on first glance imo. Can we call this "AssessmentFlowScreen" or something?

onStart: () => void;
};

// move this to utils? (thoughts)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can be a good call! We'd prob want to move formatDuration too

@@ -0,0 +1,37 @@
import { CircleCheck, Lock } from 'lucide-react';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you call this something like "AssessmentFlowSidebarQuestion" or "AssessmentSidebarQuestion"

@@ -0,0 +1,91 @@
'use client';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same feedback as the new test case component

Comment thread src/lib/hooks/useAssessment.ts Outdated
AssessmentQuestion,
} from '@/lib/types/candidate-assessment.types';

export type AssessmentPhase = 'intro' | 'assessment' | 'outro';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I agree with this, types should def be managed in the same place

try {
const { assessmentId } = await params;
await AssessmentService.submitAssessmentForCandidate(assessmentId);
return Response.json({ data: null }, { status: 200 });
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should prob be a 201 🤓


export async function submitCandidateAssessment(assessmentId: string): Promise<void> {
const res = await fetch(`/api/oa/${assessmentId}/submit`, { method: 'PUT' });
const json = await res.json();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should return something because the route returns data.

);
}

// the unique link shouldn't be the full link (bc the env of the link matters) so we just use id
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Note: we've talked about this, this will just be a set of random characters for the url

@LOTaher LOTaher merged commit 55e00b3 into main Apr 3, 2026
4 checks passed
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.

[OA][Frontend] - Assessment Flow

3 participants