decomp.me
decomp.me copied to clipboard
Give presets contexts
Adding a context field to presets will allow for a default context if one isn't provided (indicated by the UI once the preset is selected if there's a context in the preset)
First step is to simply add the field
- [ ] Add field to model
- [ ] Backend code to put the model's preset field into the scratch upon creation
- [ ] Add field to preset api endpoint response that indicates whether a context is present
- [ ] UI on /new to tell the user the context will be auto-populated if they don't put anything into the box (uses aforementioned new field)
UI for adding/editing presets on the site will come later, and this will just be one of the editable fields there
Currently we have Scratch.context, so the Preset.context would get copied into Scratch.context upon creation (or loaded into the UI and then submitted as part of the new Scratch) - we are not attempting to reduce duplicattion of contexts at this stage - simply make life easier for folks creating new scratches.