@yuneta/gobj-ui 7.23.134 → 7.23.135

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64194,7 +64194,7 @@ function refresh_legend(gobj) {
64194
64194
  $legend.textContent = "";
64195
64195
  if (!state || !(0, _yuneta_gobj_js.is_array)(state.topics)) return;
64196
64196
  let topics = state.topics.slice().sort((a, b) => {
64197
- return (a.topic === state.main_topic ? 0 : 1) - (b.topic === state.main_topic ? 0 : 1);
64197
+ return String(a.topic).localeCompare(String(b.topic));
64198
64198
  });
64199
64199
  for (let entry of topics) {
64200
64200
  let topic_name = entry.topic;
@@ -64189,7 +64189,7 @@ function refresh_legend(gobj) {
64189
64189
  $legend.textContent = "";
64190
64190
  if (!state || !is_array(state.topics)) return;
64191
64191
  let topics = state.topics.slice().sort((a, b) => {
64192
- return (a.topic === state.main_topic ? 0 : 1) - (b.topic === state.main_topic ? 0 : 1);
64192
+ return String(a.topic).localeCompare(String(b.topic));
64193
64193
  });
64194
64194
  for (let entry of topics) {
64195
64195
  let topic_name = entry.topic;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.134",
3
+ "version": "7.23.135",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -2562,12 +2562,15 @@ function refresh_legend(gobj)
2562
2562
  return; /* nothing drawn yet: the engine has not spoken */
2563
2563
  }
2564
2564
 
2565
- /* The main topic leads the strip: it is the trunk everything else
2566
- * hangs from, and the eye reads the strip left to right. */
2565
+ /* ALPHABETICAL, always, and the main topic takes no seat of its
2566
+ * own. It used to lead the strip, so starring a topic moved every
2567
+ * chip -- the one just pressed jumped out from under the pointer
2568
+ * -- and the rest came in the backend's order, which is not the
2569
+ * same from one load to the next. A chip is found by WHERE it is;
2570
+ * the main one is already told apart by its gold star and its
2571
+ * bold name. */
2567
2572
  let topics = state.topics.slice().sort((a, b) => {
2568
- let am = (a.topic === state.main_topic)? 0 : 1;
2569
- let bm = (b.topic === state.main_topic)? 0 : 1;
2570
- return am - bm;
2573
+ return String(a.topic).localeCompare(String(b.topic));
2571
2574
  });
2572
2575
 
2573
2576
  for(let entry of topics) {