Skip to content

Commit 27c7506

Browse files
committed
improved UI handling of match failures with a because section and more complex log events
1 parent 54290fa commit 27c7506

File tree

2 files changed

+49
-14
lines changed

2 files changed

+49
-14
lines changed

src/components/LogMessage.js

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export default class LogMessage extends Component {
6363
color = "rgb(255, 255, 255)";
6464
}
6565
}
66+
console.log("66:" + JSON.stringify(messagePart));
6667
return <span key={messagePart.key + "_" + index}
6768
style={{
6869
marginTop: "-10px",
@@ -76,6 +77,7 @@ export default class LogMessage extends Component {
7677
}}>{addLinks(reason)}</span>
7778
}
7879
);
80+
console.log("80:" + JSON.stringify(messagePart));
7981
return <div key={messagePart.key}
8082
style={Object.assign({paddingLeft: "5px",}, cellStyle)}>
8183
<details className={"because"}>
@@ -86,12 +88,36 @@ export default class LogMessage extends Component {
8688
paddingLeft: "5px",
8789
paddingTop: "0px",
8890
marginTop: "-1px",
89-
}}><span>...</span>
91+
}}><span>
92+
<svg className={"summaryClosed"} viewBox="0 0 15 15" fill="currentColor" style={{
93+
verticalAlign: "top",
94+
color: "rgb(178, 148, 187)",
95+
height: "1em",
96+
width: "1em",
97+
paddingLeft: "2px",
98+
paddingTop: "5px"
99+
}}>
100+
<path d="M0 14l6-6-6-6z"/>
101+
</svg>
102+
<svg className={"summaryOpen"} viewBox="0 0 15 15" fill="currentColor" style={{
103+
verticalAlign: "top",
104+
color: "rgb(129, 162, 190)",
105+
height: "1em",
106+
width: "1em",
107+
paddingLeft: "2px",
108+
paddingTop: "5px",
109+
paddingBottom: "15px",
110+
}}>
111+
<path d="M0 5l6 6 6-6z"/>
112+
</svg>
113+
<span className={"summaryClosed"}>...</span>
114+
</span>
90115
</summary>
91116
{line}
92117
</details>
93118
</div>;
94119
} else if (messagePart.json) {
120+
console.log("97:" + JSON.stringify(messagePart));
95121
return <JsonItem key={messagePart.key}
96122
index={null}
97123
collapsed="0"
@@ -103,7 +129,7 @@ export default class LogMessage extends Component {
103129
padding: "2px",
104130
}}
105131
enableClipboard={true}
106-
jsonItem={messagePart.value}/>;
132+
jsonItem={typeof messagePart.value === "number" ? "" + messagePart.value : messagePart.value}/>;
107133
} else {
108134
return <div key={messagePart.key}
109135
style={{

src/components/log.css

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ details.logGroup > summary:first-of-type {
1616
list-style-type: none;
1717
}
1818

19-
details.logGroup[open] .logGroupSummaryClosed {
19+
details.logGroup[open] .logGroupSummaryClosed {
2020
display: none;
2121
}
2222

23-
details.logGroup .logGroupSummaryClosed {
23+
details.logGroup .logGroupSummaryClosed {
2424
display: inline-block;
2525
}
2626

27-
details.logGroup .logGroupSummaryOpen {
27+
details.logGroup .logGroupSummaryOpen {
2828
display: none;
2929
}
3030

31-
details.logGroup[open] .logGroupSummaryOpen {
31+
details.logGroup[open] .logGroupSummaryOpen {
3232
display: inline-block;
3333
}
3434

@@ -38,17 +38,26 @@ details.logGroup[open] .logGroupSummaryOpen {
3838
/* background-color: rgb(43, 52, 62) !important;*/
3939
/*}*/
4040

41-
details.because summary::-webkit-details-marker {
41+
details.because[open] .summaryClosed {
42+
display: none;
43+
}
44+
45+
details.because .summaryClosed {
4246
display: inline-block;
4347
}
4448

45-
details.because > summary:first-of-type {
46-
list-style-type: inline-block;
49+
details.because .summaryOpen {
50+
display: none;
4751
}
48-
details.because.open > summary {
49-
visibility: hidden;
52+
53+
details.because[open] .summaryOpen {
54+
display: inline-block;
5055
}
5156

52-
details.because[open] summary span {
53-
visibility: hidden;
54-
}
57+
details.because summary::-webkit-details-marker {
58+
display: none;
59+
}
60+
61+
details.because > summary:first-of-type {
62+
list-style-type: none;
63+
}

0 commit comments

Comments
 (0)