Skip to content

Fix: Editing time entries. #1178

Open
ayushnirwal wants to merge 6 commits intofeat/redesignfrom
fix/textarea-input
Open

Fix: Editing time entries. #1178
ayushnirwal wants to merge 6 commits intofeat/redesignfrom
fix/textarea-input

Conversation

@ayushnirwal
Copy link
Copy Markdown
Collaborator

@ayushnirwal ayushnirwal commented Apr 6, 2026

Description

  • Use TextEditor from frappe-ui-react instead of textarea.

Screenshot/Screencast

Screenshot 2026-04-06 at 7 33 07 PM Screenshot 2026-04-06 at 7 32 39 PM Screenshot 2026-04-06 at 8 33 26 PM

Checklist

  • I have carefully reviewed the code before submitting it for review.
  • This code is adequately covered by unit tests to validate its functionality.
  • I have conducted thorough testing to ensure it functions as intended.
  • A member of the QA team has reviewed and tested this PR (To be checked by QA or code reviewer)

Fixes #916

Signed-off-by: ayushnirwal <53055971+ayushnirwal@users.noreply.github.com>
Signed-off-by: ayushnirwal <53055971+ayushnirwal@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates timesheet comment/description inputs to use the TextEditor component from @rtcamp/frappe-ui-react, aiming to improve editing behavior for time entry comments.

Changes:

  • Replaced Textarea with TextEditor in team weekly approval entry editing.
  • Replaced Textarea with TextEditor in the “Add time” dialog comment field.
  • Replaced Textarea with TextEditor in the inline time-entry form comment field.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
frontend/packages/app/src/pages/timesheet/team/weekly-approval/entryRow.tsx Swaps comment editing UI from Textarea to TextEditor for weekly approval entries.
frontend/packages/app/src/pages/timesheet/components/add-time/index.tsx Uses TextEditor for the “Add time” comment field.
frontend/packages/app/src/components/timesheet-row/components/inline-time-entry/timeEntryForm.tsx Uses TextEditor for inline entry comments in add/edit flows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: ayushnirwal <53055971+ayushnirwal@users.noreply.github.com>
Signed-off-by: ayushnirwal <53055971+ayushnirwal@users.noreply.github.com>
Comment on lines 316 to 327
{!isExpanded ? (
<span
className={cn(
"w-full min-w-0 text-base truncate text-ink-gray-6",
{
"group-hover:pr-4 group-focus-within:pr-4":
!disabled,
},
)}
>
{entry.description}
</span>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is shown when the time entry is minimized. I think we should strip any HTML from the description and display only plain text here.

We can add a simple stripTags utility function I think.

Screen.Recording.2026-04-07.at.2.25.03.PM.mov

onChange={(val) => setDescription(val)}
fixedMenu={false}
placeholder="Comment"
editorClass="h-24 overflow-scroll bg-white border rounded-md border-outline-gray-2"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Wherever overflow-scroll is used, replace it with overflow-auto so the scrollbar is only visible when the content exceeds the container height. At the same time, add scrollbar or scrollbar-thin classes to maintain consistent scrollbar styling across the application.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Current:

Screenshot 2026-04-07 at 2 45 17 PM

With overflow-auto:

Screenshot 2026-04-07 at 2 46 05 PM

Comment on lines +269 to +273
<TextEditor
content={field.state.value}
onChange={(value) => field.handleChange(value)}
fixedMenu={false}
editorClass="h-24 overflow-scroll bg-white border rounded-md border-outline-gray-2"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

content={field.state.value}
onChange={(value) => field.handleChange(value)}
fixedMenu={false}
editorClass="h-24 overflow-scroll bg-white border rounded-md border-outline-gray-2"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add px-2 padding to the TextEditor when in edit mode so the text is not close to the container border.

Current:
Image

With Padding:
Image

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Apply everywhere where TextEditor component is used with edit mode.

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.

3 participants