Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nikhilkuria
Copy link
Contributor

Summary

The workflow history actions render changes based on the focus panel. This enables users to view the focus panel and close it if not needed.

  • Created new WorkflowHistoryActions component - Extracted action-related UI (version info display, action toggle button) from WorkflowHistoryContent.vue into a dedicated component for better separation of concerns
  • Uses cross-iframe communication for FocusPanel width - Added postMessage-based communication between the iframe (containing FocusPanel) and the parent window to dynamically adjust WorkflowHistoryActions width when FocusPanel is active

https://www.loom.com/share/656d82235546495986ef268da0dfb382

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/ADO-4557/bug-focus-tab-not-showing-up-in-workflow-history

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)

@bundlemon
Copy link

bundlemon bot commented Dec 18, 2025

BundleMon

Files added (2)
Status Path Size Limits
WASM Dependencies
tree-sitter-bash.wasm
+181.26KB -
WASM Dependencies
tree-sitter.wasm
+74.47KB -

Total files change +255.73KB

Groups added (2)
Status Path Size Limits
**/*.js
+6.05MB -
**/*.css
+240.41KB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history

@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 51.02041% with 72 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...kflowHistory/components/WorkflowHistoryActions.vue 22.58% 71 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Dec 18, 2025
@currents-bot
Copy link

currents-bot bot commented Dec 18, 2025

E2E Tests: n8n tests passed after 8m 25.5s

🟢 589 · 🔴 0 · ⚪️ 27 · 🟣 4

View Run Details

Run Details

  • Project: n8n

  • Groups: 2

  • Framework: Playwright

  • Run Status: Passed

  • Commit: 3030b0a

  • Spec files: 131

  • Overall tests: 616

  • Duration: 8m 25.5s

  • Parallelization: 9

Groups

GroupId Results Spec Files Progress
multi-main:ui 🟢 532 · 🔴 0 · ⚪️ 27 · 🟣 4 122 / 122
multi-main:ui:isolated 🟢 57 · 🔴 0 · ⚪️ 0 9 / 9


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

@nikhilkuria nikhilkuria marked this pull request as ready for review December 18, 2025 10:38
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.

2 issues found across 5 files

Prompt for AI agents (all 2 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/frontend/editor-ui/src/features/workflows/workflowHistory/components/WorkflowHistoryActions.vue">

<violation number="1" location="packages/frontend/editor-ui/src/features/workflows/workflowHistory/components/WorkflowHistoryActions.vue:90">
P2: Rule violated: **Prefer Typeguards over Type casting**

Avoid using `as` for type narrowing. Since `value` comes from the action toggle component which should emit valid action types, use a type annotation on the parameter instead of casting inside the function body.</violation>
</file>

<file name="packages/frontend/editor-ui/src/app/components/WorkflowPreview.vue">

<violation number="1" location="packages/frontend/editor-ui/src/app/components/WorkflowPreview.vue:185">
P2: Rule violated: **Prefer Typeguards over Type casting**

Using `as IframeMessage` for type narrowing on `JSON.parse()` result. Prefer a type guard to validate the structure before using it, or at minimum check that `json.command` is a string before accessing it.</violation>
</file>

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

const onAction = (value: string) => {
emit('action', {
action: value as WorkflowHistoryActionTypes[number],
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 18, 2025

Choose a reason for hiding this comment

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

P2: Rule violated: Prefer Typeguards over Type casting

Avoid using as for type narrowing. Since value comes from the action toggle component which should emit valid action types, use a type annotation on the parameter instead of casting inside the function body.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/frontend/editor-ui/src/features/workflows/workflowHistory/components/WorkflowHistoryActions.vue, line 90:

<comment>Avoid using `as` for type narrowing. Since `value` comes from the action toggle component which should emit valid action types, use a type annotation on the parameter instead of casting inside the function body.</comment>

<file context>
@@ -0,0 +1,241 @@
+
+const onAction = (value: string) =&gt; {
+	emit(&#39;action&#39;, {
+		action: value as WorkflowHistoryActionTypes[number],
+		id: props.workflowVersion.versionId,
+		data: {
</file context>
Fix with Cubic

return;
}
try {
const json = JSON.parse(data) as IframeMessage;
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 18, 2025

Choose a reason for hiding this comment

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

P2: Rule violated: Prefer Typeguards over Type casting

Using as IframeMessage for type narrowing on JSON.parse() result. Prefer a type guard to validate the structure before using it, or at minimum check that json.command is a string before accessing it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/frontend/editor-ui/src/app/components/WorkflowPreview.vue, line 185:

<comment>Using `as IframeMessage` for type narrowing on `JSON.parse()` result. Prefer a type guard to validate the structure before using it, or at minimum check that `json.command` is a string before accessing it.</comment>

<file context>
@@ -178,6 +159,38 @@ const onError = () =&gt; {
+		return;
+	}
+	try {
+		const json = JSON.parse(data) as IframeMessage;
+		if (json.command in commandHandlers) {
+			commandHandlers[json.command](json);
</file context>
Fix with Cubic

Copy link
Contributor

@MiloradFilipovic MiloradFilipovic left a comment

Choose a reason for hiding this comment

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

Nice, kudos for extracting it to a separate component. I left a few comments and I generally agree with AI review (using typeguards)

interface IframeMessage {
command: string;
width?: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

The name IframeMessage suggests this is a generic iframe message but it has focus panel-specific properties. I suggest either renaming to FocusPanelMessage or use generic payload property to transfer data.

emit('close');
};
interface IframeMessage {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Any reason why this is an interface and CommandHandler is a type? Also, we could move these to the top of the file, they are hard to spot in this place

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