# Use ACE for badge queries

**URL:** <https://meta.discourse.org/t/use-ace-for-badge-queries/62331>\
**Category:** Feature\
**Created:** [5월 9, 2017, 4:23오전 UTC](https://meta.discourse.org/t/use-ace-for-badge-queries/62331 "2017-05-09T04:23:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![barryvan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barryvan/32/82635_2.png) [@barryvan](https://meta.discourse.org/u/barryvan)\
**Post date:** [5월 9, 2017, 4:23오전 UTC](https://meta.discourse.org/t/use-ace-for-badge-queries/62331/1 "2017-05-09T04:23:18Z")

</div>

When editing the query for a badge (if it’s enabled), it’d be great if the editor used was ACE, rather than a plain old `textarea`. At present I tend to write my queries in a different app and copy-paste them across so that I can make sure they’re nicely formatted and readable, but that’s a little arduous. 🙂

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [5월 9, 2017, 6:25오후 UTC](https://meta.discourse.org/t/use-ace-for-badge-queries/62331/2 "2017-05-09T18:25:25Z")

</div>

I took a quick look at this and it wasn’t a drop in replacement because the CSS for that component is designed to be much larger than the SQL badges. It’s totally doable, it’ll just take more than the 5 minutes I was hoping. Maybe someone can contribute a pr?

---

<div class="post-metadata">

**Author:** ![Osama](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osama/32/98013_2.png) [@Osama](https://meta.discourse.org/u/Osama)\
**Post date:** [10월 21, 2017, 10:27오후 UTC](https://meta.discourse.org/t/use-ace-for-badge-queries/62331/3 "2017-10-21T22:27:46Z")

</div>

I decided to give this #pr-welcome a shot this weekend and so far I’ve managed to replace the textarea with ACE (screenshot with minimal/required CSS changes to display ACE):

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/6/e632b4aad920039b150a985fcbf94e3edb649650.png)

To me it feels like it’s not quite there yet design-wise. Perhaps it should be a bit shorter with 1px bright border around it? like so:

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/0/90ad46abe88f81d0f854acaa92fd9910b2283bf1.png)

What do you guys think?

---

<div class="post-metadata">

**Author:** ![Osama](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osama/32/98013_2.png) [@Osama](https://meta.discourse.org/u/Osama)\
**Post date:** [10월 26, 2017, 8:39오후 UTC](https://meta.discourse.org/t/use-ace-for-badge-queries/62331/4 "2017-10-26T20:39:10Z")

</div>

Ok here is my PR:

[https://github.com/discourse/discourse/pull/5269](https://github.com/discourse/discourse/pull/5269)

And this is what I settled on:

- rounded corners
- lighter shade of grey for the left gutter
- and 270px height (above screenshot was 250)

Screenshot:

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/5/b5ff5ce99c31dc0841e8f16c8a52ebb11ce8b087.png)

Thoughts? 😁

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [10월 26, 2017, 8:46오후 UTC](https://meta.discourse.org/t/use-ace-for-badge-queries/62331/5 "2017-10-26T20:46:56Z")

</div>

Seems ok this area is up to @sam.

---

<div class="post-metadata">

**Author:** ![coderberry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/coderberry/32/99652_2.png) [@coderberry](https://meta.discourse.org/u/coderberry)\
**Post date:** [12월 7, 2017, 10:37오후 UTC](https://meta.discourse.org/t/use-ace-for-badge-queries/62331/6 "2017-12-07T22:37:42Z")

</div>

The PR was merged on Oct 30 🙌🏻

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [12월 7, 2017, 10:39오후 UTC](https://meta.discourse.org/t/use-ace-for-badge-queries/62331/7 "2017-12-07T22:39:22Z")

</div>


