Skip to content

Enhance the application model and render new fields#1039

Open
Dhirenderchoudhary wants to merge 11 commits intoRealDevSquad:developfrom
Dhirenderchoudhary:develop
Open

Enhance the application model and render new fields#1039
Dhirenderchoudhary wants to merge 11 commits intoRealDevSquad:developfrom
Dhirenderchoudhary:develop

Conversation

@Dhirenderchoudhary
Copy link

@Dhirenderchoudhary Dhirenderchoudhary commented Feb 10, 2026

Date: 11 Feb 2026

Developer Name: Dhirender


Issue Ticket Number

#1037

Tech Doc Link

Business Doc Link

Description

We are revamping the flow to join RDS and as part of this revamp, new fields have been introduced such as nudge count, application score, etc. These fields are currently not rendered in the application details modal. Apart from this currently the admins can only accept/reject an application. But in this revamp we are introducing the option to request changes on an application. This issue ticket aims at adding the new fields which are being stored but not rendered in the application detail modal and adding a button to request changes on an application. Apart from this we will also improve the UI of the application.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1
Screen.Recording.2026-02-11.at.6.52.17.PM.mov

Test Coverage

Screenshot 1 Screenshot 2026-02-15 at 6 17 22 PM

Additional Notes

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

Walkthrough

Adds a "Request Changes" button to the application details interface with accompanying feedback submission flow. Introduces new utility functions for nudging applications and adding feedback. Updates styling to support application status badges and a highlights section displaying application score and nudge count. Extends mock data with new application fields.

Changes

Cohort / File(s) Summary
UI Template & Button
applications/index.html
Adds new "Request Changes" action button positioned between Accept and Reject buttons in application details actions.
Application Logic & Handlers
applications/script.js
Wires Request Changes button to updateUserApplication flow; adds isRequestChanges parameter to support feedback-only submission path; expands application details rendering with Status, Application Score (highlighted), and Nudge Count (highlighted) fields; implements conditional visibility for Request Changes button based on application status; imports addApplicationFeedback utility.
Styling & Theming
applications/style.css
Introduces new color tokens for status states (pending, accepted, rejected); adds status badge styles (.status-pending, .status-accepted, .status-rejected); creates highlights section layout (.application-highlights, .application-highlight-item); extends action button styles for Request Changes button; implements responsive behavior for buttons and highlights on mobile screens.
Utility Functions
applications/utils.js
Exports two new async functions: nudgeApplication (sends PATCH to /applications/{id}/nudge) and addApplicationFeedback (sends PATCH to /applications/{id}/feedback); both follow existing error handling patterns with credentials support.
Mock Data
mock-data/applications/index.js
Adds updatedAt, applicationScore, and nudgeCount fields to sample application object in fetchedApplications.

Sequence Diagram

sequenceDiagram
    participant User
    participant UI as Request Changes<br/>Button
    participant Script as script.js<br/>(updateUserApplication)
    participant Utils as utils.js<br/>(addApplicationFeedback)
    participant API as Backend API

    User->>UI: Click "Request Changes"
    UI->>Script: Trigger with isRequestChanges: true
    Script->>Script: Validate feedback exists
    Script->>Utils: Call addApplicationFeedback(id, feedbackData)
    Utils->>API: PATCH /applications/{id}/feedback
    API-->>Utils: Response
    Utils-->>Script: Return feedback update result
    Script->>API: updateApplication call
    API-->>Script: Success response
    Script->>UI: Show success toast
    Script->>UI: Close application details
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • #1037: Directly addresses the implementation of rendering new application fields (applicationScore, nudgeCount) and the "Request Changes" feature with feedback submission flow.

Poem

🐰 A button hops into the fray,
"Request Changes!" it proudly brays,
With highlights gleaming, scores on sight,
The application flow shines bright! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: enhancing the application model and rendering new fields (nudge count, application score) plus the Request Changes button.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description is directly related to the changeset, clearly explaining the purpose of adding new fields and the request changes functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
applications/script.js (1)

121-156: ⚠️ Potential issue | 🟠 Major

Promise.all can leave the application in a partially updated state.

If addApplicationFeedback succeeds but updateApplication fails (or vice versa), the application ends up with feedback submitted but status unchanged, or status changed but feedback lost. Promise.all rejects on the first failure, so the success toast is never shown, but the successful call's side effect has already persisted server-side.

Consider sequencing these calls (feedback first, then status update) so you can handle partial failure more gracefully, or at minimum document/accept this as a known trade-off.

🤖 Fix all issues with AI agents
In `@applications/index.html`:
- Around line 135-140: Update the button with class
"application-details-request-changes" to use a clearer aria-label: replace
"Request Changes Application" with "Request changes for this application" so
screen readers read a natural phrase; locate the <button> element that currently
sets aria-label and update that attribute value accordingly.

In `@applications/script.js`:
- Around line 92-95: The current branch that handles isRequestChanges silently
returns when applicationTextarea is missing or empty; change this so it
validates and informs the user instead of returning silently: inside the
isRequestChanges handling (the block referencing isRequestChanges and
applicationTextarea), replace the early return with a validation flow that
displays a visible error/validation message (e.g., render or call an existing
showValidationError/toast function), set focus on applicationTextarea, and
prevent submission until non-empty input is provided; keep the existing guard
for null textarea but ensure the user sees the error rather than no-op.
- Around line 89-116: In updateUserApplication, the isRequestChanges branch
incorrectly calls showToast directly instead of the dev-aware wrapper
showToastMessage; replace the showToast(...) calls inside the isRequestChanges
branch with showToastMessage(...) using the same message and type payload so the
request-changes flow uses the same toast system as the accept/reject path, and
ensure showToastMessage is available in the module scope (same usage pattern as
in the accept/reject branch).

In `@applications/style.css`:
- Around line 779-822: The button width rules for selectors
`.application-details .application-details-actions .application-details-reject`,
`.application-details .application-details-actions .application-details-accept`,
`.application-details .application-details-actions .application-details-nudge`,
and `.application-details .application-details-actions
.application-details-request-changes` are currently placed outside the `@media
(max-width: 850px)` block and therefore apply globally; wrap these width
declarations in an appropriate media query (e.g., a desktop/mid-range breakpoint
such as `@media (min-width: 851px)` or the same breakpoint group used for other
desktop styles) so the 18%/24% widths only apply on larger viewports, or
alternatively move them into the global button styles block if they truly are
intended to be global.
- Around line 462-496: The three rules for .description.status-pending,
.description.status-accepted, and .description.status-rejected duplicate
padding, border-radius, display, color, and text-transform; extract those shared
declarations into a single base class (e.g., .description.status-badge) and
leave only background-color in the specific selectors
(.description.status-pending, .description.status-accepted,
.description.status-rejected); update the CSS selectors to use
.description.status-badge alongside the existing nested context
(.application-details .application-details-main .application-section) so
specificity is preserved and only background-color varies per status.

In `@applications/utils.js`:
- Around line 120-140: Remove the unused exported function nudgeApplication from
applications/utils.js: delete the async function nudgeApplication and its export
so the module no longer exports an unused symbol; if you intend to keep it for a
future PR instead, move the implementation to a feature branch or comment it out
and add a TODO explaining where it will be wired up, but do not leave an
exported, unused function in this PR.

In `@mock-data/applications/index.js`:
- Around line 5-7: The mock data only includes applicationScore and nudgeCount
on the first object, so update the mock arrays fetchedApplications,
acceptedApplications, and pendingApplications to include those fields on
multiple entries with varied values (e.g., present with >0, present as 0, and
omitted) so tests exercise both the numeric rendering and the 'N/A' fallback;
locate the objects inside
fetchedApplications/acceptedApplications/pendingApplications in
mock-data/applications/index.js and add applicationScore and nudgeCount
properties across several entries accordingly.

…efactor application status badge styling, and update dependencies.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@applications/script.js`:
- Around line 134-141: The accept/reject branch currently checks
applicationTextarea.value directly, allowing whitespace-only feedback; mirror
the isRequestChanges path by trimming input first: compute const feedback =
applicationTextarea.value.trim() (or use applicationTextarea.value &&
applicationTextarea.value.trim()) and only push
addApplicationFeedback(currentApplicationId, { feedback, status:
applicationStatus }) when feedback is non-empty, ensuring you reference
applicationTextarea, addApplicationFeedback, currentApplicationId, and
applicationStatus so the validation is consistent across both code paths.
- Around line 739-741: The click handler passes a redundant isAccepted flag to
updateUserApplication even though updateUserApplication short-circuits when
isRequestChanges is true; remove the misleading parameter and call
updateUserApplication({ isRequestChanges: true }) from
applicationRequestChangesButton's listener so only the meaningful property is
supplied (reference: applicationRequestChangesButton and updateUserApplication
with the isRequestChanges early-return).

In `@applications/style.css`:
- Around line 790-819: Remove the orphaned CSS rules for the non-existent
.application-details-nudge selector or add the missing element; locate the rules
under the .application-details .application-details-actions
.application-details-nudge block and either delete all related selectors
(including the :is(:hover, :active, :focus-visible), :hover and :active variants
and the bounceBackAnimation usage) or implement a corresponding button element
(e.g., class="application-details-nudge") in the application details markup
where nudgeCount is shown so the styles apply.

…nager, improve API base URL loading, and refine application feedback and toast handling.
@Dhirenderchoudhary Dhirenderchoudhary added enhancement New feature or request feature task A big ticket item that needs to come up as a feature labels Feb 10, 2026
@Dhirenderchoudhary Dhirenderchoudhary self-assigned this Feb 10, 2026
@Dhirenderchoudhary Dhirenderchoudhary linked an issue Feb 10, 2026 that may be closed by this pull request
…base URL environment configuration, and upgrade to Yarn 4.
@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

Note

Unit test generation is a public access feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@RealDevSquad RealDevSquad deleted a comment from coderabbitai bot Feb 11, 2026
Copy link
Contributor

Choose a reason for hiding this comment

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

don't see the new format of the application here you can check the application response new one for the correct response structure or check the backend repo

Copy link
Contributor

Choose a reason for hiding this comment

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

this is also not replied

Copy link
Author

Choose a reason for hiding this comment

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

what you mean by new format i did that according to my knowledge and changes the test cases

Copy link
Contributor

@AnujChhikara AnujChhikara left a comment

Choose a reason for hiding this comment

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

I don't see any test attached to this pr or any test pr link make sure to add them

Copy link
Contributor

@AnujChhikara AnujChhikara left a comment

Choose a reason for hiding this comment

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

I don't see the admin feedback api changes in this PR , make sure to include them and test your changes with your local backend or staging backend not with mock data please

Copy link
Contributor

Choose a reason for hiding this comment

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

this is also not replied

@AnujChhikara
Copy link
Contributor

I don't see any test attached to this pr or any test pr link make sure to add them

Still don't see the test or Test PR link attached

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/toast/script.js (1)

50-56: ⚠️ Potential issue | 🔴 Critical

Fix legacy toast functions to accept object payloads instead of strings.

The showToaster functions in identity-service-logs/utils.js (line 207) and groups/script.js (line 250) expect a string parameter and set innerText = message. However, they are passed { message, type } objects from showToastMessage when their arity is 1, causing them to display [object Object] instead of the actual message.

Update both functions to extract the message from the object:

function showToaster({ message }) {
  const toaster = document.querySelector('.toast__message');
  toaster.innerText = message;
  toaster.classList.add('toast--show');

  setTimeout(() => {
    toaster.classList.remove('toast--show');
  }, 3000);
}

This affects 8 call sites: 2 in identity-service-logs/utils.js and 6 in groups/script.js.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/toast/script.js` around lines 50 - 56, The legacy toaster
functions need to accept an object payload (with message and type) instead of a
plain string: update the showToaster implementations referenced in
identity-service-logs/utils.js and groups/script.js so their signature
destructures the payload (e.g. function showToaster({ message, type }) or at
least { message }) and use message for toaster.innerText and any type-based
styling; ensure these showToaster variants still work with showToastMessage
(which passes { message, type } when oldToastFunction.length === 1) and adjust
any local references within those functions accordingly across the 8 affected
call sites.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@applications/style.css`:
- Around line 454-472: The CSS lacks a rule for the status class generated for
"changes_requested" (script builds status-${application.status.toLowerCase()}
producing status-changes_requested), so add a selector for
.description.status-changes_requested and set its background-color to the
desired value (e.g., var(--color-pending)) or normalize mapping to reuse
.description.status-pending; update the stylesheet by adding that class
alongside
.description.status-pending/.description.status-accepted/.description.status-rejected
so badges for changes_requested render with the correct background color.

---

Outside diff comments:
In `@components/toast/script.js`:
- Around line 50-56: The legacy toaster functions need to accept an object
payload (with message and type) instead of a plain string: update the
showToaster implementations referenced in identity-service-logs/utils.js and
groups/script.js so their signature destructures the payload (e.g. function
showToaster({ message, type }) or at least { message }) and use message for
toaster.innerText and any type-based styling; ensure these showToaster variants
still work with showToastMessage (which passes { message, type } when
oldToastFunction.length === 1) and adjust any local references within those
functions accordingly across the 8 affected call sites.

);
});

it('should hide action buttons after successfully requesting changes', async function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this test about? are we hiding the button if the status is request changes

await page.click('#application-details-request-changes');
await page.waitForSelector('[data-testid="toast-component"].show');

const acceptBtn = await page.$('#application-details-accept');
Copy link
Contributor

Choose a reason for hiding this comment

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

use data test id here also to get the buttons

Comment on lines +332 to +342
let feedbackText = '';
if (typeof application.feedback === 'string') {
feedbackText = application.feedback;
} else if (Array.isArray(application.feedback)) {
feedbackText = application.feedback
.map((f) => (typeof f === 'string' ? f : f.feedback || ''))
.filter((f) => f)
.join('\n');
} else if (application.feedback && typeof application.feedback === 'object') {
feedbackText = application.feedback.feedback || '';
}
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we making this so complex from backend you will you get this response

    feedback: [
                {
                    "status": string,
                    "reviewerName": string,
                    "createdAt": timestamp
                    "feedback": string
                }
            ],

I would suggest show the backend feedback at different part of the card not on the textarea as it can be multiple

Comment on lines +365 to +367
applicationAcceptButton.classList.add('hidden');
applicationRejectButton.classList.add('hidden');
applicationRequestChangesButton.classList.add('hidden');
Copy link
Contributor

Choose a reason for hiding this comment

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

but admin can accept or reject or request changes if the status is request changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature task A big ticket item that needs to come up as a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance the application model and render new fields

2 participants