docs(notes): add contextual helpful comments as part of my previewing

tauraamui created

Change summary

internal/config/load.go     | 2 ++
internal/config/provider.go | 7 +++++++
2 files changed, 9 insertions(+)

Detailed changes

internal/config/load.go 🔗

@@ -74,6 +74,8 @@ func Load(workingDir, dataDir string, debug bool) (*Config, error) {
 		assignIfNil(&cfg.Options.TUI.Completions.MaxItems, items)
 	}
 
+	// NOTE(tauraamui): current entrypoint for invoking providers fetch for
+	// 					the rest of the app as a whole.
 	// Load known providers, this loads the config from catwalk
 	providers, err := Providers(cfg)
 	if err != nil {

internal/config/provider.go 🔗

@@ -78,6 +78,11 @@ func loadProvidersFromCache(path string) ([]catwalk.Provider, error) {
 	return providers, nil
 }
 
+// NOTE(tauraamui) <REF#1>: there seems to be duplication of logic for updating
+// the providers cache/from catwalk, in that this method is only invoked/used by the
+// catwalk CLI command, when it should probably be the exact same behaviour that
+// crush carries out internally as well when it does the sync internally/automatically
+// see (REF#2)
 func UpdateProviders(pathOrUrl string) error {
 	var providers []catwalk.Provider
 	pathOrUrl = cmp.Or(pathOrUrl, os.Getenv("CATWALK_URL"), defaultCatwalkURL)
@@ -113,6 +118,8 @@ func UpdateProviders(pathOrUrl string) error {
 	return nil
 }
 
+// NOTE(tauraamui) <REF#2>: see note (REF#1), basically this looks like some logic
+// should be shared/consolidated.
 func Providers(cfg *Config) ([]catwalk.Provider, error) {
 	providerOnce.Do(func() {
 		catwalkURL := cmp.Or(os.Getenv("CATWALK_URL"), defaultCatwalkURL)