Skip to content

Conversation

OwenCoogan
Copy link
Contributor

What does this PR do?

https://www.loom.com/share/06028ccaa77b4edcb88b9c315d522b94

Related to: #

What are the observable changes?

Good PR checklist

  • Title makes sense
  • Is against the correct branch
  • Only addresses one issue
  • Properly assigned
  • Added/updated tests
  • Added/updated documentation
  • Migrated touched components to Glimmer Components
  • Properly labeled

@OwenCoogan OwenCoogan self-assigned this Jul 8, 2025
Copy link

linear bot commented Jul 8, 2025

@OwenCoogan OwenCoogan marked this pull request as ready for review September 16, 2025 09:23
cursor[bot]

This comment was marked as outdated.

Copy link
Member

@Miexil Miexil left a comment

Choose a reason for hiding this comment

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

Lots of questions - but nothing is explained in the PR so 🤷

Inputs are the core of our application, if we mess things up here, bugs & defects will rain.

Comment on lines +47 to +52
get onChangeHandler() {
return (value: string | null) => this.validateInput(value);
}

@action
validateInput(): void {
this.regexError = '';
this.args.onChange?.(this.args.value ? this.args.value.toLowerCase() : this.args.value);
validateInput(value: string | null): void {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I understand these changes 🤔
Why do we need to use a getter for the validateInput ?
and why is the regexError reset logic moved ?

autocomplete={{this.autocomplete}}
class="upf-input"
{{on "keyup" (fn this._onChange @value)}}
{{on "input" this.onInput}}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to add an on input listener ?


@action
onKeyUp(event: KeyboardEvent): void {
if (event.key === 'Backspace' && this.args.value === null) {
Copy link
Member

Choose a reason for hiding this comment

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

Again, why change the logic here ?

disabled={{or this.isMinDisabled @disabled}} {{enable-tooltip title=this.minTooltipTitle placement="top"}} />
{{! template-lint-disable no-triple-curlies}}
<OSS::InputContainer @value={{this.localValue}} @onChange={{this.checkUserInput}} @disabled={{@disabled}} style={{{this.dynamicWidth}}}
<OSS::InputContainer @value={{this.localValue}} @onChange={{fn this.checkUserInput}} @disabled={{@disabled}} style={{{this.dynamicWidth}}}
Copy link
Member

Choose a reason for hiding this comment

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

why is the fn added ?

Comment on lines +78 to +80
if (value !== undefined) {
this.localValue = Number(value);
}
Copy link
Member

Choose a reason for hiding this comment

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

?

await fillIn('input', 'fakedomai');
await typeIn('input', 'n');
assert.true(this.onChange.calledOnceWithExactly('fakedomain', true));
assert.true(this.onChange.lastCall.calledWith('fakedomain', true));
Copy link
Member

Choose a reason for hiding this comment

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

If the test needs to be updated, it means the logic has changed somewhere - is this expected ?

Copy link
Member

Choose a reason for hiding this comment

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

Same as the other locations, why are we making these changes ?

@action
onKeyUp(event: KeyboardEvent): void {
if (event.key === 'Backspace' && this.args.value === null) {
this.args.onChange?.(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

You are not afraid about 2 possibles calls of this.args.onChange in the component if we are using 2 different events?

(this.sliderOptions.max - this.sliderOptions.min),
1
);
return Math.min(Math.max(convertedValue + correction - min, 0) / (max - min), 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why base the min / max value on this.args.max/min?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants