GaurangTandon reported a usability issue where the text field for an “edit reason” fails to auto-focus after clicking the corresponding button in the composer. The user provided reproduction steps and expected the field to be highlighted immediately. GaurangTandon initially proposed a fix within the controller file but was unsure how to interact with the DOM. codinghorror confirmed the issue and asked for assistance. zogstrip clarified that DOM interactions should occur in the view layer, not the controller, and explained the Model-View-Controller (MVC) architecture used by Discourse (Rails backend, Ember frontend). Mittineague reinforced the MVC explanation and recommended the Ember documentation for further learning. GaurangTandon analyzed the code structure, identifying the relevant Handlebars template and controller logic, and hypothesized a solution using an observer in the view to trigger focus. Finally, sam confirmed the issue was resolved with a specific commit, noting it was more of a feature enhancement than a critical bug.
Oh, is Discourse using the Model View Controller kind of practice? I have only heard about it, but never studied, practiced or used it. Seems like a good time to learn some MVC I will try to complete the first step you said.
My simplified answer would be
Discourse has a Rails backend (and yes, Rails is MVC)
with an Ember frontend (and yes, Ember is MVC)
Most of what I have exploring is es6 (a flavor of JavaScript) and some hbs (handlebars/htmlbars templates) files so I would recommend the Ember documentation.
There is a lot there, almost overwhelmingly so (for me anyway), but it will definitely help you get your toes wet.