-
Notifications
You must be signed in to change notification settings - Fork 0
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
Frontend errors #94
base: dev
Are you sure you want to change the base?
Frontend errors #94
Conversation
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.
i dont like this
frontend/src/main/scala/Main.scala
Outdated
|
||
val root: HtmlElement = div( | ||
MainView(), | ||
ErrorController.displayError |
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.
Maybe add a "," on the end, we do it for other places
frontend/src/main/scala/Main.scala
Outdated
val root: HtmlElement = div( | ||
MainView(), | ||
ErrorController.displayError | ||
) |
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.
also maybe put root above main? It looks off calling something that is defined below
} | ||
} | ||
|
||
/** | ||
* Decode a JSON string into a list of DebugNodes. | ||
* | ||
* @param jsonString The JSON string to convert. | ||
* | ||
* |
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.
whitespace addition :(
} | ||
|
||
object MalformedJSONException extends Exception |
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.
Should this be at the bottom, would it be more suitable near the top?
* ErrorController keeps track of the error state of the app and the code to display error | ||
* popups in the app |
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.
balance these lines a bit more its really top heavy
setInput ( | ||
h1( | ||
className := "debug-tree-title", | ||
p("Parser Input : ", margin.px := 0, fontSize.px := 15, |
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.
Make css obj for the text?
@@ -24,6 +30,8 @@ object MainViewController { | |||
def getMainView: Signal[HtmlElement] = | |||
isTreeView.signal.map(if (_) then TreeView() else InputView()) | |||
|
|||
def getNoTreeFound: HtmlElement = noTreeFound |
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.
Comment?
def displayElement: HtmlElement = { | ||
div( | ||
className := "popup", | ||
cls := style, | ||
h2( | ||
this.name, | ||
color := "#ffffff", | ||
), | ||
br(), | ||
div( | ||
className := "popup-text", | ||
this.message, | ||
), | ||
if closable then onClick --> {_ => ErrorController.clearError()} else onClick --> {_ => ()} | ||
) | ||
} | ||
} |
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.
brace not needed
def apply(): HtmlElement = div( | ||
TreeViewController.getDisplayTree, /* Renders the tree */ | ||
) | ||
def apply(): HtmlElement = | ||
div( | ||
TreeViewController.getDisplayTree /* Renders the tree */ | ||
) |
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.
Re-inline?
styles.css
Outdated
@@ -16,6 +17,7 @@ | |||
--font-color-primary: #96DEC4; /* Parsley green. */ | |||
--font-color-secondary: #242526; /* Dark grey. */ | |||
--font-color-error: #d2042d; /* Red error. */ | |||
--font-color-warning: #ffcc00; /* Yelow warning colour. */ |
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.
Yellow typo
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.
riley ahh yelow
frontend/src/main/scala/Main.scala
Outdated
val root: HtmlElement = div( | ||
MainView(), | ||
ErrorController.displayError |
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.
Move to MainView
* @param input The input string | ||
*/ | ||
def toInputElement(input: String): Unit = | ||
setInput ( |
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.
bracez
override def colour: String = "ffff00" | ||
override def closable: Boolean = true | ||
override def style: String = "warning" | ||
} | ||
|
||
/** | ||
* Represents a breaking Exception in Dill. Overrides colour to red and canDelete to false | ||
*/ | ||
sealed trait Error extends DillException { | ||
override def colour: String = "ff0000" | ||
override def closable: Boolean = false | ||
override def style: String = "error" | ||
} |
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.
colour is set in css
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.
so remove this
} | ||
|
||
/* Used when an unexpected error occurs */ | ||
case class UnknownError(mes: String) extends Error { |
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.
msg instead of mes
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.
please dont ignore this
styles.css
Outdated
@@ -16,6 +17,7 @@ | |||
--font-color-primary: #96DEC4; /* Parsley green. */ | |||
--font-color-secondary: #242526; /* Dark grey. */ | |||
--font-color-error: #d2042d; /* Red error. */ | |||
--font-color-warning: #ffcc00; /* Yelow warning colour. */ |
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.
riley ahh yelow
@@ -16,6 +17,7 @@ | |||
--font-color-primary: #96DEC4; /* Parsley green. */ | |||
--font-color-secondary: #242526; /* Dark grey. */ |
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.
dark grey comment not lined up with the others
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.
still not lined up
@@ -14,27 +19,26 @@ object DebugTreeController { | |||
* Decode a JSON string into a DebugTree class. | |||
* | |||
* @param jsonString The JSON string to convert. | |||
* |
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.
please bring back :(
"Failed to serialize the display tree. " + | ||
"This may indicate an issue with the serialization process. " + | ||
"Please report this issue to Jamie Willis if the problem persists" | ||
} |
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.
NOT TO JAMIE
} | ||
|
||
/* Used when an unexpected error occurs */ | ||
case class UnknownError(mes: String) extends Error { |
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.
please dont ignore this
@@ -16,6 +17,7 @@ | |||
--font-color-primary: #96DEC4; /* Parsley green. */ | |||
--font-color-secondary: #242526; /* Dark grey. */ |
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.
still not lined up
Implemented dill exception structure and popup displaying