@samitouri / QOS-React-2 / commits / 27d4f0b24d

Fixed box drawing chars comment

Brian Vaughn committed Jun 2, 2019 at 10:40 UTC 27d4f0b24d0429ae7569cbc837e1bd3d1d895750
1 file changed +24 -24
src/devtools/views/Components/Tree.js
+24 -24
@@ -325,39 +325,39 @@ export default function Tree(props: Props) {
325 // Indentation size can be adjusted but child width is fixed.
326 // We need to adjust indentations so the widest child can fit without overflowing.
327 // Sometimes the widest child is also the deepest in the tree:
328 -// ┏━━━━━━━━━━━━┓
329 -// ┃ <Foo> ┃
330 -// ┃ ••••<Foobar> ┃
331 -// ┃ ••••••••<Baz> ┃
332 -// ┗━━━━━━━━━━━━┛
328 +// ┏----------------------┓
329 +// ┆ <Foo> ┆
330 +// ┆ ••••<Foobar> ┆
331 +// ┆ ••••••••<Baz> ┆
332 +// ┗----------------------┛
333 //
334 // But this is not always the case.
335 // Even with the above example, a change in indentation may change the overall widest child:
336 -// ┏━━━━━━━━━━━━┓
337 -// ┃ <Foo> ┃
338 -// ┃ ••<Foobar> ┃
339 -// ┃ ••••<Baz> ┃
340 -// ┗━━━━━━━━━━━━┛
336 +// ┏----------------------┓
337 +// ┆ <Foo> ┆
338 +// ┆ ••<Foobar> ┆
339 +// ┆ ••••<Baz> ┆
340 +// ┗----------------------┛
341 //
342 // In extreme cases this difference can be important:
343 -// ┏━━━━━━━━━━━━┓
344 -// ┃ <ReallyLongName> ┃
345 -// ┃ ••<Foo> ┃
346 -// ┃ ••••<Bar> ┃
347 -// ┃ ••••••<Baz> ┃
348 -// ┃ ••••••••<Qux> ┃
349 -// ┗━━━━━━━━━━━━┛
343 +// ┏----------------------┓
344 +// ┆ <ReallyLongName> ┆
345 +// ┆ ••<Foo> ┆
346 +// ┆ ••••<Bar> ┆
347 +// ┆ ••••••<Baz> ┆
348 +// ┆ ••••••••<Qux> ┆
349 +// ┗----------------------┛
350 //
351 // In the above example, the current indentation is fine,
352 // but if we naively assumed that the widest element is also the deepest element,
353 // we would end up compressing the indentation unnecessarily:
354 -// ┏━━━━━━━━━━━━┓
355 -// ┃ <ReallyLongName> ┃
356 -// ┃ •<Foo> ┃
357 -// ┃ ••<Bar> ┃
358 -// ┃ •••<Baz> ┃
359 -// ┃ ••••<Qux> ┃
360 -// ┗━━━━━━━━━━━━┛
354 +// ┏----------------------┓
355 +// ┆ <ReallyLongName> ┆
356 +// ┆ •<Foo> ┆
357 +// ┆ ••<Bar> ┆
358 +// ┆ •••<Baz> ┆
359 +// ┆ ••••<Qux> ┆
360 +// ┗----------------------┛
361 //
362 // The way we deal with this is to compute the max indentation size that can fit each child,
363 // given the child's fixed width and depth within the tree.