feat(ui/ux): replace "Add Tag/Field" modals with search+create bar(s) with autocomplete#1451
feat(ui/ux): replace "Add Tag/Field" modals with search+create bar(s) with autocomplete#1451CyanVoxel wants to merge 20 commits into
Conversation
This reverts commit c8ba9b1.
|
Ok, I've taken a look at the code for the new suggest box to understand the idea behind the MVC approach you have gone for here.
Assuming that this is accurate, this could also serve as a starting point for the updated MVC docs |
That's pretty much correct, with the exception that the views/layouts should have little to no logic in them, acting purely for arranging and styling the interface elements. Any logic for modifying the view should be on a controller, even if it's a base controller that other controllers are expected to inherit from. There might be exceptions to this if a method really really makes sense to go in a layout, but as a rule of thumb I'm trying to separate all logic from them to have a stricter separation that makes the codebase more flexible (see 9780d68 on a future branch where I'm able to axe the Here More examples of this can be found in 9780d68, where I do that same hard logic splitting in the I can get some updated docs on all this soon. I've been working ahead with some house-of-cards branches and really putting this paradigm to the test across a lot more of the UI codebase and so far it's been going (unbelievably) smoothly, so I'm feeling very confident about the whole approach. |
Ah, so the goal is to make it possible to switch out the view while keeping the controller and only methods that aid that should be added to the view? |
Summary
This PR changes the functionality of the "Add Tag" and "Add Field" buttons, removing the search modal windows and replacing them with an inline tag search and creation bar. This bar is designed to speed up searching for tags/field templates to add to entries and greatly reduce friction with the tag creation workflow, especially for new libraries. This is intended to cover and enhance most tagging workflow needs, however the option for a persistent dockable search list modal is still planned for the future in order to cover additional workflows that aren't covered by an autocomplete search bar.
Full Features
Project Layout
Full disclosure, this PR is also trojan horsing in some MVC-related changes that I've been honing in on while developing this. As someone who's been knee-deep in all flavors of the newer UI paradigms we've been using in the project, I've gotten a real good feel for what's been working and what hasn't. Many of the new UI files here ended up spinning off from the search modal/panel classes, which became so heavily modified while I was developing an embedded search that I just split my changes off into new classes. I'd eventually like to go back and retroactively apply the paradigms introduced here into the older classes (and try to reduce code duplication where possible).
The gist of these changes comes down to me using a more traditional MVC setup and tailoring it to Qt's needs, using views as layouts and controllers as final widgets. This solves every problem I've had with the existing MVC guidelines and implementations while meeting the goals set out for the MVC refactor in the first place, all while fitting in cleanly with Qt's widget system. I'm also starting to make some other opinionated changes after working with this part of the codebase so much, like dropping
controllerfrom controller filenames and using_singleunderscore names for private variables instead of using both_singleand__doublenames that were trying to mimic a semblance of private/protected variables in a language that just unfortunately doesn't have that functionality (name mangling doesn't count). In my experience working with the areas of the codebase that had accrued these changes, it's just become way more cumbersome than helpful.TODO
This PR
Do the same for "Add Field", or at least make it functional in the meantimeFix issue with removing tags not updating the autocomplete while its openFix tag appearances where they used to be wideLikely Future PRs
with an indicator of which one will be addedCloses #1379.
Tasks Completed