Button with Checkmark should be hidden to users who can't unmark correct answers

ok, so here are some smaller changes to start with:

  • If I can accept/unaccept it’s the same button we have now (I did move the text to exist within the button)…

  • If I can’t accept/unaccept, instead of showing a button just show the solved text with a checkmark. This makes it less button-like, which was the original request OP was making.

    I also added a title attribute to this text that says “This is the accepted solution to this topic.” Our current method of having a button that doesn’t do anything is likely very confusing for anyone using a screen reader. This would clear that up significantly.

38%20AM

Here’s a PR for these changes:

https://github.com/discourse/discourse-solved/pull/80


In the above changes I haven’t made any additional updates for mobile… our layout there tends to be a little broken when you expand all the controls because there’s not enough space for everything (if you’re an admin for example).

As a next step I’d like to add a class when the post controls are expanded/collapsed so we can show/hide the “solved” text. Then in most cases everything will fit like so:

08%20AM

32%20AM

9 Likes