Code Monkey home page Code Monkey logo

Comments (10)

cjerrington avatar cjerrington commented on May 25, 2024 2

Thanks! I'll keep taking a look. Working on this during some "off time" from other projects and work.

from privacy.sexy.

cjerrington avatar cjerrington commented on May 25, 2024 1

Let me know and I can easily write up the commands for the pause/confirmation at the beginning and enabling the restore point.

from privacy.sexy.

undergroundwires avatar undergroundwires commented on May 25, 2024

Thanks for the feedback, also for being constructive. I totally agree. I understand that customizing / double checking recommended scripts is not easy and requires a lot of navigation.

A batch script that would prompt for everything would probably be not ideal for most users. So it should be handled during script generation process. So I'd vote for your first solution approach. If I'd define it further:

How about if we would add one more option on "Group by" section (top-right) called "Flat" that would flatten out everything as a list of single checkbox items instead of a tree structure. Each script could then be visualized such as:

  • Clear dotnet CLI telemetry (Clear application history | Privacy cleanup).
  • Clear java cache (Clear application history | Privacy cleanup)
  • ...

It would allow one to scroll down through the list and double check the selected one while also selecting interesting ones spontaneously. But it would be a pretty long list btw as we have around 500 scripts today and it keeps increasing, so we would need to add a scrollbar onto the view.

How does it sound?

from privacy.sexy.

cjerrington avatar cjerrington commented on May 25, 2024

I like that idea as well. You could still have headers for the sections but maybe see them in an ul format tree. This list could also only show the items the user selects or have a toggle between chosen and not chosen items.

I wasn't thinking about a confirmation before each task - that would be a lot. However, it might be good to remind users to ensure they have a backup of their data and even system restore. This process could even be automated with powershell to enable it and then create a restore point. This only works on Windows Desktop OS as Windows Server OS's do not have the same "restore point" feature. I wasn't thinking about a confirmation before each task - that would be a lot.

Something like:

You are about to run a series of scripts that make changes to your operating system.
Please ensure you have a backup of your data and system before proceeding.
Some of the options generated from this script can be reverted but not all.
Please proceed once ready...

The simple pause command will add the "Press any key to continue..."

from privacy.sexy.

undergroundwires avatar undergroundwires commented on May 25, 2024

Good addition. A button on that view that should say "filter by selected | not selected" would be nice on flat mode. Thanks for clarifying a nice user flow and your feedback 👍🏿

Regarding batch confirmation, sorry for misunderstanding. You're right, it's nice and would also protect from running the file by mistake. If more people in the community think batch step is necessary just let me now to give it a high priority.

from privacy.sexy.

undergroundwires avatar undergroundwires commented on May 25, 2024

Hi. It sounds awesome with some help.

To summarize what's been discussed:

  1. Creating system restore point
  2. UX to support a flattened view
  3. Prompting "Are you sure" with script list

I like all of them but I'd suggest against not sending any PR before multi OS support #40 is done. I heavily refactor the application at this moment (biggest since it's been released) with many changes. After the issue closed we could start looking at the PRs. However it could be nice to start building the scripts for 2 and 3 to use in PR later on.

I see a few challenges:

  1. How would we prompt the user? I think a dialog box would be much nicer than dumping a big text on console. However it would be too long, a scroll box would be required. Could we build such dialog box using batch/PS and maybe VBScript? Would VBScript be supported by all versions of Windows 10 without causing us any issues? How do you think we could approach it in a nicest way we can?

  2. Both for prompting user and creating restore point I'd like to make it optional. I run the script as a scheduled job and I know many who do that. It would be bad to prompt them each time or create a system restore point for those who don't want it. We could add them as any other script but they need to run in order: 1. Prompt (if selected) 2. Create restore point (if selected). How could we support some kind of ordering with our current yaml file solution? I think the application would benefit the ordering system for other reasons in future.

I'll also think about questions I stated here and would like to hear if you have any suggestions.

I just want to thanks again for being active in this project with your contributions.

from privacy.sexy.

cjerrington avatar cjerrington commented on May 25, 2024

I do see your position about the prompting. Especially if someone is selecting and downloading the generated script then I do see where they kinda already know what they're doing and selecting. Also running as a scheduled task or periodically I can see as well that prompting would be an issue. Since this is a single batch file we start to limit ourselves on where to start

We could create a variable at the top set promptToRun=true and then later if promptToRun then goto Disclaimer Disclaimer would have the warning message and the pause command before continuing. If we then changed promptToRun=False (or really anything else) then it would be run bypassing the prompt.

Personally I do not like VBS and its not as reliable moving forward. I have used the .NET classes to show the MessageBox window in other PowerShell scripts I've used. Below is a basic prompt that we could wrap into a PowerShell function for reusability in other parts if needed later on.

I do like the fact that it generates a single batch file and doesn't need a config file as well. I dont want this to get that complicated either.

Add-Type -AssemblyName PresentationCore,PresentationFramework

$msgBody = "This is the message body of the window"
$msgTitle = "Message Title"
$msgButton = 'YesNo'
$msgImage = 'Question'
$Result = [System.Windows.MessageBox]::Show($msgBody,$msgTitle,$msgButton,$msgImage)

if ($Result -eq "Yes"){
    # Do the stuff
    Start-Process Notepad
}

We could have a similar set restorepoint=False variable at the top and then if its True goto the RestorePoint and proceed.

I'd be willing to look into these items with you too. Just let me know when the major refactoring is done and I can start studying what needs to be done. I think the restore point is a Windows thing and on MacOS and Linux variants we might just want to specify to have a good system/file backup.

from privacy.sexy.

undergroundwires avatar undergroundwires commented on May 25, 2024

Thank you a lot for your feedback. I agree with your arguments so we should skip VBS, let's not use it. The PoC looks great. Happy to be receiving contributions from you 🙏🏿

I'm done with most refactorings so feel free to dive deeper into this 😀 It'd be much quicker if you'd take the lead and I can guide you when it's needed. I think a good place to start with is the checking how the windows.yaml looks like and its documentation.

I see that doing PowerShell contributions is not so smooth today. I created #53 so we can write PS as it is without thinking about inlining and escaping them.

Ordering

The flag solution sounds actually nice for this specific case. It's a good workaround for this single case but I think we should focus on scalability as well. I've been thinking about this as well and will share a potential solution for your feedback:

So in collection files we can introduce a new property called something like order that'd work similarly to z-index or order in CSS. Scripts would look like:

category: Advanced settings
children:
  -
    name: Creating system restore point
    order: -10
    code: ...
  -
    name:  "Are you sure" prompt
    order: -20
    code: ...

All scripts will have order 0 as default and if we want to move something to top we'll input a negative integer like -1 or -10. This way we could also add a positive number to run something at the end of the other scripts. We'll just add a sorting line in UserScriptGenerator.ts based on that property. We can then set something like -10 to system restore script and -20 to prompt for double check. Those who don't want them (like me) can go to "Advanced settings" and disable those two scripts.

We could add both scripts under the category advanced scripts.

Then they would be both selectable and in order. How does it sound?

Sending name of scripts

Another problem that we need to solve is to sending list of script names to the PowerShell script. A solution that comes to my mind is introducing support for parameter substitions in scripts (not its only for subscription) and then we can allow for global substations. Like if any script uses {{ $scriptNames }} inside it would be replaced by the list of the scripts.

We can probably start with system restore script and ordering. Next should be the double check prompt as it would require knowledge of list of scripts in the file that will require more to implement.

from privacy.sexy.

cjerrington avatar cjerrington commented on May 25, 2024

Is there a parameter or data object that already holds the checked values? I think that might help the list idea. Trying to review the code and understand the logic before getting to in-depth.

from privacy.sexy.

undergroundwires avatar undergroundwires commented on May 25, 2024

Yes there's ApplicationContext.ts singleton that holds CategoryCollectionState.ts per each OS. The whole state is saved there for each OS, including UserSelection.ts that you're looking for. Vue components consume the state by extending StatefulVue.ts. It reveals getCurrentContextAsync to get current state and abstract handleCollectionState that's updated each time OS is changed.

You can start by looking at TheCodeArea.vue that listens to code changes and build the code, it's just to F12 deeper from there 😀 The scripts are loaded from collection files and parsed/compiled by ApplicationParser.ts.

I also improved documentation by adding Presentation.md and Application.md to further defined the layering.

Let me know if more documentation is needed then I'll create those, or just any improvements regarding the code base. I try to keep it clean, maintainable and easily contributable as this will be a very long term project. And feel free to ask if anything.

from privacy.sexy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.