# Option to move accepted answer to the top

**URL:** <https://meta.discourse.org/t/option-to-move-accepted-answer-to-the-top/58386>\
**Category:** Feature\
**Tags:** solved\
**Created:** [2015年十一月24日 21:32 UTC](https://meta.discourse.org/t/option-to-move-accepted-answer-to-the-top/58386 "2015-11-24T21:32:08Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017年三月8日 14:35 UTC](https://meta.discourse.org/t/option-to-move-accepted-answer-to-the-top/58386/22 "2017-03-08T14:35:33Z")

</div>

I reviewed and merged, I feel it looks a bit naked though without the excerpt would love to see that in as well.

---

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [2017年三月8日 14:40 UTC](https://meta.discourse.org/t/option-to-move-accepted-answer-to-the-top/58386/23 "2017-03-08T14:40:57Z")

</div>

I agree having an excerpt would be nicer, I did get it working by adding to the serialiser:

> [@david](#):
>
> > **Screenshot**
> >
> > ![](https://global.discourse-cdn.com/meta/original/3X/f/f/ff12231cb864961d00c25923d3fe1770e11d7f31.png)
> 
> Then you can click the header, and it expands to the full post:
> 
> > **Screenshot**
> >
> > ![](https://global.discourse-cdn.com/meta/original/3X/9/6/967d90f4764980b98e82b0910d5091fb918ce88a.png)

Edit: wow, quoting `[details]` went badly

And the code [here](https://github.com/davidtaylorhq/discourse-solved/commit/f38c7a39915fb4290369b18804c8c952bfad3bbb#diff-b61ae67bc6a57a3decb8d15b832077f4R234).

However…

> [@david](#):
>
> Currently, if you go and change the “solution” then it causes the page to jump around all over the place because the height of the first post is changing. This happens with the discourse-solved plugin right now, but it’s not really noticeable since it’s only 1 line of text. I’m not really sure of a solution for this… Either we don’t update it live (so you have to reload the topic to see the quote), or have some kind of placeholder when the topic isn’t solved.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017年三月8日 14:56 UTC](https://meta.discourse.org/t/option-to-move-accepted-answer-to-the-top/58386/24 "2017-03-08T14:56:45Z")

</div>

I think if the excerpt is short enough the jumping should be very very limited, under almost all cases. In the vast majority of cases people edit to add more content, not to remove, so the excerpt would be unchanged.

One big issue though is that it has an “up” arrow which is very confusing UX wise, so that would have to go.

---

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [2017年三月8日 15:00 UTC](https://meta.discourse.org/t/option-to-move-accepted-answer-to-the-top/58386/25 "2017-03-08T15:00:05Z")

</div>

> [@sam](#):
>
> In the vast majority of cases people edit to add more content, not to remove, so the excerpt would be unchanged.

The issue is not so much when people edit their solutions - it’s when the solution is _changed_ by the OP or a moderator.

> [@sam](#):
>
> One big issue though is that it has an “up” arrow which is very confusing UX wise, so that would have to go.

Yep, definitely.

How long do you think the excerpt should be? I had it hardcoded at 100 characters, but that’s a bit arbitrary. Shall I add a setting for it? Or do you think that is configuration for configuration’s sake?

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017年三月8日 15:01 UTC](https://meta.discourse.org/t/option-to-move-accepted-answer-to-the-top/58386/26 "2017-03-08T15:01:41Z")

</div>

I actually think it should be configurable, 100 is a good default.

I don’t know it should be fairly rare to be mucking with accepted answer, and unaccepting causes a jump anyway. I think we can live with it.

---

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [2017年三月8日 15:25 UTC](https://meta.discourse.org/t/option-to-move-accepted-answer-to-the-top/58386/27 "2017-03-08T15:25:19Z")

</div>

Here we go - configurable length quote, click to expand to full post, and only shows the down arrow.

[https://github.com/discourse/discourse-solved/pull/50](https://github.com/discourse/discourse-solved/pull/50)

Having just tried it with a topic with many posts, it doesn’t actually affect the scrolling as much as I thought 🙂

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017年三月8日 20:12 UTC](https://meta.discourse.org/t/option-to-move-accepted-answer-to-the-top/58386/28 "2017-03-08T20:12:57Z")

</div>

I am quite happy with the styling now! thanks @david

 ![](https://global.discourse-cdn.com/meta/original/3X/c/1/c18d2d283e41014febb93051192624e8338451b4.png)

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017年三月8日 20:13 UTC](https://meta.discourse.org/t/option-to-move-accepted-answer-to-the-top/58386/29 "2017-03-08T20:13:03Z")

</div>



[上一頁](https://meta.discourse.org/t/option-to-move-accepted-answer-to-the-top/58386.md?page=1)
