Git Product home page Git Product logo

cork's Introduction

Hey guys, I hope you're doing well

My name is Dave. I'm a Senior Technical Writer by day, and a Swift programmer for macOS by night. All my projects are Open Source, so feel free to open a PR :)

My Programming Journey

I used to work as a web developer for a couple of years, but my true caling turned out to be technical writing and macOS programming. You can still see my webdev past:

My Top Languages

Check out my stats:

My GitHub stats

I would not consider myself a good programmer, I just make apps that I would find useful :)

Fun Facts About Me

  • I can speak four languages fluently. ๐Ÿ‡จ๐Ÿ‡ฟ Czech, ๐Ÿ‡บ๐Ÿ‡ธ English, ๐Ÿ‡ธ๐Ÿ‡ฎ Slovene and ๐Ÿ‡ธ๐Ÿ‡ฐ Slovak. Furthermore, I am also conversational in ๐Ÿ‡ฏ๐Ÿ‡ต Japanese and, to a lesser degree, ๐Ÿ‡จ๐Ÿ‡ณ Chinese, ๐Ÿ‡ญ๐Ÿ‡ท Croatian and ๐Ÿ‡ท๐Ÿ‡บ Russian.
  • My right shoulder had to be reconstructed due to multiple injuries playing volleyball. I still can't feel the shoulder.
  • I have a shitty keyboard that has ghosting issues. That's why I sometimes write don' instead of don't, and canยง instead of can't.

cork's People

Contributors

andreyrd avatar boscojwho avatar buresdv avatar hareshgediya avatar hecaex avatar himbeles avatar humblehacker avatar ilennart21 avatar jerry23011 avatar louchebem06 avatar mammutserver avatar oscb avatar padraigk avatar sebj avatar sh95014 avatar smitt14ua avatar utkinn avatar wxh06 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cork's Issues

App crashes when updating obsolete formulae

When I clicked the "Update" button in the Outdated items section of the main screen, the app crashed and sent me back to Xcode. I've attached the output from the Console.

To recreate:

  • You will need at least 1 outdated package.
  • Build and launch app.
  • Click the "Update" button under the outdated package section in Homebrew Status. The issue happens if "Outdated packages" is expanded or not.

The error in the Console is:

SwiftUI/EnvironmentObject.swift:82: Fatal error: No ObservableObject of type UpdateProgressTracker found. A View.environmentObject(_:) for UpdateProgressTracker may be missing as an ancestor of this view.
2023-02-26 22:14:22.612178-0500 Cork[8331:11138509] SwiftUI/EnvironmentObject.swift:82: Fatal error: No ObservableObject of type UpdateProgressTracker found. A View.environmentObject(_:) for UpdateProgressTracker may be missing as an ancestor of this view.

Based on a bit of playing around, I believe you may need to add the Environment Object to the ContentView in CorkApp:

            ContentView()
                .environmentObject(appState)
                .environmentObject(brewData)
                .environmentObject(availableTaps)
                .environmentObject(selectedPackageInfo)
                .environmentObject(updateProgressTracker)
                .onAppear
                {
                    NSWindow.allowsAutomaticWindowTabbing = false
                }

I've also included screenshots of the screen I've referenced and what I see in Xcode. Let me know if you need more info.

Issue - App Crashes Updating Formulae - Console Output.txt

Homebrew Status Screen with Outdated Formulae

Outdated Formulae Crash in Xcode

`regexMatch` func doesn't properly throw any errors

For now, the function regexMatch in Logic โ†’ Helpers โ†’ REGEX Match.swift doesn't throw any errors, instead returning a string in case of failure.

This is because when it was throwing errors normally, it was breaking the installation process when multiple packages were being installed at once. Fix this problem, and then make the function throw again.

`Delete Cached Downloads` button doesn't have the right options selected

Because I'm now setting the selection states from AppStorage, when I try to force them to be different, those forced overrides still get overridden by the AppStorage settings.

The problem is probably in the file Views โ†’ Maintenance โ†’ Sub-Views โ†’ Ready View.swift, at the bottom in the .onAppear block

Add --zap flag when uninstalling apps.

Using brew rm --zap [Package] one can uninstall packages and delete all their files (Cache, files in the Library, etc.) thus removing the app entirely from the system. It's an essential reason for me to use brew for managing my casks as deleting the app-package doesn't remove the entirety of an App.

I'd love if your amazing app would let me specify if I wanted to remove a packages with or without the --zap-flag

Fix Behavior of Sidebar Category Collapsing

Due to a SwiftUI bug, when collapsed, the sections in the sidebar might crash the app.

Another related bug is the visual duplication of rows when the Formulae section is disabled, which leads to the Casks section being stuck and unable to be collapsed or explanded.

Improve searching

Once implemented, search could be improved by:

  • Limiting search results using tokens
  • Giving the user the option to select if they want to search through Formulae, Casks or Taps
  • Fixing the dropdown not appearing problem

Add onboarding to the demo

The demo may be used by people who have never used Homebrew before, therefor it's important to onboard them.

The onboarding process should include:

Maintenance should also remove all downloaded files

While brew cleanup removes caches, it does not remove the downloaded files.

Make a separate command to remove them, and maybe put it as an option in the maintenance sheet.

These files are located in /Users/david/Library/Caches/Homebrew/downloads. Don't forget to remove all the symlinks from /Users/david/Library/Caches/Homebrew! Otherwise these would be symlinks pointing to nowhere!

Add keyboard shortcuts for searching

Something like cmd+f to highlight the search field in the sidebar to search for installed packages. It feels natural to use cmd+f and expect a search field to be highlighted, especially in native apps.

Speed up loading of package details

As it is now, when the user opens a detail screen, a brew info --json=v2 command is executed. As with all brew commands, it's excrutiatingly slow.

Possible fix:

  1. Each package has the file INSTALL_RECEIPT.json inside its folder. This file contains the JSON information that seems to be identical to whatever I'd get using the brew info --json=v2 command.
  2. INstead of executing the brew info --json=v2 command, read that info from this file

Maintenance overview displays at incorrect size

After performing all maintenance jobs, an overview presumably displaying the results of the maintenance is shown. However, it is incorrectly sized, cutting out most information and UI elements. It is impossible to move on from this window using the mouse, and instead hitting enter closes it (I assume there is a close button that is highlighted).

47666

SidebarView: "The compiler is unable to type-check this expression in reasonable time"

Xcode 14.2 (14C18)
macOS 13.3.1 (a) (22E772610a)
16 GB M1 Pro

So far, I've narrowed down the problem to these two calls:

    await tagPackage(package: formula, brewData: brewData, appState: appState)

    await untagPackage(package: formula, brewData: brewData, appState: appState)

(That is, if I comment out all four calls to those two methods in the first if statement of the List, it compiles successfully.)

However, even commenting out the entire contents of tagPackage doesn't fix it. I'll add more details if I have time to dig deeper.

Filter packages based on whether they were installed intentionally

Requested here: https://indieweb.social/@infotexture/110077275431348917

Possible implementation:

  • Each package has a file called INSTALL_RECEIPT.json inside its folder. This file includes a short JSON description of the package (This basically means we can get info about the package without pulling it from brew info, a possible way to speed up loading of the package details screen, the same system as #69)
  • As a deferred async operation, read the value of the key installed_on_request anda ssign it to each package in the tracker
  • Add a search tag that will let the user filter out only the packages that have installed_on_request set to true

Points:

  1. Assume every cask has been intentionally installed

Sidebar section sorting

With a long list of installed packages, it's hard to find things in the sidebar, as it's not readily apparent what criteria are currently used to sort the items within each section.

Sorting alphabetically might help as a quick fix, or provide some way to show/change the sorting mechanism.

(See also #77 & #79.)

Install Homebrew if it's not installed

This will probably be very difficult.

Things to consider:

  • How to elevate permissions to admin without using sudo (Brew complains if you use sudo)
  • How to handle user input to the install process

Check for incorrectly-installed packages

As per #84, if a package has its folder in the Cellar folder, but does not have any versions installed, Cork crashes.

Ideas to implement:

  • Stop it from crashing if a package does not have any versions installed
  • Check if there are any packages that don't have any versions installed
  • If a package does not have any versions installed, show an alert with a list of packages that don't have any versions
  • Force the user to fix the package by reinstalling it

Update the shell interface

Problems with the current interface

While it works fine, there are a few drawbacks to the current implementation:

  • It has to wait for the command to finihs, meaning there are significant performance to be gained from real-time command output checking
  • Some commands, namely brew tap, don't return any outputs for no good reason. This means I can't check the outputs of such commands, meaning there's a lot of potential errrors to show up

Requirements for a new interface

  • Support for both real-time and delayed output
  • Support for geting both standard output and standard error
  • Interoperability with the current logic
  • No decrease in performance

Add a way to go back to the start page

There's currently no way to get back to the start page after switching to a PackageDetailView. It would be great to add it.

Some ideas:

  1. Have a button on the top of the sidebar in a .toolbar
  2. Have a button on the left of the Cork text in the global .toolbar
  3. Have a button in the Menu Bar

Improve dependency handling

As it is now, it's just a simple list with info that's received from brew deps command.

It would be better if it was pulled from the package's JSON-based info instead, using the brew info --json command.

`brew tap` and `brew untap` return no output

For some reason, these two commands return no output in either standard output or standard error. This means I can't error-check the output, which makes that entire feature pretty much useless.

As per my question here, it seems to be a problem with my implementation of the shell interface.

Cork cannot be updated from within Cork

Because a part of the update process for Cork is, as defined in its cask definition, killing Cork, both updating and removing Cork is impossible from within Cork.

Possible solutions:

  1. Somehow start a detached process (perhaps this could be a starting point)
  2. Remove the part from the cask definition about killing Cork as a part of its uninstall process

Collapsible sidebar sections

With a long list of installed packages, it's hard to find things in the sidebar, as it shows everything by default.

In addition to the shorter labels proposed in #77 and the sorting suggestion from #78, it might help to make the section titles collapsible like in the Finder sidebar, so you can expand/collapse sections to focus on Formulae, Casks, Taps, or whatever you're interested in seeing.

Finder_collapsible-sidebar-sections

Add more possible Brew paths

In some instances, the path to the brew command might be different, for example when Homebrew is installed through Git instead of their script. See https://elk.zone/glasgow.social/@sandy/109998976036176844

As the brew command is alsu used extensively, it would be a good idea to include it in AppConstants instead of having to write it out every time.

Proposed fix:

  1. Add the path to the Brew command to AppConstants
  2. Implement a system for checking which path is correct
  3. Add an option to choose the location of Brew in settings, perhaps in the General tab

UI doesn't update after packages are updated

When you have updateable packages, the UI lists them as it should. When those apckages get successfully updated, the UI doesnยงt reflect this and remains stuck at There are *x* outdated packages until the app is restarted.

App seems stuck when adding a new package

When installing a new package via the toolbar button, the Install packages dialog prompts you to search for formulae.

After choosing a cask in the search results, a message appears about building the dependency graph, and then the modal shrinks to a tiny square and the app seems stuck until force-quit.

Cork_stuck-installing-cask@2x

Speed up loading taps

As it is now, taps are loaded using the brew tap command, which is not as fast as it could be.

Instead, it would be much faster to load the taps straight from disk.

Steps:

  • Remove the current function
  • Load up the taps from disk. The paths are /opt/homebrew/Library/Taps for Apple Silicon and /usr/local/Homebrew/Library/Taps for Intel

Update package updating system

As it is now, the package updater is probably the oldest part of the entire app. It still relies on the old system of issuing shell commands, so it isn't real-time and it's not error-checked.

Ideas for improving it:

  • Convert it to the new real-time shell function
  • Make the progress bar actually move when stuff is happening

Integrate with Brewlet (menu bar app)

Have you considered integrating with the Brewlet project? Seems like Cork can be a โ€œfull UIโ€ that Brewlet can launch for more complex tasks, and there may be code-reuse/sharing opportunities as well.

And if thatโ€™s not feasible, consider this a feature request to add a menu bar presence to Cork.

Enhancement: Keyboard Shortcuts

Just an idea, I noticed that Start Maintenance has the shortcut โŒ˜M, and macOS's default shortcut for โŒ˜M is minimize window. Also, Cork uses โŒ˜W & โŒ˜Q to quit the app. I'm thinking that maybe โŒ˜W could be used to close the window only.

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.