Skip to content

A platform for community discussion. Free, open, simple.

UX: Layout issues with topic last visit line. (#13655)

Alan Guo Xiang Tanf57d49ed01c0
diff --git a/app/assets/javascripts/discourse/app/widgets/topic-post-visited-line.js b/app/assets/javascripts/discourse/app/widgets/topic-post-visited-line.js
index 85f8ad95523..243ed8c2cda 100644
--- a/app/assets/javascripts/discourse/app/widgets/topic-post-visited-line.js
+++ b/app/assets/javascripts/discourse/app/widgets/topic-post-visited-line.js
@@ -3,16 +3,12 @@ import { createWidget } from "discourse/widgets/widget";
import { h } from "virtual-dom";
export default createWidget("topic-post-visited-line", {
- tagName: "div.topic-post-visited-line",
+ tagName: "div.small-action.topic-post-visited",
- buildClasses(attrs) {
- return [`post-${attrs.post_number}`];
- },
-
- html() {
+ html(attrs) {
return h(
- "span.topic-post-visited-message",
- I18n.t("topics.new_messages_marker")
+ `div.topic-post-visited-line.post-${attrs.post_number}}`,
+ h("span.topic-post-visited-message", I18n.t("topics.new_messages_marker"))
);
},
});
diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss
index 0422dc6f895..d96570a2bff 100644
--- a/app/assets/stylesheets/common/base/topic-post.scss
+++ b/app/assets/stylesheets/common/base/topic-post.scss
@@ -911,6 +911,29 @@ blockquote > *:last-child {
order: 8;
}
}
+
+ &.topic-post-visited {
+ border-top: none;
+
+ + .small-action {
+ border-top: none;
+ }
+
+ .topic-post-visited-line {
+ text-align: center;
+ border-bottom: 1px solid var(--danger-medium);
+ line-height: 0.1em;
+ margin: 1rem 0px;
+ width: 100%;
+
+ .topic-post-visited-message {
+ background-color: var(--secondary);
+ color: var(--danger-medium);
+ font-size: $font-down-1;
+ padding: 0 8px;
+ }
+ }
+ }
}
.whisper {
@@ -1030,25 +1053,6 @@ a.mention-group {
}
}
-.topic-post-visited-line {
- border-bottom: 1px solid var(--danger-medium);
- line-height: 0.1em;
- text-align: center;
- margin: 1rem 0px;
-
- .topic-post-visited-message {
- position: relative; // Chrome needs this, otherwise the line is above the text
- background-color: var(--secondary);
- color: var(--danger-medium);
- font-size: $font-down-1;
- padding: 0 8px;
- }
-
- + .small-action {
- border-top: none;
- }
-}
-
// Select posts
.topic-post {
diff --git a/app/assets/stylesheets/desktop/topic-post.scss b/app/assets/stylesheets/desktop/topic-post.scss
index 0fcaeeae3fd..7b29f7b2859 100644
--- a/app/assets/stylesheets/desktop/topic-post.scss
+++ b/app/assets/stylesheets/desktop/topic-post.scss
@@ -577,12 +577,7 @@ blockquote {
}
}
-.topic-post-visited-line {
- width: calc(
- #{$topic-body-width} + #{$topic-avatar-width} +
- (#{$topic-body-width-padding} * 2)
- );
-
+.topic-post-visited {
+ .topic-post {
.topic-avatar,
.topic-body {
diff --git a/app/assets/stylesheets/mobile/topic-post.scss b/app/assets/stylesheets/mobile/topic-post.scss
index 3ae4c7f7b75..78ad0a6d53c 100644
--- a/app/assets/stylesheets/mobile/topic-post.scss
+++ b/app/assets/stylesheets/mobile/topic-post.scss
@@ -9,7 +9,7 @@
}
}
-.topic-post-visited-line {
+.topic-post-visited {
+ .topic-post article {
border-top: none;
}