pebble / cloudpebble

CloudPebble source. Here be dragons.
https://cloudpebble.net/
MIT License
211 stars 83 forks source link

Add support for publishedMedia #332

Open Spacerat opened 8 years ago

Spacerat commented 8 years ago

This PR adds support to CloudPebble for publishedMedia.

The basic interface looks like this. It is only available for Native SDK 4 projects (and not packages). screen shot 2016-08-18 at 18 46 45 It has the following behaviours:

The form auto-saves whenever it is in a valid state, and it doesn't disrupt the user with errors while editing. If the user isn't sure why the form isn't saving, they will probably try submitting the form by pressing enter or clicking the save button, at which point they will actually be shown an error message which disappears as soon as the user resolves the error.

screen shot 2016-08-18 at 18 40 48

Only the first item has the help text - the rest look like this: screen shot 2016-08-18 at 19 36 12

The "Add New Published Media" button adds a new section, with a numeric ID of max(ids)+1.

When you rename your own project's resource IDs, CloudPebble attempts to figure out what was renamed to what, and then rename the corresponding publishedMedia entry. In 99% of cases (i.e. a resource ID which was unique was renamed to something else) this will be successful.

However, there are a number of possible actions which can result in publishedMedia referencing ResourceIDs which no longer exist, and when this happens an icon will appear next to the sidebar menu screen shot 2016-08-18 at 18 39 47 These actions include:

Finally: because it is not possible for CloudPebble to know whether the publishedMedia are valid until it gets the list of resources from dependencies (which happens via the YCM proxy), the pane will not show until YCM has finished (or failed) initialising. If the user navigates to the pane before that, a simple loading message is shown. screen shot 2016-08-18 at 18 46 55