Skip to content

Conversation

@shobhan-sundar-goutam
Copy link
Contributor

@shobhan-sundar-goutam shobhan-sundar-goutam commented Sep 10, 2025

Date: 11-09-25

Developer Name: Shobhan Sundar Goutam (@shobhan-sundar-goutam)


Issue Ticket Number

Description

This PR adds a Created By field to the Edit Todo modal, displaying the name of the user who originally created the task.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1 Screenshot 2025-09-11 at 1 38 05 AM

Test Coverage

Screenshot 1 Screenshot 2025-09-11 at 1 39 07 AM

Additional Notes

Description by Korbit AI

What change is being made?

Display the "Created By" information in the Edit Todo modal.

Why are these changes being made?

These changes provide additional context to users by showing who created the task, which is particularly useful in collaborative environments. The implementation adds a createdBy field to the form schema and updates relevant components to display this information only in edit mode, ensuring consistency with the application's existing functionality.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

@shobhan-sundar-goutam shobhan-sundar-goutam self-assigned this Sep 10, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 10, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

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.

Summary by CodeRabbit

  • New Features
    • Added a read-only “Created By” section in the Edit Todo form, displaying the creator’s name with a user icon.
    • Creator details are automatically populated from existing assignee/creator data when available, ensuring accurate display.
    • Form data now includes creator information for improved consistency across edit flows.

Walkthrough

Adds a Created By field to the Todo form schema and public type, initializes it from existing data, and renders it read-only in edit mode. Updates TodoUtil to populate createdBy from todo.createdBy when available. Introduces a UserIcon for the display. No submit/cancel logic changes.

Changes

Cohort / File(s) Summary
Form schema and UI updates
components/create-edit-todo-form.tsx
Added createdBy to Zod schema and TTodoFormData; initialized from initialData.assignee; renders read-only Created By section in edit mode using UserIcon; no changes to submit/cancel logic beyond carrying createdBy in form data.
Default data mapping
lib/todo-util.ts
Extended getDefaultTodoFormData to include createdBy mapped from todo.createdBy { name,id } to { label,value } when present; return type remains Partial.

Sequence Diagram(s)

sequenceDiagram
  actor U as User
  participant M as Edit Todo Modal
  participant TU as TodoUtil.getDefaultTodoFormData
  participant F as Form (Zod schema)

  U->>M: Open Edit Todo
  M->>TU: Request default form data
  TU-->>M: { title, ..., createdBy: {label,value} }
  M->>F: Initialize form with data
  F-->>M: Form state ready
  M->>U: Render fields (Created By read-only)
  U->>M: Submit/Cancel (unchanged flow)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • yesyash

Poem

A whisk of code, a hop of delight,
“Created By” now glimmers in edit’s light.
I nudge the form with gentle care,
Names appear—truth laid bare.
With UserIcon’s tidy gleam,
Trace the maker of each dream. 🐇✨

Pre-merge checks (5 passed)

✅ Passed checks (5 passed)
Check name Status Explanation
Title Check ✅ Passed The title “feat: display created by in Edit Todo modal” directly reflects the primary change of showing the creator’s name in the Edit Todo modal, is concise and follows the conventional commit style without extraneous details.
Linked Issues Check ✅ Passed The implemented changes—adding the createdBy field to the form schema and type, mapping it in the utility, and rendering it in the Edit Todo modal—fully satisfy the objective of issue #200 to display the creator’s name in the Edit Todo modal.
Out of Scope Changes Check ✅ Passed All modifications focus exclusively on adding and displaying the createdBy field as specified in the linked issue, with no unrelated or extraneous code changes detected in the form component or utility.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed The PR description clearly states it adds a "Created By" field to the Edit Todo modal and closes issue #200, which matches the raw_summary and PR objectives; it also includes screenshots, test notes, and notes about no DB or breaking changes. The description is directly related to the changeset and not off-topic. Under the lenient criteria for this check, the description is sufficient to pass.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/show-created-by-in-edit-todo-modal

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

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Functionality Incorrect Default Value for Created By Field ▹ view ✅ Fix detected
Files scanned
File Path Reviewed
lib/todo-util.ts
components/create-edit-todo-form.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c75372 and 8bbc586.

📒 Files selected for processing (2)
  • components/create-edit-todo-form.tsx (4 hunks)
  • lib/todo-util.ts (1 hunks)
🔇 Additional comments (2)
components/create-edit-todo-form.tsx (1)

21-21: LGTM: Icon import

UserIcon import is correct and used below.

lib/todo-util.ts (1)

65-70: LGTM: Safe mapping of createdBy into form defaults – todo.createdBy.name and .id align with TTaskCreatedBy.

@MayankBansal12
Copy link
Member

@shobhan-sundar-goutam files structure has been changed with latest migration, kindly update the branch and fix the merge conflicts

label: z.string(),
value: z.string(),
})
.optional(),
Copy link
Member

Choose a reason for hiding this comment

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

can createdBy be optional in a task?

Copy link
Contributor Author

@shobhan-sundar-goutam shobhan-sundar-goutam Sep 11, 2025

Choose a reason for hiding this comment

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

optional is there to avoid any issues for Create Task. createdBy is used only for edit todo modal. Please check the new PR #204

@shobhan-sundar-goutam
Copy link
Contributor Author

Closing this PR as we got breaking changes merged into develop. Opened a new PR #204

@shobhan-sundar-goutam shobhan-sundar-goutam deleted the feature/show-created-by-in-edit-todo-modal branch September 11, 2025 20:04
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.

Show created by in the modal, not on table

3 participants