Skip to content

fix(dashboard): request details render any content shape; account order saved atomically - #80

Merged
filipeforattini merged 1 commit into
mainfrom
fix/dashboard-fixes
Sep 23, 2026
Merged

filipeforattini merged 1 commit into
mainfrom
fix/dashboard-fixes

Conversation

@filipeforattini

@filipeforattini filipeforattini commented Sep 23, 2026 •

Copy link
Copy Markdown

Part 4 of 4 of the plan from the review of decolua/9router and PentatonicDev/9router.

What

  • Request details (PentatonicDev cb937dd): response.content and thinking were rendered straight into a <pre>, which crashed on an array of content blocks. safeText() (src/shared/utils/safeText.js) renders strings as-is and anything else as JSON.
  • Account reorder (upstream fix(providers): persist account reorder correctly and resync on failure decolua/9router#4280, plus one bug of ours):
    • The old handler wrote two 0-based priorities in parallel, so the last write won.
    • It also indexed the full list with positions taken from the owner-filtered list, so the wrong rows moved while a filter was on.
    • The UI now swaps within the list on screen and saves it once through PUT /api/providers/reorder. That route:
      • fills the visible accounts' own slots, so hidden accounts keep theirs;
      • writes priorities 1..N in one transaction (setConnectionOrder);
      • rejects a list that doesn't name each visible account exactly once;
      • keeps shared accounts admin-managed under ownership scope, as the single-account edit already does.
  • Priority 0: reorderInTx read a missing or 0 priority as first, while getProviderConnections read it as last. Both now read it as last.

Dropped from the plan: the usage-by-key grouping item. It was fixed, more thoroughly, in #77: opaque keys, no raw keys in any period.

Tests

  • dashboard-fixes.test.js:
    • safeText;
    • setConnectionOrder (explicit order, unlisted accounts kept in place, unknown ids ignored);
    • the route (hidden-slot preservation, validation, shared accounts under scope).
  • db-sqlite-vs-lowdb.test.js and request-details-tab.test.js pass unchanged.
  • Full suite run locally with --maxWorkers=2: 364 files passed, 0 failures.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…er saved atomically

- The request-details view rendered response.content/thinking straight into a
  <pre>, crashing on an array of content blocks (PentatonicDev cb937dd).
  safeText() renders strings as-is and anything else as JSON.
- Reordering accounts wrote two 0-based priorities in parallel (last write
  won; upstream decolua#4280), and indexed the full list with positions from the
  owner-filtered one, so the wrong rows moved when a filter was on. The UI now
  swaps within the list on screen and saves it once through
  PUT /api/providers/reorder, which fills the visible accounts' own slots
  (hidden ones keep theirs), writes 1..N in one transaction
  (setConnectionOrder), and keeps shared accounts admin-managed.
- reorderInTx read a missing/0 priority as first while getProviderConnections
  read it as last; both now read it as last.
@filipeforattini
filipeforattini merged commit 32fa7ac into main Sep 23, 2026
2 checks passed
@filipeforattini
filipeforattini deleted the fix/dashboard-fixes branch September 23, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant