Skip to content

Conversation

@ShivaGupta-14
Copy link
Contributor

@ShivaGupta-14 ShivaGupta-14 commented Dec 30, 2025

Description

  • Replace text input with Select dropdown for tag selection
  • Add "Create new tag" option in dropdown
  • Display selected tags as removable badges
  • Add uniqueTags, isCreatingNewTag, setIsCreatingNewTag props
  • Add data-testid to Priority, Tags, Recur SelectTriggers

Tests:

  • Update Select component mocks for testing
  • Rewrite tag tests to use dropdown selection
  • Add tests for dropdown selection and tag removal

Fixes: #210

Checklist

  • Ran npx prettier --write . (for formatting)
  • Ran gofmt -w . (for Go backend)
  • Ran npm test (for JS/TS testing)
  • Added unit tests, if applicable
  • Verified all tests pass
  • Updated documentation, if needed

Additional Notes

Video

Screen.Recording.2025-12-30.at.10.52.35.PM.mov

- Replace text input with Select dropdown for tag selection
- Add "Create new tag" option in dropdown
- Display selected tags as removable badges
- Add uniqueTags, isCreatingNewTag, setIsCreatingNewTag props
- Add data-testid to Priority, Tags, Recur SelectTriggers

Tests:
- Update Select component mocks for testing
- Rewrite tag tests to use dropdown selection
- Add tests for dropdown selection and tag removal

Fixes: CCExtractor#210
@github-actions
Copy link

Thank you for opening this PR!

Before a maintainer takes a look, it would be really helpful if you could walk through your changes using GitHub's review tools.

Please take a moment to:

  • Check the "Files changed" tab
  • Leave comments on any lines for functions, comments, etc. that are important, non-obvious, or may need attention
  • Clarify decisions you made or areas you might be unsure about and/or any future updates being considered.
  • Finally, submit all the comments!

More information on how to conduct a self review:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request

This helps make the review process smoother and gives us a clearer understanding of your thought process.

Once you've added your self-review, we'll continue from our side. Thank you!

Copy link
Contributor Author

@ShivaGupta-14 ShivaGupta-14 left a comment

Choose a reason for hiding this comment

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

self review done! ready for review

@ShivaGupta-14
Copy link
Contributor Author

Hi @its-me-abhishek!

I’ve added dropdown tests in AddTaskDialog.test.tsx since the logic is identical in both dialogs, for TaskDialog.test.tsx, I only kept the remove/save tests to avoid duplication, should I also add the same dropdown interaction tests there, or is covering it once sufficient? Let me know your preference.

Copy link
Collaborator

@its-me-abhishek its-me-abhishek left a comment

Choose a reason for hiding this comment

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

Please look into the above comments


return (
<select
data-testid="project-select"
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think the previous approach of using data-testid is better, and makes tests more deterministic

const tagsInput = screen.getByPlaceholderText(/add a tag/i);
fireEvent.keyDown(tagsInput, { key: 'Enter', code: 'Enter' });
const option = screen.queryByRole('option', { name: 'work' });
expect(option).not.toBeInTheDocument();
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we hide duplicate tags? disabling them seems to be another option, for a better UX

render(<AddTaskdialog {...mockProps} />);

const workElements = screen.getAllByText('work');
expect(workElements).toHaveLength(1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

this can pass even if work appears in, maybe selected tags, perhaps use getByRole with work for that

});

test('sets isCreatingNewTag to true when "create new tag" is selected', () => {
mockProps.isOpen = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can move all these mockProps to the top, and use beforeEach

onChange={(e) =>
onUpdateState({ editTagInput: e.target.value })
}
onKeyDown={(e) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this can be moved to a helper function, inside task-utils

e.key === 'Enter' &&
editState.editTagInput.trim()
) {
if (
Copy link
Collaborator

Choose a reason for hiding this comment

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

can use ternary operators instead of if else

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.

Reusable tags for Editing or Adding a task

2 participants