Skip to content

feat: preview grant application before submitting for review (fixes #…#1426

Open
espadondutravail wants to merge 1 commit into
SuperteamDAO:mainfrom
espadondutravail:feat/preview-grant-application-1424
Open

feat: preview grant application before submitting for review (fixes #…#1426
espadondutravail wants to merge 1 commit into
SuperteamDAO:mainfrom
espadondutravail:feat/preview-grant-application-1424

Conversation

@espadondutravail

@espadondutravail espadondutravail commented Jun 29, 2026

Copy link
Copy Markdown

feat: preview grant application before submitting for review (fixes #1424)

What does this PR do?

This PR introduces a new "Preview" step (Step 4) to the Grant Application wizard. Previously, applicants would hit "Apply" at the end of the Milestones step without being able to review their answers. Now, users can review all their inputs in a read-only, beautifully formatted summary screen before confirming their final submission.

Where should the reviewer start?

The main logic and layout changes are located in src/features/grants/components/Modals/ApplicationModal.tsx.

  • Check the getSteps function where the Preview step was added.
  • Check the activeStep === 3 block for the new UI layout rendering the summary.
  • Notice how dangerouslySetInnerHTML alongside prose prose-sm classes are correctly used to render Rich Text content natively.

How should this be manually tested?

  1. Open a Grant Application modal.
  2. Fill out steps 1 (Basics), 2 (Details), and 3 (Milestones/Outcomes). Make sure to include some rich text formatting (bold, lists).
  3. Click "Continue" on Step 3.
  4. You should land on the new "Preview" step. Verify that all your answers are displayed correctly, that Rich Text fields are formatted visually instead of showing raw HTML tags.
  5. Accept the acknowledgements at the bottom of the page and click "Apply" to verify the submission goes through.

Any background context you want to provide?

I moved the Acknowledgement checkboxes (terms and feedback) to the bottom of the new Preview step instead of the Milestones step. This makes more sense from a UX perspective, allowing users to agree to terms immediately before clicking "Apply".

What are the relevant issues?

Fixes #1424

Screenshots (if appropriate)

(Feel free to add a screenshot showing the new beautiful Preview step with all data filled in).

Summary by CodeRabbit

  • New Features
    • Added a new Preview step to the application flow.
    • Users can now review entered information before submitting, including basic details, custom questions, and milestones/outcomes.
    • Acknowledgement checkboxes now appear on the final review step for new applications, just before submission.

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@espadondutravail is attempting to deploy a commit to the Superteam Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

A new "Preview" step is added to the ApplicationModal stepper via getSteps. The preview panel, rendered at activeStep === 3, displays all entered form values (basics, details, optional fields, custom questions, milestones) and the acknowledgement checkboxes for new applications before final submission.

Changes

Grant Application Preview Step

Layer / File(s) Summary
Preview step registration and panel
src/features/grants/components/Modals/ApplicationModal.tsx
getSteps adds a "Preview" entry as the new final step. A new activeStep === 3 JSX block renders all form values and moves the acknowledgement checkboxes into this preview panel.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • SuperteamDAO/earn#1092: Modifies the same ApplicationModal grant application form payload, adding github field handling that is part of the fields now rendered in the new preview panel.

Poem

🐇 Hop hop, before you send away,
A preview step now lights your way!
See your answers, one by one,
Check the boxes when you're done.
No more guessing — submit with cheer,
The rabbit checked it, never fear! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding a preview step before grant application submission.
Linked Issues check ✅ Passed The changes satisfy #1424 by adding a preview summary before final submission in the grant application flow.
Out of Scope Changes check ✅ Passed The patch stays focused on the preview flow in ApplicationModal and shows no clear unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/features/grants/components/Modals/ApplicationModal.tsx`:
- Line 68: The progress bar calculation in ApplicationModal is still hard-coded
for the old step count, so adding the new Preview step makes it overshoot and
advance unevenly. Update the progress math to derive the percentage from the
current step index and the total number of steps used by the modal flow, and
make sure the step list that includes Preview is the single source of truth for
the progress calculation.
- Around line 1125-1130: The Luma preview in ApplicationModal is showing the
stored slug instead of the full URL. Update the preview block that reads
form.getValues('lumaLink') so it renders the normalized full Luma link users
entered, using the same normalization logic applied in the lumaLink input
handling in ApplicationModal. Keep the existing conditional on isST, but ensure
the displayed value is the full link rather than the raw stored slug.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bd82f062-07a4-4bc5-b6da-5d2b558117d6

📥 Commits

Reviewing files that changed from the base of the PR and between 3d93374 and 1959474.

📒 Files selected for processing (1)
  • src/features/grants/components/Modals/ApplicationModal.tsx

{ title: 'Basics' },
{ title: 'Details' },
{ title: isST ? 'Outcomes' : 'Milestones' },
{ title: 'Preview' },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Recompute the progress bar from the step count.

Adding a fourth step leaves the hard-coded progress math at Line 521 stale, so the bar now overshoots 100% on the Preview step and no longer advances evenly.

Suggested fix
-          value={(activeStep / steps.length) * 100 + 33}
+          value={steps.length > 1 ? (activeStep / (steps.length - 1)) * 100 : 0}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/features/grants/components/Modals/ApplicationModal.tsx` at line 68, The
progress bar calculation in ApplicationModal is still hard-coded for the old
step count, so adding the new Preview step makes it overshoot and advance
unevenly. Update the progress math to derive the percentage from the current
step index and the total number of steps used by the modal flow, and make sure
the step list that includes Preview is the single source of truth for the
progress calculation.

Comment on lines +1125 to +1130
{isST && form.getValues('lumaLink') && (
<div>
<span className="font-medium text-slate-500">
Luma Event:
</span>
<p className="mt-1">{form.getValues('lumaLink')}</p>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preview the full Luma link, not the stored slug.

The input normalizes this field to a slug at Lines 772-776, but the preview prints the raw stored value. Users will review my-event instead of the actual Luma URL they entered.

Suggested fix
-                        <p className="mt-1">{form.getValues('lumaLink')}</p>
+                        <p className="mt-1">
+                          {getLumaDisplayValue(form.getValues('lumaLink') || '')}
+                        </p>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{isST && form.getValues('lumaLink') && (
<div>
<span className="font-medium text-slate-500">
Luma Event:
</span>
<p className="mt-1">{form.getValues('lumaLink')}</p>
{isST && form.getValues('lumaLink') && (
<div>
<span className="font-medium text-slate-500">
Luma Event:
</span>
<p className="mt-1">
{getLumaDisplayValue(form.getValues('lumaLink') || '')}
</p>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/features/grants/components/Modals/ApplicationModal.tsx` around lines 1125
- 1130, The Luma preview in ApplicationModal is showing the stored slug instead
of the full URL. Update the preview block that reads form.getValues('lumaLink')
so it renders the normalized full Luma link users entered, using the same
normalization logic applied in the lumaLink input handling in ApplicationModal.
Keep the existing conditional on isST, but ensure the displayed value is the
full link rather than the raw stored slug.

@RevTpark

RevTpark commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

There are two issues with this implementation

  • The progress bar undershoots and gets stuck at 3rd step progress for step 3 and 4, minor issue.
Screenshot 2026-07-02 at 13 08 37 Screenshot 2026-07-02 at 13 08 48
  • Major issue is the UX with this implementation, it feels even if the user does not want to preview the application they still have to do it as part of the application(since its the 4th step). And some grant applications can be very lengthy so they have to scroll through the entire thing just to accept the terms and conditions.
  • The 4th step UI starts to cramp on mobile view.
  • The better UX would to have a Preview button on the 3rd Step that lets the user check their application in another modal/drawer/full sheet to check the application if they want to, without causing any friction in the actual application process.
  • Also recc to test the UI properly on all dimensions and ensure existing features arent broken before raising a PR.
Screenshot 2026-07-02 at 13 26 58

@RevTpark RevTpark left a comment

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.

check the above comment

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.

Feat: Preview grant application before submitting for review

2 participants