discourse/app/assets/javascripts/admin/addon/components/schema-theme-setting
Alan Guo Xiang Tan 70f7d369fb
DEV: Rewrite SchemaThemeSetting::Editor to avoid rerendering problems (#26416)
Why this change?

Prior to this change, the `SchemaThemeSetting::Editor#tree` was creating a
new `Tree` instance which holds instances of `Node`. Both classes
consisted of tracked properties. The problem with this approach is that
when any tracked properties is updated, Ember will revaluate
`SchemaThemeSetting::Editor#tree` and because that method always return
a new instance of `Tree`, it causes the whole navigation tree to
rerender just because on tracked property changed.

This rerendering of the whole navigation tree every time made it hard to
implement simple features like hiding a section in
9baa820d53. Instead of being able to just
declare a tracked property to hide/show a section, we end up with a more
complicated solution.

This commit rewrites `SchemaThemeSetting::Editor` to depend on Ember
components to form the tree structure instead. As needed, each component
in the tree structure can declare its own tracked property as necessary.
2024-03-28 21:13:02 +08:00
..
editor DEV: Rewrite SchemaThemeSetting::Editor to avoid rerendering problems (#26416) 2024-03-28 21:13:02 +08:00
types DEV: Change category type to categories type for theme object schema (#26339) 2024-03-27 10:54:30 +08:00
editor.gjs DEV: Rewrite SchemaThemeSetting::Editor to avoid rerendering problems (#26416) 2024-03-28 21:13:02 +08:00
field-input-description.gjs DEV: Add validation message to string fields in theme object editor (#26257) 2024-03-21 12:39:25 +08:00
field.gjs DEV: Support translations for property labels in objects schema editor (#26362) 2024-03-28 10:53:51 +08:00
number-field.gjs DEV: Add validation message to float fields in theme object editor (#26285) 2024-03-21 15:33:38 +08:00