-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable manual path entry in the new profile assistant #1119
Conversation
(CI fails not related to the PR.) |
Did CI produce a build as an artifact? It looks like it did not.
I then tried to figure out how to narrow the scope of stuff it attempts to build and decided that what I needed was just
I don't understand what's wrong here.
and then inside:
edit: I also tried building in a debian-based container, but got the same result. |
Yes, yes it did. Are you not able to see the artifacts? If you do not see them directly then you have to click on 'Summary' or on 'CI' (the link name is different depending on where you start from).
I fail to see why you'd need to understand the build script at all. You seemed to have followed the wrong docs if you missed the essentials; they're pretty hard to miss.
No, not related to macos. The errors are about
The error is explained in the output, though. "
That should work (provided lablgtk3 is installed). The error you're seeing is not coming from Unison's code. It would be of great help if you could figure out why you're seeing the error you're seeing. Could it be an issue with gcc or musl installation or the environment? Are you seeing the same error in Debian, too, or did you refer to the missing lablgtk only? |
There are two ways to get to the artifacts. Either click on any of the 'Details' links you see and then on 'Summary' on the left hand side. Or click on 'Checks' on the very top of the PR (above first comment) and then click on 'CI' on the left hand side. |
Are you suggesting
|
I'd suggest some wording like "file or directory".
Another nitpick would be to limit the 2nd file picker's scope to the type (dirs XOR files) selected for the 1st field, to avoid a possible collision of user erroneously creating a file-to-dir sync. |
But why? Are you suggesting that most users would want to enter the paths manually? Has this something to do with wanting to sync single files or do you just think that the assistant has always been wrong? I'm not specifically against this change but it needs to be motivated. (Or maybe you have good examples of how it's been done in other software?)
That is not possible (as far as I know), as I already wrote in the other ticket. This is a limitation of GTK (and possibly native pickers). You can make it choose either files only or directories only.
Just to be clear, that's how the patch works currently.
It may make sense for the assistant, but I'm not going to spend any effort on this. If a user accidentally ends up with such a collision then they can simply cancel the first sync and either modify or delete and recreate the profile. |
No, I believe most users would use the button to open a dir/file picker, rather than specify the path manually.
What a weird limitation. All my further suggestions were based on this point, they don't make much sense if it's truly impossible to make a file picker allow users to select ANY(dir,file). |
I looked into implementing your first suggestion but I don't know how to make it happen with GTK. The file picker button has a mind of its own and will not allow it to be constrained into a button. (It may be possible, I just don't know how.) Alternatively, it could be possible to use a regular button and make it open the file chooser dialog, but I don't think lablgtk exposes the API for that. Examples from other software could help, otherwise the only thing I can do right now is to remove the "enter paths manually" button (so the text fields are always visible). @gdt any preference? |
Honestly I'm not sure it's really a good idea to put this in profile creation at all, but I don't feel that it's reasonable to object. As I see it unison synchronizes trees rooted at a directory, and while it works with files, that's a special case that to me feels degenerate. So people editing the config file seems fine, but I'm a command line, ed(1) type and I know I'm not typical. The UI as it is in the PR I find confusing (well, I know what is there and why, but I think it would be confusing). Two separate thoughts:
I realize my 2nd suggestion seems like work, but I think it will avoid confusing people. It also hoists the hint, which I like to avoid, into the checkbox of "sync two files rather than two directories". |
Well... your second thought is actually almost what I had in mind initially, yet didn't want to implement due to thinking it would be more confusing to users. Now that I think about it, in that case we don't need text entry boxes at all. The checkbox can simply mutate the type of file choosers between dir/file. |
Or maybe even a radiobutton with 2 states "Sync 2 dirs" and "Sync 2 files"? |
GTK file chooser allows selecting either files or directories but not both. File choosers in the new profile assistant were configured for selecting directories, with the expectation that this covers the vast majority of usages. This patch adds an option for the user to choose files instead of directories, enabling specifying single files as sync roots.
I went ahead and implemented what I initially didn't want to implement. But the effort is now spent anyway, so oh well. In the end, while the code is a bit more complicated now, I actually kind of like the outcome. Have a look and see what you think. |
I think it looks way better now. |
This is great; the display is really easy to understand. Putting the file/directory in a menu is genius; it reads naturally and screams at the reader that it can be changed, and thus there's no giant hint for an odd situation demanding to be be read - once you've grasped that you can ignore it, if you're a sync-dirs type. Or not, if you like files. I tested clicking around a bit, and the only thing I found, which is minor, is that switching file->dir not only leaves the file, but it ends up in the gtk picker's history so you can go to a dir and then back to the file. But, things are overall vastly better than they are now, so I'm ok with merging with that nit, and I'm ok with another force push. Let me know. |
I don't think I'm going to do anything about the file-dir mixup issue. I don't want to blindly clear the selections (I really dislike software that does this -- if I want to simply explore what some option does and then all my configuration is wiped clean, that's a big no-no). Adding the complexity of actually stat-ing whether something is a file or dir does not seem reasonable either. In the end, even if there is a mixup, nothing will directly break, even if it is an inconvenience for the user. If this turns out to be a nuisance for users then we can come back to it. |
Your logic makes sense and that works for me. So ready to hit merge? |
As far as I'm concerned, ready to merge. |
This is a complete fix for #1116. The GUI currently does not allow skipping the assistant (one can manually configure the profile more freely once past the assistant). This patch adds optional manual entry for sync paths so that more advanced users can get through it with less hassle.