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

Validate panel grid arrangement in layout editor #351

Draft
wants to merge 1,362 commits into
base: main
Choose a base branch
from
Draft

Conversation

xian
Copy link
Member

@xian xian commented Feb 20, 2021

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.

xian and others added 30 commits October 10, 2020 19:12
* 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.
…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
* 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.
* Extract ShaderBuilder interface from PreviewShaderBuilder.
* Extract IObservable interface from Observable.
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.
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.
xian and others added 24 commits January 28, 2021 15:42
* 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.
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() }
Copy link
Member Author

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() }
Copy link
Member Author

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") }
Copy link
Member Author

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 {
Copy link
Member Author

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"].

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

Successfully merging this pull request may close these issues.

1 participant