Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: add task feedback dialog component#20252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
BrunoQuaresma wants to merge1 commit intomain
base:main
Choose a base branch
Loading
frombq/add-feedback-dialog

Conversation

BrunoQuaresma
Copy link
Collaborator

Related to#20214

This PR aims to add only the FE component for capturing user feedback from tasks. Once the BE work is completed (in a separate PR), this component will be triggered after a task is deleted.

The goal is to develop this feature in parallel.

Screenshot:
Screenshot 2025-10-09 at 14 31 53

@BrunoQuaresmaBrunoQuaresma requested a review froma teamOctober 9, 2025 17:35
@BrunoQuaresmaBrunoQuaresma self-assigned thisOct 9, 2025
@BrunoQuaresmaBrunoQuaresma requested review fromjaaydenh anda team and removed request fora team andjaaydenhOctober 9, 2025 17:35
Copy link
Member

@ParkreinerParkreiner left a comment

Choose a reason for hiding this comment

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

Had a few suggestions, but nothing worth blocking over

// All methods must be defined with arrow function syntax. See the docstring
// above the ApiMethods class for a full explanation.

exporttypeTaskFeedbackRate="good"|"regular"|"bad";
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I feel like this should be "rating" instead of "rate"

Copy link
Member

Choose a reason for hiding this comment

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

I also don't know if "regular" sounds like natural English. I would expect something like "okay" or "satisfactory"

import{useMutation}from"react-query";

typeTaskFeedbackFormValues={
rate:TaskFeedbackRate|null;
Copy link
Member

Choose a reason for hiding this comment

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

Same feedback here: I feel like this should also be "rating"

@@ -0,0 +1,145 @@
importtype{DialogProps}from"@radix-ui/react-dialog";
Copy link
Member

Choose a reason for hiding this comment

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

Do we want theDialogProps from Radix, or do you think we could use the version in theDialog file? It feels to me that we're importing so much from that file, but then importing one extra type definition from a different "layer"

Comment on lines +56 to +58
onSubmit:(values)=>{
createFeedback(valuesasCreateTaskFeedbackRequest);
},
Copy link
Member

Choose a reason for hiding this comment

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

I haven't really used Formik yet, so I'm not completely sure: does it provide any safety nets to make sure that we don't submit when the rating is null? Because if not, I feel like the code should be something like this:

if(values.rate!==null){createFeedback({rate:values.rate,comment:values.comment,});}

It creates an extra intermediary object, but I'd rather have that than a type assertion that could potentially lead to junk data getting sent to the server

</RateOption>
<RateOption{...formik.getFieldProps("rate")}value="regular">
<MehIcon/>
It sort-of worked, but struggled a lot
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I think the hyphen should be removed

Comment on lines +81 to +85
<div
className="flex flex-col gap-1"
role="radiogroup"
aria-label="Rate your experience"
>
Copy link
Member

Choose a reason for hiding this comment

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

I'm not fully sure if we need thediv. I feel like we could use thefieldset andlegend elements instead

exportconstSubmitting:Story={
beforeEach:async()=>{
spyOn(API.experimental,"createTaskFeedback").mockImplementation(()=>{
returnnewPromise(()=>{});
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to return a promise like this? Right now it can't ever resolve

Comment on lines +32 to +38
constregularOption=body.getByLabelText(
"It sort-of worked, but struggled a lot",
);
userEvent.click(regularOption);

constcommentTextarea=body.getByLabelText("Additional comments");
awaituserEvent.type(commentTextarea,"This is my comment");
Copy link
Member

Choose a reason for hiding this comment

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

I haven't actually run this code, but I'mpretty sure it works. I'd really like to see role selectors for these:

constregularOption=body.getByRole("radio",{name:"It sort-of worked, but struggled a lot",});userEvent.click(regularOption);constcommentTextarea=body.getByRole("textbox",{name:"Additional comments",});awaituserEvent.type(commentTextarea,"This is my comment");

Comment on lines +60 to +66
constregularOption=body.getByLabelText(
"It sort-of worked, but struggled a lot",
);
userEvent.click(regularOption);

constcommentTextarea=body.getByLabelText("Additional comments");
awaituserEvent.type(commentTextarea,"This is my comment");
Copy link
Member

Choose a reason for hiding this comment

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

I'd like to see these updated, too

Comment on lines +100 to +106
constregularOption=body.getByLabelText(
"It sort-of worked, but struggled a lot",
);
userEvent.click(regularOption);

constcommentTextarea=body.getByLabelText("Additional comments");
awaituserEvent.type(commentTextarea,"This is my comment");
Copy link
Member

Choose a reason for hiding this comment

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

And also these

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

@ParkreinerParkreinerParkreiner approved these changes

@aslilacaslilacAwaiting requested review from aslilacaslilac is a code owner

Assignees

@BrunoQuaresmaBrunoQuaresma

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@BrunoQuaresma@Parkreiner

[8]ページ先頭

©2009-2025 Movatter.jp