Skip to content

Conversation

@olmoh
Copy link
Collaborator

@olmoh olmoh commented Jan 15, 2026

  • Adds a new secondary variant to TextField
  • Adds SearchTextField component
  • Uses new TextField in select location view

Fixes DES-2739


This change is Reviewable

@linear
Copy link

linear bot commented Jan 15, 2026

@olmoh olmoh force-pushed the add-secondary-variant-to-textfield-des-2746 branch from 136189f to c10c769 Compare January 15, 2026 12:35
@olmoh olmoh marked this pull request as ready for review January 15, 2026 13:09
@olmoh olmoh requested a review from tobias-jarvelov January 15, 2026 13:09
Copy link
Contributor

@tobias-jarvelov tobias-jarvelov left a comment

Choose a reason for hiding this comment

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

@tobias-jarvelov reviewed 29 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @olmoh).


desktop/packages/mullvad-vpn/src/renderer/components/search-text-field/SearchTextField.tsx line 21 at r1 (raw file):

    onValueChange?.(debouncedValue);
  }, [debouncedValue, onValueChange]);

thought: Would it make sense to use useDeferredValue instead of useDebounce? If we use useDebounce to unblock the UI while entering text then useDeferredValue is potentially a better suited candidate for that purpose.

Code quote:

  const [internalValue, setInternalValue] = React.useState(value);
  const debouncedValue = useDebounce(internalValue, internalValue === '' ? 0 : delay);

  React.useEffect(() => {
    if (debouncedValue === undefined) {
      return;
    }

    onValueChange?.(debouncedValue);
  }, [debouncedValue, onValueChange]);

desktop/packages/mullvad-vpn/src/renderer/lib/components/text-field/README.md line 4 at r1 (raw file):

A text input component based on the html `<input>` element. Can be used in conjunction with the
`useTextField` hook for managing state and validation.

praise: Love that you took the time to add this README 🎉

Code quote:

# Text Field

A text input component based on the html `<input>` element. Can be used in conjunction with the
`useTextField` hook for managing state and validation.

desktop/packages/mullvad-vpn/test/e2e/route-object-models/select-location/select-location-route-object-model.ts line 8 at r1 (raw file):

export class SelectLocationRouteObjectModel {
  public readonly selectors: ReturnType<typeof createSelectors>;

issue: Making the selectors public and using them in the test breaks the encapsulation the Route Object Model class provides, however more importantly it calls into question the reason of being for the Route Object Models. Before we make this change we should discuss this.

@olmoh olmoh force-pushed the add-secondary-variant-to-textfield-des-2746 branch from c10c769 to 3b255fc Compare January 22, 2026 14:54
Copy link
Collaborator Author

@olmoh olmoh left a comment

Choose a reason for hiding this comment

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

@olmoh made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @tobias-jarvelov).


desktop/packages/mullvad-vpn/src/renderer/components/search-text-field/SearchTextField.tsx line 21 at r1 (raw file):

Previously, tobias-jarvelov (Tobias Järvelöv) wrote…

thought: Would it make sense to use useDeferredValue instead of useDebounce? If we use useDebounce to unblock the UI while entering text then useDeferredValue is potentially a better suited candidate for that purpose.

Done. Nice, suggestion, useDeferredValue should work great in this case.


desktop/packages/mullvad-vpn/test/e2e/route-object-models/select-location/select-location-route-object-model.ts line 8 at r1 (raw file):

Previously, tobias-jarvelov (Tobias Järvelöv) wrote…

issue: Making the selectors public and using them in the test breaks the encapsulation the Route Object Model class provides, however more importantly it calls into question the reason of being for the Route Object Models. Before we make this change we should discuss this.

Done. Reverted this as we discussed, did not apply the changes we discussed to all tests in select-location since I imagine these will change a lot as we rewrite the view.

@olmoh olmoh requested a review from tobias-jarvelov January 23, 2026 09:03
@olmoh olmoh force-pushed the add-secondary-variant-to-textfield-des-2746 branch from 3b255fc to afc9c19 Compare January 23, 2026 15:31
Copy link
Contributor

@tobias-jarvelov tobias-jarvelov left a comment

Choose a reason for hiding this comment

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

Code looks good, nicely done! However we have a conflict in MtuSetting.tsx which needs to be resolved before we can merge this.

@tobias-jarvelov reviewed 6 files and all commit messages, made 2 comments, and resolved 2 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved.


desktop/packages/mullvad-vpn/test/e2e/route-object-models/select-location/select-location-route-object-model.ts line 8 at r1 (raw file):

Previously, olmoh (Oliver Mohlin) wrote…

Done. Reverted this as we discussed, did not apply the changes we discussed to all tests in select-location since I imagine these will change a lot as we rewrite the view.

LGTM

@olmoh olmoh force-pushed the add-secondary-variant-to-textfield-des-2746 branch from afc9c19 to 4291c96 Compare January 26, 2026 16:25
@olmoh olmoh requested a review from tobias-jarvelov January 26, 2026 16:25
Copy link
Contributor

@tobias-jarvelov tobias-jarvelov left a comment

Choose a reason for hiding this comment

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

:lgtm:

@tobias-jarvelov reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved.

@tobias-jarvelov tobias-jarvelov merged commit ab6c738 into main Jan 26, 2026
15 checks passed
@tobias-jarvelov tobias-jarvelov deleted the add-secondary-variant-to-textfield-des-2746 branch January 26, 2026 16:35
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