PM-5866 - allow user to manually create review context - #2133
Merged
Conversation
vas3a
requested
a lite review from Copilot
and removed request for
jmgasper and
kkartunov
August 12, 2026 07:57
There was a problem hiding this comment.
Pull request overview
Adds a manual (non-AI) path to create a challenge review context from the Challenge Editor, enabling users to start editing requirements even when no generated context exists.
Changes:
- Introduces a “Manage Review Context” action that creates an empty review context (
requirements: []) withHUMAN_APPROVEDstatus and refetches. - Updates the empty-state UI to show both “Generate…” and “Manage…” actions side-by-side.
- Adds basic test coverage for the new button and styles for the new action layout.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/apps/work/src/pages/challenges/ChallengeEditorPage/components/ReviewersField/ReviewContextTab/ReviewContextTab.tsx | Adds manual context creation handler and new “Manage Review Context” button in the empty state UI. |
| src/apps/work/src/pages/challenges/ChallengeEditorPage/components/ReviewersField/ReviewContextTab/ReviewContextTab.spec.tsx | Adds a test related to the new Manage button (currently only asserts render). |
| src/apps/work/src/pages/challenges/ChallengeEditorPage/components/ReviewersField/ReviewContextTab/ReviewContextTab.module.scss | Adds layout styles for the two empty-state action buttons. |
Suppressed comments (1)
src/apps/work/src/pages/challenges/ChallengeEditorPage/components/ReviewersField/ReviewContextTab/ReviewContextTab.tsx:219
- The error UI is shared between Generate and Manage actions, but the Retry button always calls handleGenerateClick. If the Manage flow fails, clicking Retry will trigger AI generation instead of retrying manual creation.
{saveError && (
<div className={styles.errorText}>
<p>{saveError}</p>
<Button
label='Retry'
onClick={handleGenerateClick}
secondary
size='sm'
/>
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+203
to
+209
| <Button | ||
| disabled={isSaving || blockGenerate} | ||
| label='Manage Review Context' | ||
| onClick={handleManageClick} | ||
| secondary | ||
| size='lg' | ||
| /> |
Comment on lines
+197
to
+202
| <Button | ||
| disabled={isSaving || blockGenerate} | ||
| label={isSaving ? 'Generating context...' : 'Generate Challenge Review Context'} | ||
| onClick={handleGenerateClick} | ||
| size='lg' | ||
| /> |
Comment on lines
+152
to
+171
| it('renders the manual manage button when no context exists', () => { | ||
| mockUseFetchChallengeReviewContext.mockReturnValue({ | ||
| context: undefined, | ||
| error: undefined, | ||
| isError: false, | ||
| isLoading: false, | ||
| mutate: jest.fn(), | ||
| }) | ||
|
|
||
| render( | ||
| <ReviewContextTab | ||
| challengeId='challenge-1' | ||
| challengeDescription={'A'.repeat(120)} | ||
| challengeStatus={undefined} | ||
| />, | ||
| ) | ||
|
|
||
| expect(screen.getByRole('button', { name: 'Manage Review Context' })) | ||
| .toBeInTheDocument() | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related JIRA Ticket:
https://topcoder.atlassian.net/browse/PM-5866
What's in this PR?
Manual Review Context Form - no AI