-
Notifications
You must be signed in to change notification settings - Fork 205
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
hide detailed disclosure information by default #6587
hide detailed disclosure information by default #6587
Conversation
Opening the scenario view on the default skeleton: Checking the box reveals the detailed information: When the box is checked, hover behaves as of #6571; when the box is not checked, there is no hover behaviour for the X's. |
@@ -845,8 +845,8 @@ renderRow world parties NodeInfo{..} = | |||
| party `S.member` niDivulgences = ("D", Just "Divulged") | |||
| otherwise = ("-", Nothing) | |||
in | |||
H.td H.! A.class_ "disclosure" $ H.div H.! A.class_ "tooltip" $ do | |||
H.text label | |||
H.td H.! (A.class_ (H.textValue $ T.pack $ concat $ ["disclosure"] <> [" disclosed" | isJust mbHint])) $ H.div H.! A.class_ "tooltip" $ do |
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.
What is the purpose of the disclosed
class? It seems unused.
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.
Indeed it is. It should not be. Its purpose is to scope the replacement by X to only the disclosed cells, i.e. not replace -
. It seems like I forgot to do that. I'll add it :-)
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.
Fixed by
$ git add -p
diff --git a/compiler/daml-extension/src/webview.css b/compiler/daml-extension/src/webview.css
index 05d9bd785..8060f088c 100644
--- a/compiler/daml-extension/src/webview.css
+++ b/compiler/daml-extension/src/webview.css
@@ -31,10 +31,10 @@ td.disclosure {
tr.archived td.disclosure {
text-decoration: none;
}
-.hidden_disclosure td.disclosure span {
+.hidden_disclosure td.disclosed.disclosure span {
display: none;
}
-.hidden_disclosure td.disclosure:after {
+.hidden_disclosure td.disclosed.disclosure:after {
content: 'X';
}
th {
(1/1) Stage this hunk [y,n,q,a,d,s,e,?]? y
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.
That looks great! One suggestion to simplify the code:
H.td H.! (A.class_ (H.textValue $ T.pack $ concat $ ["disclosure"] <> [" disclosed" | isJust mbHint])) $ H.div H.! A.class_ "tooltip" $ do | |
H.td H.! A.class_ (H.textValue $ T.unwords $ "disclosure" : ["disclosed" | isJust mbHint]) $ H.div H.! A.class_ "tooltip" $ do |
I'm a bit sad we can't do
A.td H.! A.class_ "disclosure" H.!? (isJust mbHint, A.class_ "disclosed") $ ...
but unfortunately, the blaze
library does not combine multiple class
attributes. 😞
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.
To be fair to Blaze, that's really a quirk of the HTML standard: the class
attribute looks like a string but is really a list. AFAIK it's the only one that behaves like that, other attributes don't have any "merge" semantics, so this would require a lot of special-casing.
b8ae8d6
to
d17807b
Compare
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.
Thank you!
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.
That's awesome. Thanks for getting your webdev foo out so quickly. 😃
@@ -845,8 +845,8 @@ renderRow world parties NodeInfo{..} = | |||
| party `S.member` niDivulgences = ("D", Just "Divulged") | |||
| otherwise = ("-", Nothing) | |||
in | |||
H.td H.! A.class_ "disclosure" $ H.div H.! A.class_ "tooltip" $ do | |||
H.text label | |||
H.td H.! (A.class_ (H.textValue $ T.pack $ concat $ ["disclosure"] <> [" disclosed" | isJust mbHint])) $ H.div H.! A.class_ "tooltip" $ do |
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.
That looks great! One suggestion to simplify the code:
H.td H.! (A.class_ (H.textValue $ T.pack $ concat $ ["disclosure"] <> [" disclosed" | isJust mbHint])) $ H.div H.! A.class_ "tooltip" $ do | |
H.td H.! A.class_ (H.textValue $ T.unwords $ "disclosure" : ["disclosed" | isJust mbHint]) $ H.div H.! A.class_ "tooltip" $ do |
I'm a bit sad we can't do
A.td H.! A.class_ "disclosure" H.!? (isJust mbHint, A.class_ "disclosed") $ ...
but unfortunately, the blaze
library does not combine multiple class
attributes. 😞
As requested by @shaul-da, this PR hides the information added by @hurryabit in #6571 behind a checkbox, and reverts to plain "X"s by default (checkbox unchecked). CHANGELOG_BEGIN - [DAML Studio] The new S/O/W/D information is hidden behind a top-level checkbox (next to Show archived). When that checkbox is not checked (which is the default), we display X's as before. CHANGELOG_END
d17807b
to
205149d
Compare
As requested by @shaul-da, this PR hides the information added by @hurryabit in #6571 behind a checkbox, and reverts to plain "X"s by default (checkbox unchecked).
CHANGELOG_BEGIN
CHANGELOG_END