@ihyeon/flow-qa 0.10.8 → 0.10.10

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/dist/src/cli.js CHANGED
@@ -431,6 +431,9 @@ export async function main(args) {
431
431
  return data;
432
432
  };
433
433
  const before = await load(arg), after = await load(second);
434
+ if (before.runId && before.runId === after.runId) {
435
+ throw new Error(localized(locale, 'A comparison needs two different runs.', '서로 다른 두 실행을 선택해야 합니다.'));
436
+ }
434
437
  const sameSelection = JSON.stringify(before.cases.map((item) => item.id).sort()) === JSON.stringify(after.cases.map((item) => item.id).sort());
435
438
  const comparable = before.suiteId === after.suiteId && before.suiteHash === after.suiteHash && sameReportTarget(before.target, after.target) && sameSelection;
436
439
  console.log(comparable ? localized(locale, 'Comparing the same suite, target and case selection (check external data state separately)', '동일 명세·대상·케이스 범위 비교 (외부 데이터 상태는 별도 확인)') : localized(locale, 'Suite, target or case selection differs; no direct regression verdict is made.', '명세·대상 또는 케이스 범위가 달라 직접적인 회귀 판정은 하지 않습니다.'));
@@ -5,7 +5,7 @@
5
5
  const t = i18n.t;
6
6
  const names = { scenario: 'nav.scenario', library: 'nav.library', history: 'nav.history', settings: 'nav.settings' };
7
7
  const defaultReportFilter = () => ({ search: '', status: 'all', sort: 'recorded', repeatedOnly: false });
8
- const app = { state: null, connected: false, displayTargets: [], draft: null, selectedCaseIds: new Set(), script: '', neutralScript: '', scriptRevision: 0, savedFile: '', savedHash: '', origin: 'none', sourceFlow: '', boundSource: null, stale: false, dirty: false, busy: false, planning: false, planRequest: 0, stopping: false, report: null, reportParent: null, reportMarkdown: '', selectedRun: '', reportFilter: defaultReportFilter(), rerunOrigin: null, rerunTargetMismatch: false, navigationVersion: 0, comparison: null, comparisonRequest: 0, comparisonBusy: false, comparisonStatus: 'comparison.selectBoth', comparisonPins: { baseline: null, current: null }, comparisonSelectionGeneration: 0, comparisonValidation: null, history: { runs: [], nextCursor: null, pagesLoaded: 0, loaded: false, loading: false, request: 0, debounce: null, kind: null, error: null, updatesAvailable: false, pendingRecentUpdate: false, parentRunId: '' }, view: 'scenario' };
8
+ const app = { state: null, connected: false, displayTargets: [], draft: null, selectedCaseIds: new Set(), script: '', neutralScript: '', scriptRevision: 0, savedFile: '', savedHash: '', origin: 'none', sourceFlow: '', boundSource: null, stale: false, dirty: false, busy: false, planning: false, planRequest: 0, stopping: false, report: null, reportParent: null, reportMarkdown: '', selectedRun: '', reportRequest: 0, reportLoading: false, reportFilter: defaultReportFilter(), rerunOrigin: null, rerunTargetMismatch: false, navigationVersion: 0, comparison: null, comparisonRequest: 0, comparisonBusy: false, comparisonStatus: 'comparison.selectBoth', comparisonPins: { baseline: null, current: null }, comparisonSelectionGeneration: 0, comparisonValidation: null, history: { runs: [], nextCursor: null, pagesLoaded: 0, loaded: false, loading: false, request: 0, debounce: null, kind: null, error: null, updatesAvailable: false, pendingRecentUpdate: false, parentRunId: '' }, view: 'scenario' };
9
9
 
10
10
  function el(tag, className, value) {
11
11
  const node = document.createElement(tag);
@@ -732,7 +732,35 @@
732
732
  catch (error) { showError(error); }
733
733
  finally { app.stopping = false; readiness(); }
734
734
  }
735
- async function loadReport(runId) { await work(async () => { const result = await api(`/api/report?runId=${encodeURIComponent(runId)}`); if (app.selectedRun !== runId) app.reportFilter = defaultReportFilter(); app.report = result.report; app.reportParent = result.parentRun || null; app.reportMarkdown = result.markdown; app.selectedRun = runId; renderReport(); readiness(); $('report-panel').hidden = false; $('report-panel').scrollIntoView({ behavior: 'smooth', block: 'start' }); }); }
735
+ async function loadReport(runId) {
736
+ if (app.busy && !app.reportLoading) return;
737
+ const request = ++app.reportRequest;
738
+ app.reportLoading = true;
739
+ app.busy = true;
740
+ readiness();
741
+ notice('');
742
+ try {
743
+ const result = await api(`/api/report?runId=${encodeURIComponent(runId)}`);
744
+ if (request !== app.reportRequest) return;
745
+ if (app.selectedRun !== runId) app.reportFilter = defaultReportFilter();
746
+ app.report = result.report;
747
+ app.reportParent = result.parentRun || null;
748
+ app.reportMarkdown = result.markdown;
749
+ app.selectedRun = runId;
750
+ renderReport();
751
+ readiness();
752
+ $('report-panel').hidden = false;
753
+ $('report-panel').scrollIntoView({ behavior: 'smooth', block: 'start' });
754
+ } catch (error) {
755
+ if (request === app.reportRequest) showError(error);
756
+ } finally {
757
+ if (request === app.reportRequest) {
758
+ app.reportLoading = false;
759
+ app.busy = false;
760
+ readiness();
761
+ }
762
+ }
763
+ }
736
764
  async function prepareFailedCases() { await work(async () => {
737
765
  const runId = app.selectedRun;
738
766
  const report = app.report;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ihyeon/flow-qa",
3
- "version": "0.10.8",
3
+ "version": "0.10.10",
4
4
  "license": "MIT",
5
5
  "author": "Hyeonse Im",
6
6
  "repository": {