Skip to content

Sireesha - Peterson removed all spaces in the search input text to avoid an empty table.#4151

Closed
peterson337 wants to merge 10 commits into
developmentfrom
peterson-fix-trim-input-prevent-empty-table
Closed

Sireesha - Peterson removed all spaces in the search input text to avoid an empty table.#4151
peterson337 wants to merge 10 commits into
developmentfrom
peterson-fix-trim-input-prevent-empty-table

Conversation

@peterson337

Copy link
Copy Markdown
Contributor

Description

This PR was opened to remove trailing spaces from the search input text to ensure the badge table is filtered correctly.

Related PRS (if any):

None.

Main changes explained:

The AssignBadgePopup.jsx component has been modified to fix the bug.

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. Clear site data/cache
  4. Log in as an admin or owner user
  5. go to view profile → Assign Badges
  6. Type the full name of a badge and add a space, then check if the table still shows the badge correctly.

Screenshots or videos of changes:

Before my fix:

Before.my.fix.mp4

After my fix:

After.my.fix.mp4

Note:

None.

@peterson337 peterson337 added the do not review Do not review or look at code without full context label Oct 2, 2025
@netlify

netlify Bot commented Oct 2, 2025

Copy link
Copy Markdown

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 19332c7
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/68ddc20a37fbd80009e96108
😎 Deploy Preview https://deploy-preview-4151--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@peterson337 peterson337 removed the do not review Do not review or look at code without full context label Nov 26, 2025
@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Apr 25, 2026

@kunchalasireesha kunchalasireesha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR currently has merge conflicts with the base branch. Could you please rebase or merge the latest changes from development

@rapolusidhartha

Copy link
Copy Markdown
image Cant able to load the profile tab

@rapolusidhartha rapolusidhartha left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Profile page is not working

@rajanidi1999 rajanidi1999 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi,
Everything is working as expected.

Image

saurabhdipte
saurabhdipte previously approved these changes May 2, 2026

@saurabhdipte saurabhdipte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi Peterson,

I tested the changes locally and everything is working as mentioned.

Image

@DeepighaJ DeepighaJ left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi

The page is not loading after clicking View Profile.

Image

@Jaden300 Jaden300 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Profile page fails to load and displays a blank/loading state when navigating to Assign Badges under View Profile.

The application throws an authorization error (“unauthorized to access resource”) and fails to retrieve the currently logged-in user email, indicating a broken API/auth flow in the current branch state.

As a result, the Assign Badge popup and profile view are not functional in the current build.

This issue appears to block core functionality and matches previously reported problems with the profile page not loading.

Requesting changes due to broken profile rendering and authentication/API failures.

Image

amaresh2001
amaresh2001 previously approved these changes May 28, 2026

@amaresh2001 amaresh2001 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Functional Testing:

Tested locally on the branch peterson-fix-trim-input-prevent-empty-table.

Main bug fix:

  • Typing badge name with trailing space → table still filters and shows correct results
  • Typing badge name with multiple trailing spaces → filters correctly

Edge cases:

  • Typing badge name with leading space → filters correctly
  • Typing only spaces → table shows all results
  • Typing badge name with extra spaces in the middle → handled correctly
  • Dark mode → Assign Badges popup displays correctly
Image Image Image Image Image

@Mahitha-pasupuleti Mahitha-pasupuleti left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi Peterson,

I tested the changes locally and everything is working as mentioned.

Image Image Image Image

@handikaharianto handikaharianto left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi @peterson337 , I just tested your changes. Everything works properly as shown below.

Image Image Image

YSWFelicity
YSWFelicity previously approved these changes Jun 14, 2026

@YSWFelicity YSWFelicity left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved.

Tested on staging and reviewed the code changes. I wasn't able to reach the Assign Badges modal to fully verify the fix, but the implementation looks correct and I didn't find any issues.

Looks good to me.

Image Image Image

@Abhi-R0211 Abhi-R0211 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi, here is my analysis for this PR:

What's Working Well

  • Trailing space: typing a badge name with a trailing space still filters and shows the correct badge
  • Leading space: typing a badge name with a leading space filters correctly
  • Spaces only: typing only spaces shows all badges (no empty table)
  • Assign Badges popup layout looks clean and correct in light mode
Image Image Image

Issues That Need To Be Addressed

  1. Dark mode - column headers not visible in Assign Badges popup
    In dark mode, the "Badge" and "Name" column headers in the popup are invisible. The header text color blends into the dark background, making the table legend unreadable. In light mode these headers display correctly. The header row styling needs a dark mode color update to ensure proper contrast.
Image

@pixelpix13

Copy link
Copy Markdown

Hey Peterson,
Tested the Assign Badges search behavior locally.

Verified

  • Searching the full badge name works correctly.
  • Adding trailing spaces after the badge name does not break the search result.
  • The badge table still shows the expected badge when the input has trailing whitespace.

Trailing Space Handling

The primary issue appears to be fixed. Badge search continues to work when trailing spaces are added to the search input.


Question / Clarification

Spaces in the middle of the search text are also ignored. For example, searching with additional spacing between words still returns the badge.

Please confirm whether this behavior is intentional or if only leading/trailing spaces were meant to be ignored.

Screenshot

image

Dark Mode

Verified that the table header remains visible and readable in dark mode.

Screenshot

image

Visual Checkbox Issue

The checkbox functionality appears to work correctly, but the visual state does not update properly.

Observed behavior:

  • Clicking a checked checkbox functionally unchecks it.
  • However, the checkbox does not clearly indicate that it has become unchecked.
  • The visual state appears inconsistent with the actual selected state.

Expected behavior:

  • The checkbox should clearly show both checked and unchecked states.
  • Visual feedback should remain consistent in dark mode.

Summary

Verified that the trailing-space search issue is resolved.

The only remaining concern is the checkbox visual state, which appears to be a UI issue rather than a functional issue.

@AmaanSyed09 AmaanSyed09 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi Peterson,

I reviewed the changes in AssignBadgePopup.jsx and examined the updated search logic.

Observations:
• The new implementation normalizes both badge names and user input using .replace(/\s+/g, '') before filtering.
• This removes all whitespace, not just leading or trailing spaces.
• As a result, searches with additional spaces between words may still return matches.

Testing Performed:
• Checked out branch peterson-fix-trim-input-prevent-empty-table.
• The PR currently has merge conflicts.
• npm install initially produced an ERESOLVE dependency conflict involving @vitest/ui and vitest, but installation completed successfully using npm install --legacy-peer-deps.
• Launched the application locally and attempted to follow the testing instructions.
• I was able to access user profile pages but could not access the Assign Badges popup.
• Further investigation in Badges.jsx showed that the Assign Badges button is only rendered when the user has either the assignBadges or assignBadgeOthers permission.
• The available test account does not appear to have either permission, so I was unable to access the popup and complete the UI testing steps.
• As a result, this review is based primarily on code inspection and limited application testing.

Question:
• Was the intention to ignore only leading/trailing spaces, or should all whitespace within the search text be ignored? With the current implementation, every whitespace character is removed before comparison.

Screenshots attached.

Image Image Image

@Dnagabahiru Dnagabahiru left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello
The page is not loading after clicking View Profile.

Image Image Image

@pixelpix13 pixelpix13 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey Peterson,
Tested the Assign Badges search behavior locally.

Verified

  • Searching the full badge name works correctly.
  • Adding trailing spaces after the badge name does not break the search result.
  • The badge table still shows the expected badge when the input has trailing whitespace.

Trailing Space Handling

The primary issue appears to be fixed. Badge search continues to work when trailing spaces are added to the search input.


Question / Clarification

Spaces in the middle of the search text are also ignored. For example, searching with additional spacing between words still returns the badge.

Please confirm whether this behavior is intentional or if only leading/trailing spaces were meant to be ignored.

Screenshot

image

Dark Mode

Verified that the table header remains visible and readable in dark mode.

Screenshot

image

Visual Checkbox Issue

The checkbox functionality appears to work correctly, but the visual state does not update properly.

Observed behavior:

  • Clicking a checked checkbox functionally unchecks it.
  • However, the checkbox does not clearly indicate that it has become unchecked.
  • The visual state appears inconsistent with the actual selected state.

Expected behavior:

  • The checkbox should clearly show both checked and unchecked states.
  • Visual feedback should remain consistent in dark mode.

Summary

Verified that the trailing-space search issue is resolved.

The only remaining concern is the checkbox visual state, which appears to be a UI issue rather than a functional issue.

@netlify

netlify Bot commented Jun 25, 2026

Copy link
Copy Markdown

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 185d269
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6a491ab3f13669000805204b
😎 Deploy Preview https://deploy-preview-4151--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@kunchalasireesha kunchalasireesha changed the title Peterson removed all spaces in the search input text to avoid an empty table. Sireesha - Peterson removed all spaces in the search input text to avoid an empty table. Jul 3, 2026
…odNetworkApp into peterson-implement-three-features-on-user-management-page-2
…com:OneCommunityGlobal/HighestGoodNetworkApp into peterson-fix-trim-input-prevent-empty-table
…odNetworkApp into peterson-fix-trim-input-prevent-empty-table
@sonarqubecloud

sonarqubecloud Bot commented Jul 4, 2026

Copy link
Copy Markdown

@one-community

Copy link
Copy Markdown
Member

Replaced by with this: #5370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.