Skip to content

Conversation

@ireneea
Copy link
Contributor

@ireneea ireneea commented Nov 24, 2025

Summary

Re-use the same display format between the InsightsDataRangePicker and the InsightsSummary component

Related Linear tickets, Github issues, and Community forum posts

Resolves PAY-4148

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Nov 24, 2025
@ireneea ireneea marked this pull request as ready for review November 24, 2025 17:55
@currents-bot
Copy link

currents-bot bot commented Nov 24, 2025

E2E Tests: n8n tests passed after 9m 26.6s

🟢 588 · 🔴 0 · ⚪️ 12 · 🟣 2

View Run Details

Run Details

  • Project: n8n

  • Groups: 2

  • Framework: Playwright

  • Run Status: Passed

  • Commit: f9934f4

  • Spec files: 96

  • Overall tests: 600

  • Duration: 9m 26.6s

  • Parallelization: 9

Groups

GroupId Results Spec Files Progress
ui 🟢 539 · 🔴 0 · ⚪️ 12 · 🟣 2 90 / 90
ui:isolated 🟢 49 · 🔴 0 · ⚪️ 0 6 / 6


This message was posted automatically by currents.dev | Integration Settings

@bundlemon
Copy link

bundlemon bot commented Nov 24, 2025

BundleMon

Unchanged files (2)
Status Path Size Limits
WASM Dependencies
tree-sitter-bash.wasm
181.26KB -
WASM Dependencies
tree-sitter.wasm
74.47KB -

No change in files bundle size

Groups updated (2)
Status Path Size Limits
**/*.js
11.39MB (+100.97KB +0.87%) -
**/*.css
231.52KB (+10.75KB +4.87%) -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 5 files

Prompt for AI agents (all 5 issues)

Understand the root cause of the following 5 issues and fix them.


<file name="packages/frontend/editor-ui/src/features/execution/insights/insights.utils.ts">

<violation number="1" location="packages/frontend/editor-ui/src/features/execution/insights/insights.utils.ts:103">
Formatting the selected range by calling `dateformat` on the ISO string causes off‑by‑one‑day displays for users west of UTC. Convert the `DateValue` to a local `Date` (e.g., `start.toDate(getLocalTimeZone())`) before formatting so the displayed day matches the picker.</violation>

<violation number="2" location="packages/frontend/editor-ui/src/features/execution/insights/insights.utils.ts:124">
Rule violated: **Prefer Typeguards over Type casting**

Avoid type assertions for narrowing here. Replace the `as Array&lt;[InsightsDateRange[&#39;key&#39;], number]&gt;` cast with a type-safe alternative (e.g., iterate with a type guard over Object.entries or introduce a helper that returns typed key/value tuples) so the preset detection logic doesn’t rely on unsafe casting.</violation>
</file>

<file name="packages/frontend/editor-ui/src/features/execution/insights/insights.utils.test.ts">

<violation number="1" location="packages/frontend/editor-ui/src/features/execution/insights/insights.utils.test.ts:271">
The “custom range” test becomes time-dependent because the dynamic end date occasionally matches a preset range, causing intermittent failures. Use an end date captured in a variable and subtract a non-preset number of days for the start so the assertion stays deterministic.</violation>
</file>

<file name="packages/frontend/editor-ui/src/features/execution/insights/components/InsightsSummary.vue">

<violation number="1" location="packages/frontend/editor-ui/src/features/execution/insights/components/InsightsSummary.vue:21">
Move the newly added `DateValue` import above the constant declarations so that all imports remain at the top of the module; otherwise the file fails linting/compilation because imports must precede other statements.</violation>

<violation number="2" location="packages/frontend/editor-ui/src/features/execution/insights/components/InsightsSummary.vue:55">
Rule violated: **Tests**

The new `displayDateRangeLabel` path was added without any unit/UI test rendering InsightsSummary with custom `startDate`/`endDate`, even though the Community PR Guidelines require UI changes to ship with tests. According to linked Linear issue PAY-4148, the overview cards must display the selected range—please add a regression test that covers a non-preset date range so this bug cannot return.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

❌ Patch coverage is 91.83673% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...xecution/insights/components/InsightsDashboard.vue 33.33% 2 Missing ⚠️
...on/insights/components/InsightsDataRangePicker.vue 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@guillaumejacquart guillaumejacquart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me :)

@ireneea ireneea merged commit 3130d20 into master Nov 25, 2025
34 checks passed
@ireneea ireneea deleted the pay-4148-insight-overview-always-shows-last-7-days branch November 25, 2025 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

n8n team Authored by the n8n team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants