-
Notifications
You must be signed in to change notification settings - Fork 13
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
Validate panel grid arrangement in layout editor #351
base: main
Are you sure you want to change the base?
Conversation
* Fix moving unplaced controls into a layout. * Fix editing shader links. * List suggested controls in the unplaced controls list. * Shader editor panel doesn't scroll.
Design mode fixes
…e e.g. because they were removed from the shader code).
Fix crash when shader instance has weird port mappings
Nicer GLSL code display in simulator
…ons and button groups. Some UI cleanup.
* Add property editors for button activation and button group title.
Fix arrow key event stealing by OrbitControls.
* Right-justify dialog title actions (Undo/Redo). * Handle dialog close by displaying snackbar (Apply/Abandon) if there are modifications. * Push to undo stack on hitting return in text field.
Editor cleanup
* Extract ShaderBuilder interface from PreviewShaderBuilder. * Extract IObservable interface from Observable.
…t the preview edge.
Indicate projection overflow in preview
* Extract edit options calculation code to EditingShader in common. * Rearrange upper panels. Lots of styling stuff. * Cache analyzed shaders slightly more effectively
* Show Properties tab by defaiult.
Shader editor improvements
In design mode, sections have an add (+) button for creating new buttons and button groups
Add "Download Show" action to app drawer
* TextEditor wasn't calling onAceEditor on mount; fixed. * ShaderInstanceEditor was spuriously pushing to the undo stack on every state change of EditingShader; fixed.
Fix glsl error markers
Client-side preview visualizer
* Use CSS grid instead of Mosaic for layout and specification. * New layout editor.
Since probably nobody's created a custom layout yet, we'll just ignore what's there and drop in a pre-baked default.
* Panels are now model objects with a title. * Panels can be added and removed.
Layout uses CSS Grid
Force-hide the app drawer when layout editor is open
* Add no-op "New Format…" and add tab buttons, for placement. * Move show code button to float right. * Dimen unit (fr/px/em) is clickable to activate popup menu.
Misc minor styling/cleanup on layout editor
|
||
object LayoutValidatorSpec : Spek({ | ||
describe<LayoutValidator> { | ||
val layoutValidator by value { LayoutValidator() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This by value
thing creates a new instance for every spec — for each it
block.
object LayoutValidatorSpec : Spek({ | ||
describe<LayoutValidator> { | ||
val layoutValidator by value { LayoutValidator() } | ||
val tab by value<Tab> { toBeSpecified() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also useoverride
to change the value in nested contexts, see below.
val invalidRegions by value { layoutValidator.findInvalidRegions(tab) } | ||
|
||
context("when all regions are single cells") { | ||
override(tab) { tab(3, 3, "ABC DEF GHI") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it behave as though line 14 had this value the whole time, within this context
.
} | ||
}) | ||
|
||
fun tab(columns: Int, rows: Int, areas: String): Tab { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helper method to convert "aa bb" to a Tab
with ["a", "a", "b", "b"].
Multi-cell panels in the grid must follow CSS Grid rules: they must be rectangular and contiguous.
If the arrangement is invalid, show that there's an error, maybe indicate which panels are invalid, and refuse to apply the change.