Andr3as / Codiad-CodeGit

Git integration for Codiad
MIT License
26 stars 15 forks source link

Add repo-wide status message, clickable to bring up commit info #28

Closed deitch closed 9 years ago

deitch commented 9 years ago

This creates a colour-coded and text-filled line at the top of the project file explorer if the root is a git repo.

The statuses are:

The status line is clickable, bringing up the CodeGit window.

Andr3as commented 9 years ago

I like the idea. But:

If you could change this, I merge it with #27 to version 0.6.0.

(1)

(1)

(2)

(2)

deitch commented 9 years ago

@Andr3as OK, so feedback:

  1. What do you mean about the design? Do you mean highlighting individual files that have been added/changed/removed? Or do you mean a red button instead of the usual triangle? I don't mind showing the changed files if there is an easy way to show it, but I still think a clear "you have uncommitted changes in this repo" makes sense. I wouldn't want it only on the files.
  2. Disable it: At a config level, like drag-n-drop? Pretty easy to do; will just copy the d-n-d code over.
deitch commented 9 years ago

OK, it is updated as follows:

  1. There is a green/blue/red icon next to the root folder.
  2. I kept the header bar, but gave an option to disable it
  3. It now polls in case the files changed on the filesystem
  4. README is updated
  5. Ability to disable the entire thing, based on your drag-n-drop suggestion

Done.

Andr3as commented 9 years ago

About the design: the two images are just examples, I just want an unobtrusive one. Your current solution is okay.

But there some points before I can merge it:

deitch commented 9 years ago
  • Please fix the whitespace

Done

  • Please follow the code style in init.js and insert an empty line after each function (f.e. here)

Done

  • Please rename isEnabled to make it's purpose clear; f.e. something like isEnabledRepoStatus

Done

  • Change the settings identifier too (codiad.plugin.codegit.disable)

Changed to codiad.plugin.codegit.disableRepoStatus

  • Please change the poller interval, every 10 seconds are still enough.

Done

Please integrate the updates from this gist to allow users to change the settings (using the integrated settings engine of codiad)

Working on it. I need to try to figure out what the gist does. No doc, is there?

deitch commented 9 years ago

Please integrate the updates from this gist to allow users to change the settings (using the integrated settings engine of coded)

You lost me on this. What exactly is this? Obviously some sort of declarative description of adding a settings option using plugin.json, which appears to launch generalSettings.php, and an event listener on the client (js) side for changed settings? But how does this all tie together?

Andr3as commented 9 years ago

Some time ago we created a way for plugins to extend the settings of codiad. You find more details about this here.

screenshot

In short: It defines for codiad where to find the plugins settings for the subscreen. Codiad takes care on saving them.

I hope this helps you to understand the code. If not I can write more about it.

deitch commented 9 years ago

OK, I followed your lead on the settings management. Not sure I got it right, but....

deitch commented 9 years ago

Did I see that you moved 0.6.0 into the master branch? Is it ready for me to fix the PR so it can merge in?

Andr3as commented 9 years ago

Yes, everything is ready.

deitch commented 9 years ago

Got it! Merged 0.6.0 in, resolved conflicts (minimal), updated and out. As soon as you have this committed, I will merge the other one.

Andr3as commented 9 years ago

Ok, but there are still some points:

Are you sure with the last commit name?

Thanks

deitch commented 9 years ago
  • Please fix the indentation (4 Spaces): OK done and pushed.
  • Change the data-setting attribute here to the current setting identifier OK done and pushed.
  • Please put here some code to react on changed settings Yeah, I was still figuring out how to use the setting change. I still am confused by how this works.

When I use the generalSettings plugin to save the settings, where exactly does Codiad save them? And how can I retrieve them client-side? The previous examples used localStorage.getItem(), but that doesn't seem to work here.

Andr3as commented 9 years ago

Codiad saves your settings in data/settings.php of your Codiad installation and in the localStorage of your browser. To retrieve them use localStorage.getItem(IDENTIFIER). The previous example didn't worked because the identifier in generalSettings.php was different to the one in init.js.

deitch commented 9 years ago

Yes, got it now. Updated and pushed. Please look.

Andr3as commented 9 years ago

Thank you for contributing