Skip to content

Abstract UAT keywords feedback#814

Merged
thostetler merged 1 commit intoadsabs:masterfrom
shinyichen:SCIX-531-abs-uat-keywords-feedback
Mar 16, 2026
Merged

Abstract UAT keywords feedback#814
thostetler merged 1 commit intoadsabs:masterfrom
shinyichen:SCIX-531-abs-uat-keywords-feedback

Conversation

@shinyichen
Copy link
Copy Markdown
Member

@shinyichen shinyichen commented Feb 26, 2026

Add a feedback button link in abstract UAT keywords. When clicked, link to general feedback prefilled with subject and record ID

Screen.Recording.2026-02-27.at.2.25.46.PM.mov

@shinyichen
Copy link
Copy Markdown
Member Author

shinyichen commented Feb 26, 2026

@kelockhart Would you see if the video demo looks good before I include Tim for the code review?

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.1%. Comparing base (268a15d) to head (b9bdf8b).

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #814     +/-   ##
========================================
- Coverage    62.1%   62.1%   -0.0%     
========================================
  Files         317     317             
  Lines       36552   36552             
  Branches     1646    1645      -1     
========================================
- Hits        22664   22663      -1     
- Misses      13851   13852      +1     
  Partials       37      37             

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kelockhart
Copy link
Copy Markdown
Member

@shinyichen the functionality looks good! But I wonder if the little icon will be noticed. Can you try adding "feedback" or something next to the icon?

@shinyichen shinyichen force-pushed the SCIX-531-abs-uat-keywords-feedback branch from 0f546cd to 95df1c0 Compare February 27, 2026 22:24
@shinyichen
Copy link
Copy Markdown
Member Author

@kelockhart Please see updated screen capture.
Screenshot 2026-02-27 at 2 26 45 PM

@kelockhart
Copy link
Copy Markdown
Member

@shinyichen yes! Looks great, no more feedback on my end.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a “Feedback” entry point from the Abstract UAT Keywords section that routes users to the General Feedback form with a prefilled subject and record identifier.

Changes:

  • Add a “Feedback” button to the UAT Keywords block on abstract details and navigate to the general feedback route with query params.
  • Update the General Feedback page to prefill the comment body and email subject from router.query.
  • Expand feedback _subject typing to include the new UAT-specific subject.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/pages/feedback/general.tsx Reads subject/id from query to prefill comments and _subject during submission.
src/components/AbstractDetails/AbstractDetails.tsx Adds UAT “Feedback” button that routes to general feedback with record id + subject.
src/api/feedback/types.ts Updates _subject typing to allow the new UAT feedback subject (and currently any string).
Comments suppressed due to low confidence (2)

src/pages/feedback/general.tsx:125

  • _subject: !!subject ? subject : 'Nectar Feedback' can pass a string[] through to the API if the query contains repeated subject params. Normalize subject to a single string before using it, and consider whitelisting allowed subjects so this endpoint isn't accepting arbitrary query-controlled subject lines.
          {
            name,
            _replyto: email,
            _subject: !!subject ? subject : 'Nectar Feedback',
            'feedback-type': 'feedback',
            'user-agent-string': globalThis?.navigator?.userAgent,
            origin: 'bbb_feedback', // indicate general feedback
            'g-recaptcha-response': recaptchaToken,

src/pages/feedback/general.tsx:88

  • useForm({ defaultValues }) only applies defaultValues on the first mount. On client-side navigation, router.query may be empty until router.isReady is true, so the comments prefill can be skipped. Consider calling reset(...) in an effect when router.isReady and the normalized subject/id are available (or pass values to useForm if you intend it to be reactive).
  const initialFormValues: FormValues = {
    name: '',
    email: userEmail ?? '',
    comments: !!subject && subject === 'UAT keywords feedback' ? `UAT Keywords feedback on record: ${id}\n\n` : '',
  };

  const formMethods = useForm<FormValues>({
    defaultValues: initialFormValues,
    resolver: zodResolver(validationSchema),
    mode: 'onSubmit',
    reValidateMode: 'onBlur',
    shouldFocusError: true,
  });

Comment thread src/components/AbstractDetails/AbstractDetails.tsx
Comment thread src/api/feedback/types.ts
Comment thread src/pages/feedback/general.tsx
Copy link
Copy Markdown
Member

@thostetler thostetler left a comment

Choose a reason for hiding this comment

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

I think the changes look generally pretty good. If we end up doing this sort of then again, we'll want to generalize it more so that we don't have the logic for this one case in the main email config.

I just have one small thing I mentioned

Comment thread src/pages/feedback/general.tsx
@shinyichen
Copy link
Copy Markdown
Member Author

@thostetler Please see my updates.

@thostetler thostetler force-pushed the SCIX-531-abs-uat-keywords-feedback branch from 95df1c0 to b9bdf8b Compare March 11, 2026 18:28
Copy link
Copy Markdown
Member

@thostetler thostetler left a comment

Choose a reason for hiding this comment

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

I think this looks good to go

@thostetler thostetler merged commit 1c5a2a7 into adsabs:master Mar 16, 2026
5 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.

4 participants