apache / couchdb-fauxton

Fauxton is the new Web UI for CouchDB

Home Page:https://github.com/apache/couchdb-fauxton

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSON editor uses 3-space indent but draws guides at 2

adamlacoste opened this issue · comments

The JSON editors used in the Mango query and manage indexes screens will automatically reformat your input on submit. When it does this, it appears to use a 3-space indent, which is odd on its own, but it also contradicts the indent guides drawn in the editor every 2 spaces.

Expected Behavior

Upon submitting JSON input, the reformatted code's indentation and visual indent guides should match. Since a 3-space indent is nonstandard and the visual guides suggest that 2 spaces was intended, it seems like a 2-space indent should be used.

Current Behavior

Upon submitting JSON input, the reformatted code's indentation and visual indent guides do not match. The code uses a 3-space indent even though the visual guides are drawn every two columns.

Context

I realize this is a trivial thing and will probably not be a high priority fix. I suspect it would be simple to correct for someone who knows their way around the code, but my search through the code did not turn up any clear place where this indent size was being set. If anybody more familiar with the codebase could point me in the right direction, I would be happy to submit a pull request to fix this.

Environment

  • Version used: CouchDB 3.1.1
  • Browser Name and version: Safari 14.0.3
  • Operating System and version (desktop or mobile): MacOS 11.2.3

hello @adamlacoste, can I work on this?

Hi @adamlacoste, I was trying to replicate your issue with the 3 space indent but it seems like mine shows 2 spaces, any change you could produce a screenshot?

No problem @pas-trop-de-zele, I have attached two images. The first was taken in fauxton's mango query editor in Couch v3.2.0 on MacOS (Big Sur) Safari (15.0). The second is that same JSON copied into Sublime Text, which better illustrates the whitespace in use.

fauxton_3space_mango

fauxton_3space_sublime