Skip to content

[DEV-630] Implementing QuestionPanel Functionalities#105

Open
mar-crespo wants to merge 15 commits intopreviewfrom
question-panel-functionalities
Open

[DEV-630] Implementing QuestionPanel Functionalities#105
mar-crespo wants to merge 15 commits intopreviewfrom
question-panel-functionalities

Conversation

@mar-crespo
Copy link
Copy Markdown

@mar-crespo mar-crespo commented Mar 27, 2026

References

  • Linear: [DEV-630]

Proposed Changes

  • Added answer submission functionality – Implemented a complete answer form with state management (showAnswerBox, answer), input handling, and submission via createNewAnswer API call with toast notification on success

  • Added new props and imports – Added questionId prop to the interface, plus imports for useRouter, createNewAnswer from answerService, and toast from sonner

  • Added Reply button interaction – Created a "Reply" button that toggles visibility of the answer text area, with a "Submit" button that posts the answer and clears the form

  • Fixed code to work with changes to match QuestionPanel look to new Figma design

  • Tested changes using testing page with mock data:

Screenshot 2026-04-01 at 9 04 56 PM Screenshot 2026-04-01 at 9 05 40 PM

@linear
Copy link
Copy Markdown

linear bot commented Mar 27, 2026

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

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

Project Deployment Actions Updated (UTC)
help Ready Ready Preview, Comment Apr 4, 2026 5:34pm

Request Review

Copy link
Copy Markdown
Contributor

@issacli-0821 issacli-0821 left a comment

Choose a reason for hiding this comment

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

Left two comments. Also need to resolve some merge conflicts resulting from Adam's PR

className={styles.answerBox}
placeholder='Write your answer here...'
value={answer}
onChange={handleSubmit}
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.

Why is handleSubmit for onChange here?

onChange={handleSubmit}
/>
<Button className={styles.button} onClick={handleSubmit}>
Submit
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.

Can we add an "Answer submitted" popup once the answer is submitted?

timothyli1331 and others added 12 commits April 4, 2026 13:23
* Changed main color to red from teal/blue. However, wasn't able to figure out an issue with the hover/select with the tab buttons and couldn't get them to turn red. Also, fixed and changed button layout in StudyPage

* fix issue with navbar text color by changing selector settings

* Fixed the about page

---------

Co-authored-by: ericguo202 <eric.guo171@gmail.com>
* [DEV-574] fixed user posts page

* fixed lint errors

* added package.json for phosphor icons addition

* Remove user-preview page and sampleData from PR

* removed sample types and moved to pastebin

* Add types in PostCard and UserPostsPage

---------

Co-authored-by: issacli-0821 <tl1719@princeton.edu>
* add user page

* add user page

* update user page

* Remove mock user info

---------

Co-authored-by: issacli-0821 <tl1719@princeton.edu>
* Implement NotificationView and NotificationSerializer

* - Marked notification_views fields as read only

- Updated notification post method to update notifications as opposed to create

* Changed get method to only retrieve one notification

* Changed notification_id parameter for all NotificationView methods

* DEV 633 - Update style of HoagieHelp (#94)

* Changed main color to red from teal/blue. However, wasn't able to figure out an issue with the hover/select with the tab buttons and couldn't get them to turn red. Also, fixed and changed button layout in StudyPage

* fix issue with navbar text color by changing selector settings

* Fixed the about page

---------

Co-authored-by: ericguo202 <eric.guo171@gmail.com>

* Lint notification_views

---------

Co-authored-by: issacli-0821 <tl1719@princeton.edu>
Co-authored-by: Timothy Li <timothyli1331@gmail.com>
Co-authored-by: ericguo202 <eric.guo171@gmail.com>
* Create hearts url routes

* fix import from heart_views.py

---------

Co-authored-by: Ryan Jensen <rj1044@princeton.edu>
Co-authored-by: ericguo202 <eric.guo171@gmail.com>
* create heartService.ts

* fix

* Update comments on the functions

---------

Co-authored-by: issacli-0821 <tl1719@princeton.edu>
* Added atomic hearting functionalities for questions, answers, and responses/comments.

* add unheart functionality

* fix method name - should be heart_comment not heart_response

* Pass CustomUser directly from request

* Optimize DB queries

* Lint heart_views.py

---------

Co-authored-by: ericguo202 <eric.guo171@gmail.com>
Co-authored-by: issacli-0821 <tl1719@princeton.edu>
* updated question panel to match figma

* ran prettier

* Lint QuestionPanel

* Modify create_time to only be Date type

---------

Co-authored-by: issacli-0821 <tl1719@princeton.edu>
* Created the get_notifications function

* Made get_notifications into a standalone function and changed to request.user.id

* hopefully this fixes merge conflicts

* Lint notification_views

---------

Co-authored-by: issacli-0821 <tl1719@princeton.edu>
* Remove leading slash; fix param typo

* Make heart functions standalone instead of a view

* Update yarn.lock

* Add phosphor icons in package.json

* Update dependencies to include phosphor-icons/react

* Refactor and simplify heart functions, rename question hearts field to match answer and comment

* Lint urls

---------

Co-authored-by: Spencer04Hire <124114480+Spencer04Hire@users.noreply.github.com>
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.

8 participants