Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Philosophical discussion and getting back to edit #33

Open
SteveALee opened this issue Jul 11, 2018 · 2 comments
Open

Philosophical discussion and getting back to edit #33

SteveALee opened this issue Jul 11, 2018 · 2 comments

Comments

@SteveALee
Copy link

So a fundamental feature of REST is a URL uniquely identifies a representation of a resource (I think)

When you edit in itty.bitty.site/edit the url is changed and if you copy that url you then get a different representation as the URL is "executed"

This seems odd, a bit weird and possibly wrong :)

Relates is that given the generated URL how can we get back to the source used in the editor? This would be like being able to view source in any browser - something that I'm sure makes the web great.

@alcor
Copy link
Member

alcor commented Jul 11, 2018

I wrestled with this quite a bit. It was important to me that you be immediately able to share the current url to share the content. It leads to some slightly odd behaviors, but it makes that use (particularly on mobile) more efficient. This is also why there was an edit link for that ad-hoc content. The editor is not really intended for code.

Since advanced editing usually relies on dragging in html or codepen, I was ok with this tradeoff.

As far as getting back to the source, the contextual menu item "view frame source" works well to see exactly what is being rendered.

@SteveALee
Copy link
Author

Yes not such a simple design choice. A few thoughts

  • If you have an edit control why should it not accept anything including code?
  • drag and drop requires use of pointer (mouse or touch) while copy and paste is KB or pointer (a11y)
  • a file select UI would allow all input modes
  • using codepen requires another a resource to be set up and probably another account
  • Why not have a big 'copy URL' button next to editor to copy generated URL to clipboard? That's primary UI and I think will work cross browser (at least desktop). You do already have that function buried in the menu
  • with that button then editor is //itty.bitty.site/edit/..... and url to be opened is //itty.bitty.site/...… Then easy way to programmatically or manually generate the edit url from the generated url.
  • I've not thought of all the mobile edge cases. Only used on desktop.

While Im at It, having CLI versions to encode / decode is cool but perhaps you could extend your API to offer those functions. That would remove dual maintenance and cross platform problems but would need online access to you service and cause more traffic. "swings and roundabouts"

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

No branches or pull requests

2 participants