Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion assets/javascripts/discourse/routes/nested.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ export default class NestedRoute extends Route {

const targetNode = processNode(this.store, topic, data.target_post);
const ancestors = (data.ancestor_chain || []).map((a) => assignTopic(a));
const noAncestors = ancestors.length === 0;
const targetReplyTo = targetNode.post.reply_to_post_number;
const hasParentContext = targetReplyTo && targetReplyTo !== 1;
const noAncestors = ancestors.length === 0 && hasParentContext;

// Build nested chain: ancestor[0] -> ancestor[1] -> ... -> target
// When context=0 (no ancestors), target becomes the chain root at depth 0.
Expand Down
7 changes: 7 additions & 0 deletions spec/system/nested_context_view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
expect(nested_view).to have_no_view_parent_context_link
end

it "does not show 'View parent context' for a direct reply to the OP" do
nested_view.visit_nested_context(topic, post_number: chain_posts[0].post_number)

expect(nested_view).to have_view_full_thread_link
expect(nested_view).to have_no_view_parent_context_link
end

it "highlights the target post" do
nested_view.visit_nested_context(topic, post_number: chain_posts[2].post_number)

Expand Down