Skip to content

Fix #763: preserve new lines in Additional Info textareas#766

Open
moutazsalah wants to merge 1 commit into
srbhr:mainfrom
moutazsalah:fix-additional-info-newline
Open

Fix #763: preserve new lines in Additional Info textareas#766
moutazsalah wants to merge 1 commit into
srbhr:mainfrom
moutazsalah:fix-additional-info-newline

Conversation

@moutazsalah
Copy link
Copy Markdown

@moutazsalah moutazsalah commented Apr 26, 2026

Pull Request Title

Fix #763: preserve new lines in Additional Info textareas

Related Issue

#763

Description

This pull request fixes an issue where pressing the Enter key inside Additional Info textareas did not create new lines correctly.

The problem occurred because empty strings were filtered during input handling, causing blank lines to be removed immediately after pressing Enter.

This update preserves empty lines during typing and moves filtering logic to the renderer level.

Type

  • Bug Fix
  • Feature Enhancement
  • Documentation Update
  • Code Refactoring
  • Other (please specify):

Proposed Changes

  • Removed empty-string filtering from handleArrayChange
  • Preserved newline behavior while typing in Additional Info textareas
  • Added filtering at rendering level to avoid displaying empty entries

Screenshots / Code Snippets (if applicable)

No screenshots included.

How to Test

  1. Open the Additional Info section.
  2. Type text into a textarea field.
  3. Press Enter and confirm a new line is created and preserved.

Checklist

  • The code compiles successfully without any errors or warnings
  • The changes have been tested and verified
  • The documentation has been updated (if applicable)
  • The changes follow the project's coding guidelines and best practices
  • The commit messages are descriptive and follow the project's guidelines
  • All tests (if applicable) pass successfully
  • This pull request has been linked to the related issue (if applicable)

Additional Information

This fix improves textarea usability while keeping rendered data clean by filtering empty values only during display.


Summary by cubic

Preserves new lines in Additional Info textareas. Moves empty-string filtering to render-time so pressing Enter keeps blank lines while typing.

  • Bug Fixes
    • Removed empty-string filtering in handleArrayChange to keep raw newline entries.
    • Filter out empty values when rendering (skills, languages, certifications, awards) to avoid empty pills/items.

Written for commit a2e51bd. Summary will update on new commits.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-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.

4 issues found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/frontend/components/resume/resume-modern.tsx">

<violation number="1" location="apps/frontend/components/resume/resume-modern.tsx:399">
P2: Blank-only Additional Info entries can still render an empty section/label-only row because visibility checks use raw array lengths while the new filtering only affects the displayed text.</violation>
</file>

<file name="apps/frontend/components/builder/highlighted-resume-view.tsx">

<violation number="1" location="apps/frontend/components/builder/highlighted-resume-view.tsx:138">
P2: Section visibility checks raw array length, but rendering filters blanks, causing empty subsection headings/containers when all entries are whitespace.</violation>
</file>

<file name="apps/frontend/components/resume/resume-single-column.tsx">

<violation number="1" location="apps/frontend/components/resume/resume-single-column.tsx:397">
P2: Additional Info visibility still keys off raw array length, so blank-only entries render an empty section/rows after the new blank-item filter.</violation>
</file>

<file name="apps/frontend/components/resume/resume-modern-two-column.tsx">

<violation number="1" location="apps/frontend/components/resume/resume-modern-two-column.tsx:309">
P2: Filtering blanks inside the section body without updating the outer `length > 0` guard can render empty section headings/containers when all entries are blank.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@@ -396,25 +396,33 @@ const AdditionalSection: React.FC<{
{technicalSkills.length > 0 && (
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 26, 2026

Choose a reason for hiding this comment

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

P2: Blank-only Additional Info entries can still render an empty section/label-only row because visibility checks use raw array lengths while the new filtering only affects the displayed text.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/frontend/components/resume/resume-modern.tsx, line 399:

<comment>Blank-only Additional Info entries can still render an empty section/label-only row because visibility checks use raw array lengths while the new filtering only affects the displayed text.</comment>

<file context>
@@ -396,25 +396,33 @@ const AdditionalSection: React.FC<{
           <div className="flex">
             <span className="font-bold w-32 shrink-0">{mergedLabels.technicalSkills}</span>
-            <span>{technicalSkills.join(', ')}</span>
+            <span>{technicalSkills
+            .filter((skill) => skill.trim() !== '')
+            .join(', ')}</span>
</file context>
Fix with Cubic

<div className="flex flex-wrap gap-1">
{resumeData.additional.technicalSkills.map((skill, i) => (
{resumeData.additional.technicalSkills
.filter((skill) => skill.trim() !== '')
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 26, 2026

Choose a reason for hiding this comment

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

P2: Section visibility checks raw array length, but rendering filters blanks, causing empty subsection headings/containers when all entries are whitespace.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/frontend/components/builder/highlighted-resume-view.tsx, line 138:

<comment>Section visibility checks raw array length, but rendering filters blanks, causing empty subsection headings/containers when all entries are whitespace.</comment>

<file context>
@@ -134,7 +134,9 @@ export function HighlightedResumeView({ resumeData, keywords }: HighlightedResum
                   <div className="flex flex-wrap gap-1">
-                    {resumeData.additional.technicalSkills.map((skill, i) => (
+                    {resumeData.additional.technicalSkills
+                    .filter((skill) => skill.trim() !== '')
+                    .map((skill, i) => (
                       <SkillTag key={i} text={skill} keywords={keywords} />
</file context>
Fix with Cubic

<div className="flex">
<span className="font-bold w-32 shrink-0">{mergedLabels.technicalSkills}</span>
<span>{technicalSkills.join(', ')}</span>
<span>{technicalSkills
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 26, 2026

Choose a reason for hiding this comment

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

P2: Additional Info visibility still keys off raw array length, so blank-only entries render an empty section/rows after the new blank-item filter.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/frontend/components/resume/resume-single-column.tsx, line 397:

<comment>Additional Info visibility still keys off raw array length, so blank-only entries render an empty section/rows after the new blank-item filter.</comment>

<file context>
@@ -394,25 +394,33 @@ const AdditionalSection: React.FC<{
           <div className="flex">
             <span className="font-bold w-32 shrink-0">{mergedLabels.technicalSkills}</span>
-            <span>{technicalSkills.join(', ')}</span>
+            <span>{technicalSkills
+            .filter((skill) => skill.trim() !== '')
+            .join(', ')}</span>
</file context>
Fix with Cubic

@@ -306,7 +306,9 @@ export const ResumeModernTwoColumn: React.FC<ResumeModernTwoColumnProps> = ({
<div className={baseStyles['resume-section']}>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 26, 2026

Choose a reason for hiding this comment

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

P2: Filtering blanks inside the section body without updating the outer length > 0 guard can render empty section headings/containers when all entries are blank.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/frontend/components/resume/resume-modern-two-column.tsx, line 309:

<comment>Filtering blanks inside the section body without updating the outer `length > 0` guard can render empty section headings/containers when all entries are blank.</comment>

<file context>
@@ -306,7 +306,9 @@ export const ResumeModernTwoColumn: React.FC<ResumeModernTwoColumnProps> = ({
                 <h3 className={styles.sectionTitleAccent}>{headingFallbacks.certifications}</h3>
                 <ul className={`ml-4 ${baseStyles['resume-list']} ${baseStyles['resume-text-xs']}`}>
-                  {additional.certificationsTraining.map((cert, index) => (
+                  {additional.certificationsTraining
+                                     .filter((cert) => cert.trim() !== '')
+                  .map((cert, index) => (
</file context>
Fix with Cubic

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.

[Bug]: Enter key doesn't create new lines in Additional Info textareas

1 participant