@asteby/metacore-runtime-react 20.1.2 → 20.1.3

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @asteby/metacore-runtime-react
2
2
 
3
+ ## 20.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 8c6635c: fix(dynamic-table): preserve `view`/`group_by` in the URL when the table syncs its state
8
+
9
+ The table's url-sync rebuilt the query string from scratch (only its own
10
+ page/sort/filter keys) and `replaceState`d it, wiping the route-owned
11
+ `view`/`group_by` params. On a same-model board↔list pair (e.g. github's Board
12
+ `?view=kanban` vs Issues `?view=table`) this stripped `?view` on mount, so the
13
+ URL went bare and the sidebar active-state fell back to the model default —
14
+ highlighting the wrong sibling until you clicked again. The sync now carries
15
+ `view`/`group_by` through so the open entry stays highlighted on a single click
16
+ and `?view` deep-links survive table interaction.
17
+
3
18
  ## 20.1.2
4
19
 
5
20
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-table.d.ts","sourceRoot":"","sources":["../src/dynamic-table.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAKH,KAAK,SAAS,EAajB,MAAM,uBAAuB,CAAA;AAgC9B,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAWnF,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;IAC7C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;IAC/B,cAAc,CAAC,EAAE,GAAG,CAAA;IACpB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iB,CAAC,EAAE,iBAAiB,CAAA;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,wBAAgB,YAAY,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,aAAoB,EACpB,aAAkB,EAClB,QAAQ,EACR,UAAU,EACV,cAAc,EACd,cAAc,EACd,YAAiB,EACjB,iBAA4C,EAC5C,QAAQ,EACR,QAAQ,GACX,EAAE,iBAAiB,+BAw5BnB"}
@@ -147,6 +147,20 @@ export function DynamicTable({ model, endpoint, enableUrlSync = true, hiddenColu
147
147
  if (!enableUrlSync || !initializedFromUrl.current)
148
148
  return;
149
149
  const params = new URLSearchParams();
150
+ // Preserve the route-owned view params. The table rebuilds the query
151
+ // string from scratch (it only knows its own page/sort/filter keys), but
152
+ // `view`/`group_by` belong to the renderer choice + the sidebar's
153
+ // active-state matcher. Carrying them over keeps `?view=table` (vs
154
+ // `?view=kanban`) in the URL so the open sibling stays highlighted and a
155
+ // deep-link survives — without this the table wipes `?view` on mount,
156
+ // the URL goes bare, and the sidebar falls back to the model default
157
+ // (the "click twice to move the active to the right entry" bug).
158
+ const current = new URLSearchParams(window.location.search);
159
+ for (const key of ['view', 'group_by']) {
160
+ const v = current.get(key);
161
+ if (v)
162
+ params.set(key, v);
163
+ }
150
164
  if (pagination.pageIndex > 0)
151
165
  params.set('page', String(pagination.pageIndex + 1));
152
166
  if (pagination.pageSize !== 10)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asteby/metacore-runtime-react",
3
- "version": "20.1.2",
3
+ "version": "20.1.3",
4
4
  "description": "React runtime for metacore hosts — renders addon contributions dynamically",
5
5
  "repository": {
6
6
  "type": "git",
@@ -67,8 +67,8 @@
67
67
  "typescript": "^6.0.0",
68
68
  "vitest": "^4.0.0",
69
69
  "zustand": "^5.0.0",
70
- "@asteby/metacore-ui": "2.6.2",
71
- "@asteby/metacore-sdk": "3.2.0"
70
+ "@asteby/metacore-sdk": "3.2.0",
71
+ "@asteby/metacore-ui": "2.6.2"
72
72
  },
73
73
  "scripts": {
74
74
  "build": "tsc -p tsconfig.json",
@@ -257,6 +257,19 @@ export function DynamicTable({
257
257
  useEffect(() => {
258
258
  if (!enableUrlSync || !initializedFromUrl.current) return
259
259
  const params = new URLSearchParams()
260
+ // Preserve the route-owned view params. The table rebuilds the query
261
+ // string from scratch (it only knows its own page/sort/filter keys), but
262
+ // `view`/`group_by` belong to the renderer choice + the sidebar's
263
+ // active-state matcher. Carrying them over keeps `?view=table` (vs
264
+ // `?view=kanban`) in the URL so the open sibling stays highlighted and a
265
+ // deep-link survives — without this the table wipes `?view` on mount,
266
+ // the URL goes bare, and the sidebar falls back to the model default
267
+ // (the "click twice to move the active to the right entry" bug).
268
+ const current = new URLSearchParams(window.location.search)
269
+ for (const key of ['view', 'group_by']) {
270
+ const v = current.get(key)
271
+ if (v) params.set(key, v)
272
+ }
260
273
  if (pagination.pageIndex > 0) params.set('page', String(pagination.pageIndex + 1))
261
274
  if (pagination.pageSize !== 10) params.set('per_page', String(pagination.pageSize))
262
275
  if (sorting.length > 0) {