From 629847488ba4c8d8fe1aa4883271bed506eaab15 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Sat, 18 Jul 2020 15:03:20 -0500 Subject: [Feature, UI] Visualize thread nesting in Web app --- app/javascript/flavours/glitch/components/status.js | 1 + .../glitch/features/status/components/detailed_status.js | 8 +++++++- .../glitch/styles/monsterfork/components/status.scss | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index 5d3789b24..021c75c76 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -673,6 +673,7 @@ class Status extends ImmutablePureComponent { // Users can use those for theming, hiding avatars etc via UserStyle const selectorAttribs = { 'data-status-by': `@${status.getIn(['account', 'acct'])}`, + 'data-nest-level': status.get('nest_level'), }; if (prepend && account) { diff --git a/app/javascript/flavours/glitch/features/status/components/detailed_status.js b/app/javascript/flavours/glitch/features/status/components/detailed_status.js index e4aecbf94..24e614a8d 100644 --- a/app/javascript/flavours/glitch/features/status/components/detailed_status.js +++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.js @@ -251,9 +251,15 @@ export default class DetailedStatus extends ImmutablePureComponent { ); } + const selectorAttribs = { + 'data-status-by': `@${status.getIn(['account', 'acct'])}`, + 'data-nest-level': status.get('nest_level'), + 'data-nest-deep': status.get('nest_level') >= 15, + }; + return (
-
+
diff --git a/app/javascript/flavours/glitch/styles/monsterfork/components/status.scss b/app/javascript/flavours/glitch/styles/monsterfork/components/status.scss index e64f21a21..f7b3a8ccd 100644 --- a/app/javascript/flavours/glitch/styles/monsterfork/components/status.scss +++ b/app/javascript/flavours/glitch/styles/monsterfork/components/status.scss @@ -6,3 +6,17 @@ font-size: 12px; } } + +@for $i from 0 through 15 { + div[data-nest-level="#{$i}"] { + border-left: #{$i * 5}px solid darken($ui-base-color, 8%); + } +} + +div[data-nest-deep="true"] { + border-left: 75px solid darken($ui-base-color, 8%); +} + +.status, .detailed-status { + border-bottom: 1px solid darken($ui-base-color, 8%); +} \ No newline at end of file -- cgit