Skip to content

Conversation

@borgateo
Copy link
Contributor

@borgateo borgateo commented Jul 21, 2025

Reviewer: @dbajpeyi @GioSensation
Asana: N/D

Description

Update to Debug Form:

  1. Implemented a combobox for improved UX.
  2. Added a button to sort items alphabetically.

Screenshots

Screenshot 2025-07-20 at 22 33 40

padding: 1em;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2);
grid-area: header;
display: flex;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: Would move out the style to a file at this point.

Comment on lines +119 to +144
state.comboboxInput.addEventListener('keydown', (e) => {
switch (e.key) {
case 'ArrowDown':
e.preventDefault();
if (!state.isOpen) {
openDropdown();
} else {
highlightNext();
}
break;
case 'ArrowUp':
e.preventDefault();
highlightPrevious();
break;
case 'Enter':
e.preventDefault();
if (state.isOpen && state.highlightedIndex >= 0) {
selectOption(state.highlightedIndex);
}
break;
case 'Escape':
e.preventDefault();
closeDropdown();
break;
}
});
Copy link
Collaborator

@dbajpeyi dbajpeyi Jul 22, 2025

Choose a reason for hiding this comment

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

e.preventDefault(); call can be de-duplicated?

Comment on lines +64 to +65
// Clear existing options
state.comboboxDropdown?.innerHTML && (state.comboboxDropdown.innerHTML = '');
Copy link
Collaborator

@dbajpeyi dbajpeyi Jul 22, 2025

Choose a reason for hiding this comment

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

Suggested change
// Clear existing options
state.comboboxDropdown?.innerHTML && (state.comboboxDropdown.innerHTML = '');
// Clear existing options
if(state.comboboxDropdown) state.comboboxDropdown.innerHTML = '');

More readable and simple expression in this case. Also this is a pattern we use in autofill already!

@dbajpeyi
Copy link
Collaborator

dbajpeyi commented Jul 22, 2025

I have a feeling - for something like this (lot of JS code, that we have to understand) - we should just use React or some UI library to reduce the maintanance effort. We might even get some widgets for free, and a much simpler UI. Just food for thought.

@GioSensation
Copy link
Member

I'm not convinced this adds a ton of value and I personally despise comboboxes in place of regular <select> elements. @borgateo Happy to chat more 1/1, but I'm inclined to drop this PR altogether vs spending more time on it. 🙂

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