halohalospecial / atom-elmjutsu

A bag of tricks for developing with Elm. (Atom package)
https://atom.io/packages/elmjutsu
MIT License
192 stars 24 forks source link

use addOpener and uri for sidekick dock implementation (this is just a hint) #95

Open mbylstra opened 6 years ago

mbylstra commented 6 years ago

Hi,

I've implemented the Dock in elm-navigator, so I thought I'd have a go at putting the Sidekick in a dock. I noticed you'd already made a branch for this though. When I tried running it locally, I couldn't get the Dock to open - it seemed there were a couple of things missing, so I had a quick go at adding the missing pieces.

This PR is really messy and unfinished as I merged master while adding the dock at the same time. It does actually work though if you load it in Atom. If you toggle the sidekick from the menu, you should see the sidekick in a Dock.

The important parts are here: https://github.com/halohalospecial/atom-elmjutsu/compare/master...mbylstra:sidekick-dock-more-progress?expand=1#diff-10fea451bc70b3b775a852e7cea23804R74

https://github.com/halohalospecial/atom-elmjutsu/compare/master...mbylstra:sidekick-dock-more-progress?expand=1#diff-bf2b827aa6d4d64656848a48f6c57d80L86

https://github.com/halohalospecial/atom-elmjutsu/compare/master...mbylstra:sidekick-dock-more-progress?expand=1#diff-16b7d75b70953cbf4755508170f2f24cR107

You'd probably just want to continue from your own branch and discard this PR. I just put it here for a reference in case you were stuck. I commented most of the toggleCommand function, as I didn't quite know how to integrate the configuration stuff. This is an example I've been going on (as the official docs are a bit light on Docks): https://github.com/atom/active-editor-info. Perhaps it was already working and the uri stuff wasn't necessary... I'm not sure! In any case, I think the uri stuff is necessary for the dock to persist when the user re-opens Atom.

halohalospecial commented 6 years ago

Hi! AFAIR, I already had something working before, but didn't pursue it further because there will be a "title" when the panel is docked. The title takes a lot of vertical space, and I don't have much on the laptop :) I'll check your version sometime next week. Thanks!