refactor(web): network connection form UX (part 5)#3352
refactor(web): network connection form UX (part 5)#3352dgdavid merged 6 commits intoenhance-network-connection-formfrom
Conversation
Returns a unique auto-generated connection name based on a type string and binding options (mode, interface name, MAC address). If the base name is already taken by an existing connection, a numeric suffix is appended (e.g. "ethernet_2").
When creating a new connection, the Name field is pre-filled with a value derived from the connection type and the selected binding (e.g. "ethernet", "ethernet_enp1s0", "ethernet_001122334455"). The name updates reactively as the user changes the binding or device. Once the user manually edits the name field, auto-filling stops.
|
I'm not advocating for it, but note it is not unusual to have spaces in the connection names (starting with a capital letter). For example, the default connection created during the live-ISO boot is called "Wired connection 1". Also, if I use the applet from my desktop and select "New connection" -> "Ethernet" I get the name pre-filled as "Ethernet connection 1". And for WiFi connections, it is quite common to use the ESSID to name of the connection. Having said so, I have nothing against the suggested names in this PR. They look like names I myself would have used. 😉 |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Making them more human readable, check * #3352 (comment) * https://www.networkmanager.dev/docs/api/latest/settings-connection.html
Done! Check 5f353c1. As said, different format (adding the work connection, omitting the device, whatever) can be changed later by somebody. |
|
Two weird things I found during manual testing regarding editing a connection:
Maybe the second one is not that much related to this pull request, but about the nature of editing connections as a concept. |
Thanks a ton for such a testing. Both were overlooked by me. The first one is quite weird, but I guess easy to fix. The second one was totally out of the scope of this refactor because there would be a serie of follow-up PRs adding the ability of creating/editing different types of connections. While Wi-Fi can be already created because historical reasons, it deserves some love yet. In short, for a separated PR in the context of extending the network support. |
When switching from "Any device" binding mode, the device selector is empty with no device selected. An onMount listener now sets the first available device if the field has no value, using `dontUpdateMeta` to keep the pre-fill transparent to form state.
Fixed with c5f398b About |
Built on top of #3352, this PR fixes a small but noticeable UX gap found while recording the screencast for the referenced PR: when switching between "Chosen by name" and "Chosen by MAC" binding modes, the device selection was lost and the user had to re-pick it. To fix it, one of the components has gained the ability to trigger listeners on demand, making it possible to wire the two different selectors instantiated under the hood and keep them in sync. Note that although only one instance is mounted at a time and there is no real risk of listener loops, `dontRunListeners: true` is still passed to the `setFieldValue` call inside the listener as a safety net. Related to: * https://tanstack.com/form/latest/docs/framework/react/guides/listeners * TanStack/form#1680 * TanStack/form#2104
Prepare to release version 20. * #3294 * #3295 * #3296 * #3297 * #3298 * #3299 * #3300 * #3301 * #3302 * #3303 * #3304 * #3305 * #3306 * #3307 * #3308 * #3309 * #3310 * #3311 * #3312 * #3313 * #3315 * #3316 * #3317 * #3318 * #3319 * #3320 * #3322 * #3323 * #3325 * #3326 * #3327 * #3329 * #3330 * #3331 * #3333 * #3334 * #3336 * #3338 * #3339 * #3342 * #3343 * #3349 * #3351 * #3352 * #3353 * #3354 * #3356 * #3357 * #3358 * #3359 * #3360 * #3361 * #3362 * #3363 * #3364 * #3365 * #3366 * #3367 * #3368 * #3371 * #3372 * #3373 * #3375 * #3376 * #3378 * #3379 * #3380 * #3381 * #3382 * #3385 * #3386
A continuation of network connection form reimplementation, built on top of #3351.
It prefills connection name when creating a new connection with a value based based on the connection type and the selected binding:
The name updates reactively as the user changes the binding or device selection. Once the user manually edits the Name field, auto-filling stops.
If the base name is already taken by an existing connection, a numeric suffix is appended (
ethernet_2,ethernet_3, etc).Check the not so good screencast below
auto-generated-connection-name.mp4
Interesting reading:
Notes for reviewers