rmcanany / SolidEdgeHousekeeper

Utility for finding annoying little errors in your Solid Edge project
MIT License
21 stars 6 forks source link

Consolidate Tasks UI #68

Open rmcanany opened 6 months ago

rmcanany commented 6 months ago

Place task controls and settings into a hierarchical structure. Top level is a task category. For example, maybe Edit/update, Check, and Wrap up. Add images to the category and task lines for quick identification and a splash of color.

Add check boxes for file type, only where the task is applicable to that file type. If a task is selected, drop down its settings below the task name. The Windows form control TableLayoutPanel has this ability. Basic tutorial.

Provide an edit button to present a form for more complex settings. Return a Dictionary, which can be serialized to json for compatibility with the current Configuration scheme.

image

farfilli commented 6 months ago

Let's make it more personalizable, my idea is:

rmcanany commented 6 months ago

Those are all great ideas! I'll play around with it and keep you posted.

rmcanany commented 6 months ago

Target for v2024.2

rmcanany commented 6 months ago

TableLayoutPanel examples

https://www.c-sharpcorner.com/UploadFile/mahesh/tablelayoutpanel-in-C-Sharp/

rmcanany commented 5 months ago

@farfilli I think I finally know a way to support multiple instances of a single command in a task list.

Currently, the tasks are held in a Dictionary(Of String, L2A). L2A is a LabelToAction object. It has that name for a reason that didn't actually work.

What I think I need is to have a Task object with some basic properties. Then I need to sub-classs that to make SaveAs, PropertyFindReplace, etc. Task objects. Each of the sub-class objects would hold all relevant information, such as SaveAs.FileType, SaveAs.DirectoryFormula, etc.

Right now I store that information in various places on the UI. That's not the way to do it.

Does that sound feasible? What am I overlooking?

rmcanany commented 5 months ago

@farfilli I added some functionality to the header row. Now if you click the "+" button, it expands all task options. Click again to collapse.

Click the task-select header button and it clears the selections. I didn't think anyone would ever want to select all tasks, but could add it easily.

Click a file type button and it selects that file type for all selected tasks. Click again to clear.

Click the help button and it brings up the Readme page on GitHub. Click an individual task help button and it brings up the Readme of that command. Oh, any idea why the help icon is messed up? The others look good. I create them all the same way: Button.Image = Form1.ImageList1.Images("icons8_help_16.png")

Here's a picture. (This is from my Scratch code, not Housekeeper. It's going to break a few things. I wasn't ready to commit to that yet.)

task_tab

rmcanany commented 5 months ago

My attempt to add some "Francesco Flair." What do you think?

task_tab

farfilli commented 5 months ago

It looks great! I would really have more time to help you. Place all that controls and manage them one by one is a nightmare. My idea is to create a configurable custom control for actions. Then you add it and configure for each action in the table. I will try to make a demo project for you.

rmcanany commented 5 months ago

That would be great! I'm having trouble wrapping my head around that part!

rmcanany commented 5 months ago

I created a new repo, Scratch, in case it would help you to see what I have so far. The main code is in TaskTabUtilitiesBuildUI.vb, FYI.

farfilli commented 5 months ago

Robert have a look at this repository I just created; it is a raw and dirty just to make you understand how it works. There is space for a lot of improvements according on how you want to proceed; we can discuss about it

https://github.com/farfilli/TaskListDemo

rmcanany commented 5 months ago

Thank you very much! I'll study it today. If there is something I don't understand, I'll get back to you.

On Thu, Jan 25, 2024 at 9:39 AM Francesco @.***> wrote:

Robert have a look at this repository I just created; it is a row and dirty just to make you understand how it works. There is space for a lot of improvement according on how you want to proceed; we can discuss about it

https://github.com/farfilli/TaskListDemo

— Reply to this email directly, view it on GitHub https://github.com/rmcanany/SolidEdgeHousekeeper/issues/68#issuecomment-1910461046, or unsubscribe https://github.com/notifications/unsubscribe-auth/APKPB4DRM65YMQNKYHZTDVLYQJ4EDAVCNFSM6AAAAABBA4NN5SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJQGQ3DCMBUGY . You are receiving this because you were assigned.Message ID: @.***>

farfilli commented 5 months ago

I have added the combo box and configuration controls, polished the UI a bit

farfilli commented 5 months ago

I have added a property to control vertical border visibility image image

rmcanany commented 5 months ago

Nice!

On Fri, Jan 26, 2024 at 7:40 AM Francesco @.***> wrote:

I have added a property to control vertical border visibility image.png (view on web) https://github.com/rmcanany/SolidEdgeHousekeeper/assets/19551661/5edc84b7-3aee-49d3-87c8-8f525d76fe83 image.png (view on web) https://github.com/rmcanany/SolidEdgeHousekeeper/assets/19551661/29f40e35-1410-40a2-bf79-4362a3698b71

— Reply to this email directly, view it on GitHub https://github.com/rmcanany/SolidEdgeHousekeeper/issues/68#issuecomment-1912086566, or unsubscribe https://github.com/notifications/unsubscribe-auth/APKPB4DFNZUZFODEP4ZOIDDYQOW6DAVCNFSM6AAAAABBA4NN5SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSGA4DMNJWGY . You are receiving this because you were assigned.Message ID: @.***>

farfilli commented 5 months ago

Robert I have moved the Task types inside the TaskControl class, it is where it should be.

Let me know if you need modifications on the UI, I'm thinking that moving the combo beside the name would look better. Perhaps keep the combo line and add another one for the name line as optional.

rmcanany commented 5 months ago

Makes sense. I'll check it out!

FYI, I'm refactoring the whole Task architecture. It's way cleaner. I now have a base class, Task. Each task will now inherit from that and have all the options and code contained within. You know, like it should have been from the beginning!

Nothing is on GitHub yet. I still have some integration work to do to.

farfilli commented 5 months ago

It would be great if each task contains the properties on how the TaskControl should be rendered, in this way all the information will be in the correct place and the TaskControl will contain just the code itself. Or even better, each task could contain the TaskControl

rmcanany commented 5 months ago

That's my current thinking -- each task subclass contains its own TaskControl. I haven't gotten that far yet, but it sounds like we're on the same page.

farfilli commented 5 months ago

I would suggest to have an unique configurable TaskControl class that is used in each taskClass

rmcanany commented 5 months ago

Yeah, I had the same idea. I think I can do the common stuff in the base class, then handle the task-specific options in the subclass.

rmcanany commented 4 months ago

Got it working. Take a look if you get a chance! I don't have the list customization part done yet. Now that the Tasks are organized like they should be, it doesn't look too difficult.

We're releasing a big project at work this month -- perfect real-world test!

farfilli commented 4 months ago

I had a look; I wouldn't say I like the idea of creating the tasks UI all by code; it is difficult to customize as you want. Anyway, it looks promising. I did try to modify the tasks page "expand all" behavior as each task is repainted in sequence and makes an odd display during it. I wanted to add a suspend table layout panel before paint and reactivate it after but I didn't find where the event fires.

rmcanany commented 4 months ago

Yeah, the "expand all" is funky. I tried Form1.SuspendLayout, but it didn't help. I didn't think to do that on the TLP. I'll give that a try. I hid all the event handlers in a separate class called Task_EventHandler, by the way. Seemed like a good idea at the time.

What I like best about it is how all options for a given task are right under your fingertips. That, and the consolidation from four tabs to one. There's a lot less jumping around the program to get things set up.

farfilli commented 4 months ago

Just to refine the UI, I would add a transparent background on checkboxes rather than a solid grey control color. The best would be to have a highlighted icon on the mouse hover

rmcanany commented 4 months ago

Thanks for the suggestion. Keep 'em coming!

farfilli commented 4 months ago

I had a second look at the code; and did some tests to speed up the expand\collapse. I think the core of the slow performance is due to the amount of controls in the TLP. I would strongly recommend creating a custom control that handles each task. This will reduce dramatically the number of controls in the TLP, the custom control will be treated as a single control even if contains many. Side effect, you will have a visual designer to adjust the layout of the task UI

farfilli commented 4 months ago

I created a Pull request with changes that makes the expand\collapse an acceptable experience; have a look at it

rmcanany commented 4 months ago

Nice! And, yeah I was never going to figure that out!

I'll have to read up on custom controls. If you have any samples, links, or tips, I would appreciate the info.

farfilli commented 4 months ago

I made the https://github.com/farfilli/TaskListDemo to show you how the custom control works; have a look and if you need help I will integrate it in the main project for you to use

rmcanany commented 4 months ago

OK. I didn't notice that was a custom control. I'll study it.

farfilli commented 4 months ago

Be sure to update to the latest commits :-)

ChrisClems commented 1 month ago

May I recommend making disabled vs unchecked boxes in the tasks tab more stylistically unique? It may be partially because of my colorblindness, but at certain angles on my monitor they're difficult to tell apart.

rmcanany commented 1 month ago

That's a good idea. It's on the list!

farfilli commented 3 weeks ago

@rmcanany I can take the request to implement a custom control for task UI. You can create a new issue if you think it's needed to better track the task project

rmcanany commented 3 weeks ago

No need. It's already done. I'm now cleaning out all the garbage I added previously.

rmcanany commented 2 weeks ago

Just committed the code with the new TaskControl user control. If you get a chance, please try it out.

@ChrisClems I tried to improve the checkboxes, but I'm not positive I understood the issue. Would appreciate any feedback.

farfilli commented 2 weeks ago

I did a quick test, it looks promising. I also edited the TaskControl a bit to have a less heavy UI.

Just some thoughts: instead of a panel I would use a FlowLayoutPanel; in this way, it would be easy to add\remove\reoder the tasks in the list, you just need to change the index property for reorder (perhaps by drag and drop). Also, it will be easy to create a save\load of what I call "Plans" (A plan is just a list of pre-configured tasks)

Perhaps this part can be planned as a future improvement or it may delay the next release

rmcanany commented 5 days ago

Got the Edit Task List working (very minimally tested). Would welcome any feedback if you get a chance to play with it. edit_task_list

rmcanany commented 5 days ago

@farfilli I like your idea about "Plans". I didn't notice that part of your comment before. I've been thinking along the same lines. I also agree it would be best to target for a future release.

farfilli commented 3 days ago

@rmcanany I had a deeper look at the UCTaskControl implementation. The UCTaskControl should handle every aspect of the control, instead, I see that the TLPOption panel is generated at runtime by every single task class. There are hundreds of repetitive code lines that are not ideal to maintain and make it difficult to implement new tasks in the future.

UCTaskControl should contain all the options in a customizable way, if you feel that to limit the options more custom controls could be created to handle every single option line and to be added in sequence as needed.

In the end, you assign the task to the UCTaskControl and the control configures itself; also during execution, it can easily return the task and its configuration; in the same way it can return its configuration for saving purposes

I know it's a big change, and probably the actual state of the code is due to the past implementation, but I think a code refactory is needed; perhaps for a future release. Main object code reduction\consolidation you can set it as the first project?

rmcanany commented 2 days ago

I appreciate the feedback.

You're right, each Task that has options creates its own TLPOption panel. I did it that way because I didn't see much commonality between them. For example, SaveDrawingAs has lots of options, many of which are shown/hidden based on other options. Other Tasks may only have a couple of CheckBoxes.

Do you think it would maybe be better to make a separate Option UserControl for each Task that has options? I'm picturing something like UCSaveDrawingAsOptions that would be added to its UCTaskControl at runtime. I guess the event handlers would be in there, too. It wouldn't be that much work and there's no deadline.

Let me know your thoughts.

farfilli commented 4 hours ago

The tasks list should be reloaded after the edit without the need to restart SEHK. This will also be needed when "plans" are implemented, that's mandatory to move from one plan to another without the need to restart SEHK and lose the file list and previous processing result.