Skip to content

feat(dashboard): orchestration canvas fase 3 — compare two runs in the History tab (2.9) - #12677

Merged
diegosouzapw merged 8 commits into
release/v3.8.51from
feat/orch-fase3-a
Sep 10, 2026
Merged

diegosouzapw merged 8 commits into
release/v3.8.51from
feat/orch-fase3-a

Conversation

@diegosouzapw

@diegosouzapw diegosouzapw commented Sep 4, 2026 •

Copy link
Copy Markdown
Owner

Orchestration Canvas — Fase 3 / PR-A: comparar duas execuções (item 2.9)

Primeira das quatro PRs da Fase 3. Única feature nova da fase — as outras três são dívida catalogada.

O que entra

  • Modelo puro model/compareRuns.ts: recebe dois HistoryItem e seus detalhes, devolve os dois lados normalizados mais os deltas com sinal. Sem React, sem fetch. Leitura defensiva por construção: o detalhe vem de JSON e, no caso do A2A, de metadata que o cliente envia sem validação — item malformado é descartado, lista ausente vira vazia, a função nunca lança.
  • Modo de comparação na aba History: com o modo desligado o clique segue abrindo o drawer, byte a byte como antes; ligado, dois cliques marcam as execuções e uma terceira seleção descarta a mais antiga. Estado local da aba.
  • Painel lado a lado: cabeçalho por execução, métricas com delta assinado e legenda de direção, timeline alinhada por índice (execuções de fontes diferentes não têm vocabulário comum de evento) e memórias consultadas quando existirem.
  • Reusa o mesmo caminho de detalhe do drawer, incluindo o fallback histórico da Fase 2. Nenhuma rota nova.
  • 10 chaves i18n com tradução real nos 42 locales.

Cuidados que a review final exigiu

  • Nunca exibir número onde o valor é desconhecido: enquanto um lado carrega, ou se a execução foi purgada pela retenção de 30 dias, a contagem de eventos e seu delta mostram —, não zero. Duração e custo continuam visíveis porque vêm do próprio item do grid, não da busca.
  • Painel com altura limitada: execuções de cloud agent com dezenas de atividades não esmagam mais o grid.
  • Timestamp inválido não chega ao DOM como Invalid Date; alerta só no lado que realmente falhou; aviso de identidades diferentes é role="status", não role="alert".

Validação

  • node:test do modelo puro (deltas com e sem dado, sameIdentity, detalhe malformado sem lançar) e vitest do modo e do painel — incluindo testes provados capazes de falhar se o conserto for revertido.
  • typecheck:core, check:dashboard-typecheck, test:vitest, check:cycles e i18n-vi-completeness verdes.

O gate local lint acusa supressões obsoletas herdadas da base (arquivo não tocado por esta PR).

Spec: _tasks/superpowers/specs/2026-09-03-orchestration-canvas-fase3-design.md §2 (privado). Seguem PR-B (#12392), PR-C (#12639) e PR-D (#12378).


⚠️ base-red inherited: #12732

Todo o vermelho desta PR vem do tip de release/v3.8.51, não do diff dela. Rastreio por job:

Job vermelho Causa na base Fix em voo
API Route Typecheck open-sse/executors/glm.ts TS2554 (aridade do buffer de stream) #12925
Unit Tests fast-path (1–4) gate de sanitização de stream + flake do catálogo Jina #12929, #12959
Merge integrity fragmento de changelog sem bullet #12923, #12932
Docs Gates / Fast Quality Gates contagens de docs + pack policy #12959

Os gates próprios desta PR (typecheck do dashboard, lint, testes de compareRuns/CompareRunsPanel/HistoryTab) passam localmente.

diegosouzapw and others added 5 commits September 3, 2026 21:28
…nd, ARIA level

Final-review fix wave for PR-A (Orchestration Canvas Fase 3):

- Give each compare-panel side an explicit fetch status (loading/ok/error) so the
  Events metrics row shows "—" instead of a misleading real "0"/delta while a side
  is still loading or after its fetch failed.
- Bound the compare panel's height (max-h-[45vh], overflow-y-auto, shrink-0) so a
  run with many activities can no longer collapse the History grid to zero height.
- Clear the compare selection when the History preset changes, since a stale pick
  can fall outside the new range.
- Add a delta-column legend (new compareDeltaLegend i18n key, translated into all
  41 non-English locales) so operators know which side a positive delta favors.
- Use role="status" (not role="alert") for the informational compareDifferentIdentity
  banner, reserving role="alert" for actual per-side fetch failures.
- Restore ro.json's compareCost to the true cognate "Cost" (was distorted to
  "Cheltuieli" to dodge a byte-identical-to-English heuristic); audited the other
  40 locales for the same pattern across the 9 compare* keys, no other instance found.
@diegosouzapw

Copy link
Copy Markdown
Owner Author

Held, not reviewed — Hard Rule #22b.

git worktree list shows a live worktree at .claude/worktrees/orch-fase3-a sitting on feat/orch-fase3-a at 596f5282, which is exactly this PR's head SHA. That is another session's in-flight work, so it is off-limits to this one: only the owning session merges it.

No action taken and nothing touched on the branch. Ping me once that worktree is torn down and I will pick it up in the next batch.

…r complexity ratchets

CompareRunsPanel (92 lines, max-lines-per-function) and HistoryTab (85 lines,
same rule) exceeded the 80-line function cap; compareRuns.ts's a2aEventsFrom
exceeded the cognitive-complexity cap (16 > 15). Extract pure/presentational
helpers (ComparePanelHeaderBar, SideErrorRow, ComparisonMetrics, a2aEventFrom,
HistoryStatusRows, refreshNowMsOnActionDone) with no behavior, DOM, i18n or
aria change.
@diegosouzapw
diegosouzapw merged commit 13d792c into release/v3.8.51 Sep 10, 2026
14 of 21 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…e History tab (2.9) (diegosouzapw#12677)

* feat(dashboard): pure model to compare two orchestration runs

* feat(dashboard): compare-mode selection in the History grid

* feat(dashboard): side-by-side comparison panel in the History tab (2.9)

* chore(dashboard): compare-runs i18n + changelog

* fix(dashboard): compare-panel loading state, height bound, delta legend, ARIA level

Final-review fix wave for PR-A (Orchestration Canvas Fase 3):

- Give each compare-panel side an explicit fetch status (loading/ok/error) so the
  Events metrics row shows "—" instead of a misleading real "0"/delta while a side
  is still loading or after its fetch failed.
- Bound the compare panel's height (max-h-[45vh], overflow-y-auto, shrink-0) so a
  run with many activities can no longer collapse the History grid to zero height.
- Clear the compare selection when the History preset changes, since a stale pick
  can fall outside the new range.
- Add a delta-column legend (new compareDeltaLegend i18n key, translated into all
  41 non-English locales) so operators know which side a positive delta favors.
- Use role="status" (not role="alert") for the informational compareDifferentIdentity
  banner, reserving role="alert" for actual per-side fetch failures.
- Restore ro.json's compareCost to the true cognate "Cost" (was distorted to
  "Cheltuieli" to dodge a byte-identical-to-English heuristic); audited the other
  40 locales for the same pattern across the 9 compare* keys, no other instance found.

* refactor(dashboard): split compare-runs/history-tab functions to clear complexity ratchets

CompareRunsPanel (92 lines, max-lines-per-function) and HistoryTab (85 lines,
same rule) exceeded the 80-line function cap; compareRuns.ts's a2aEventsFrom
exceeded the cognitive-complexity cap (16 > 15). Extract pure/presentational
helpers (ComparePanelHeaderBar, SideErrorRow, ComparisonMetrics, a2aEventFrom,
HistoryStatusRows, refreshNowMsOnActionDone) with no behavior, DOM, i18n or
aria change.

---------

Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
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