Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Native file browser #230

Closed
bsudekum opened this issue Mar 18, 2014 · 9 comments
Closed

Native file browser #230

bsudekum opened this issue Mar 18, 2014 · 9 comments

Comments

@bsudekum
Copy link

Is there a technical reason why we are not using a native file picker/browser for adding sources? It seems a little overkill to reinvent the wheel and create our own.

Plus, there are advantages to using the systems file browser for adding sources:

@kkaefer
Copy link
Member

kkaefer commented Mar 18, 2014

See #227 (comment).

We discussed this in chat. The reason is that the native browser does not divulge the absolute file system path, but returns something like C:\fakepath\file.ext. However, we need to send the path from the client to the server because it needs to read/write from there.

@tristen tristen closed this as completed Mar 18, 2014
@incanus
Copy link
Contributor

incanus commented Mar 18, 2014

Background as well: https://github.com/mapbox/tilemill/issues/907

We could do this on certain platforms if it's not a lot of code. The TM1 picker always gets me when it comes to not remembering my place, not having access to keyboard shortcuts like Cmd-D, not having quick access to the data folder I've bookmarked in the sidebar, etc.

@zeke
Copy link

zeke commented Apr 15, 2014

the native browser does not divulge the absolute file system path

What does it divulge? Seems like there's gotta be a way to work around this. In my experience working with TM2, browsing for files is the most frustrating interaction.

@tristen
Copy link
Member

tristen commented Apr 16, 2014

What does it divulge?

It doesn't pass an absolute path which is currently required when accessing tm2 files.

@zeke
Copy link

zeke commented Apr 16, 2014

Yeah I guess this is an obvious security risk. I wonder if wrapping tm2 in something like webkit.js or node-webkit would help.

@springmeyer
Copy link
Contributor

I've been paying some attention to node-webkit - it looks to be extremely sophisticated and I've sought to support it with node-pre-gyp binaries in part to make this possible to experiment with. Though I've always been turned away by the extra size you pay for, at least compared to using system webkit on OS X like we do now.

@incanus
Copy link
Contributor

incanus commented Apr 22, 2014

Just because we can't do this universally for all web clients doesn't mean we shouldn't do it for some native clients. Choosing an absolute file path and passing that to the server is clearly a security risk for the web globally, but makes the most sense from a user point of view for an operation that is repeated many times throughout the editing of a project. Yes, it's code branching, but it's a clearly superior user experience.

Tagging #110 here as something to consider in that work. Fallback could remain the current HTML-based picker, but a future possible native app bundle could do a native picker.

@zeke
Copy link

zeke commented May 6, 2014

Hey y'all. I'm sure you heard about the open-sourcing of atom.io, but did you see atom-shell?! This could be a good fit for tm2: https://github.com/atom/atom-shell/blob/master/docs/tutorial/quick-start.md

@springmeyer
Copy link
Contributor

Thanks @zeke! Yes, I poured over atom-shell this morning - looks very very interesting as a wrapper. The trick it looks like would be to have it be optional - you should be able to launch tm2 either as an atom shell app or just a server process. The other issue is that native addons would need to be rebuilt against node v0.11.x. So atom-shell is not going to work until I port node-mapnik to use NAN

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants