Skip to content

Conversation

@shobhan-sundar-goutam
Copy link
Contributor

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

Date: 12-09-25

Developer Name: @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
  • Added Created By field in edit todo modal
Screenshot 2025-09-11 at 1 38 05 AM
  • Removed Created By column from table -
Screenshot 2025-09-15 at 2 54 08 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?

Add the display of "Created By" information in the Edit Todo modal, showing the user's name and id if available.

Why are these changes being made?

This change enhances the Edit Todo modal by providing context about the creator of the todo item, which can be important for tracking accountability and understanding the history behind a todo. The implementation checks for edit mode and conditionally renders the creator's information if it exists, ensuring that the display is relevant and informative without cluttering the user interface.

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 11, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 11, 2025

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.

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.

Summary by CodeRabbit

  • New Features
    • Added a “Created By” field to the Todo edit form, displayed under Properties (after Labels) with a user icon. It appears only when creator info is available.
  • Enhancements
    • Edit forms now prefill creator details when available, ensuring consistent display of “Created By.”
    • No changes to the create flow or submission behavior; the new field is view-only and limited to edit mode.

Walkthrough

Adds an optional createdBy field to the todo form data and displays a read-only “Created By” line (with UserIcon) in the Edit Todo modal when available. Updates default form-data mapping to populate createdBy from the todo entity.

Changes

Cohort / File(s) Summary
Edit Modal UI & Form Schema
src/components/todos/create-edit-todo-form.tsx
Imports UserIcon; extends form schema/type with createdBy?: { label: string; value: string }; conditionally renders a read-only “Created By” row in edit mode showing initialData.createdBy.label.
Default Form Data Mapping
src/lib/todo-util.ts
Extends getDefaultTodoFormData to map todo.createdBy to { label: todo.createdBy.name, value: todo.createdBy.id }, otherwise undefined, aligning with the updated form data shape.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant EditTodoModal as Edit Todo Modal
  participant Form as CreateEditTodoForm
  participant Util as TodoUtil.getDefaultTodoFormData

  User->>EditTodoModal: Open Edit Todo
  EditTodoModal->>Util: Build initial form data from todo
  Util-->>EditTodoModal: { ..., createdBy?: {label, value} }
  EditTodoModal->>Form: Render with initialData, mode='edit'
  alt createdBy present
    Form-->>User: Show "Created By" (read-only) with UserIcon
  else no createdBy
    Form-->>User: Do not render "Created By"
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • yesyash

Poem

I twitch my whiskers, proud and spry,
A note now whispers: “Created by.”
In edit fields where carrots lie,
The maker’s name hops into sky.
Thump-thump! The trail’s no longer shy—
Tasks and burrows verified. 🥕🐇

Pre-merge checks

✅ Passed checks (5 passed)
Check name Status Explanation
Title Check ✅ Passed The title "feat: show created by in Edit Todo modal" is concise, directly reflects the primary change (adding a "Created By" display in the Edit Todo modal), and is appropriate for team history and quick scanning.
Linked Issues Check ✅ Passed The changes satisfy the coding objectives of issue #200: the Edit Todo modal now displays the creator's name in edit mode (renders initialData.createdBy.label), TodoUtil maps todo.createdBy into the form data, and the exported TTodoFormData includes an optional createdBy field; there are no database changes or unrelated additions, so the linked-issue requirements are met.
Out of Scope Changes Check ✅ Passed All modifications are limited to adding and surfacing the createdBy field (create-edit-todo-form.tsx and todo-util.ts) and do not introduce unrelated functionality or modify other modules, so no out-of-scope changes were detected.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed The PR description explicitly states it adds a "Created By" field to the Edit Todo modal and references the related issue (#200); this aligns with the code changes that introduce a createdBy field in the form schema and render it in edit mode, so the description is on-topic and relevant to the changeset.

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.

I've completed my review and didn't find any issues... but I did find this dog.

  / \__
 (    @\___
 /         O
/   (_____/
/_____/   U
Files scanned
File Path Reviewed
src/lib/todo-util.ts
src/components/todos/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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce7e497 and a985e7d.

📒 Files selected for processing (2)
  • src/components/todos/create-edit-todo-form.tsx (3 hunks)
  • src/lib/todo-util.ts (1 hunks)
🧰 Additional context used
🪛 ESLint
src/components/todos/create-edit-todo-form.tsx

[error] 19-19: Unable to resolve path to module 'lucide-react'.

(import-x/no-unresolved)

🔇 Additional comments (2)
src/components/todos/create-edit-todo-form.tsx (2)

43-49: Schema addition looks good
Optional createdBy object with label/value (string) is fine. With the util change to String(todo.createdBy.id), types will stay consistent end-to-end.


19-19: Fix ESLint: cannot resolve 'lucide-react'

package.json contains [email protected] but node_modules weren't present in the verification run; the import-x/no-unresolved error is caused by missing installs or resolver misconfiguration.

  • Actions: install deps (npm ci / pnpm install), confirm ESLint import/resolver (node / typescript / webpack) can resolve node_modules.
  • Confirm the named exports in src/components/todos/create-edit-todo-form.tsx (CalendarIcon, CircleDotIcon, LucideIcon, PlayIcon, TagIcon, UserIcon) exist in [email protected] and adjust imports if necessary.

src/components/todos/create-edit-todo-form.tsx:19

@MayankBansal12
Copy link
Member

@shobhan-sundar-goutam do we also have to remove createdBy column from the table?

@shobhan-sundar-goutam
Copy link
Contributor Author

@shobhan-sundar-goutam do we also have to remove createdBy column from the table?

Thanks for pointing this out. I had asked about the product requirement and Ankush asked to include the removal of createdBy column from the table in this task only. I've made the code changes. Please check

AnujChhikara
AnujChhikara previously approved these changes Sep 15, 2025
Copy link
Member

@iamitprakash iamitprakash left a comment

Choose a reason for hiding this comment

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

this issue ticket doesn't talk about removing column from grid #200

@shobhan-sundar-goutam
Copy link
Contributor Author

this issue ticket doesn't talk about removing column from grid #200

Ankush had asked me to include the removal of column in this task only
Ref - #204 (comment)

Shall I create a different issue ticket and attach it here or include it in the same issue ticket? Please let me know what should I do

@iamitprakash
Copy link
Member

@shobhan-sundar-goutam do we also have to remove createdBy column from the table?

Thanks for pointing this out. I had asked about the product requirement and Ankush asked to include the removal of createdBy column from the table in this task only. I've made the code changes. Please check

This is not captured in ticket, so I am got going to trust on verbal comments, please make changes only to issues mentioned. Till now your PR will be on hold. Thank you

)}
/>

{mode === 'edit' && initialData?.createdBy && (
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 really need this check

&& initialData?.createdBy

Comment on lines +43 to +48
createdBy: z
.object({
label: z.string(),
value: z.string(),
})
.optional(),

Choose a reason for hiding this comment

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

  • we have added createdBy in the zod schema, but we're not passing it in the default value object in useForm. Can you please pass it there, similar to the assignee?

Comment on lines 337 to 340
<FormInput label="Created By" icon={UserIcon}>
<p className="pl-3 text-sm text-gray-700">{initialData.createdBy.label}</p>
</FormInput>
)}

Choose a reason for hiding this comment

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

  • i would suggest using a input / selct and style it accordingly to look like text and make it disabled so that it is consistent with other inputs in the form.

@cloudflare-workers-and-pages
Copy link

Deploying todo-frontend with  Cloudflare Pages  Cloudflare Pages

Latest commit: b8e8394
Status: ✅  Deploy successful!
Preview URL: https://c055eb26.todo-frontend-76p.pages.dev
Branch Preview URL: https://feat-show-created-by-in-edit.todo-frontend-76p.pages.dev

View logs

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

7 participants