Skip to content

Conversation

@benceruleanlu
Copy link
Member

@benceruleanlu benceruleanlu commented Oct 15, 2025

"The watcher that should keep the active workflow tab visible compares the tab’s bounds against the scroll panel’s content element, whose rectangle spans the entire scroll width instead of the visible viewport. As a result, when the active tab starts off-screen, the computed offsets stay ≤ 0 and no corrective scroll occurs, so the selected tab remains hidden."

fixes #6057


https://chatgpt.com/codex/tasks/task_e_68efe2b5b4a08330940a20552c1db339

@github-actions
Copy link

github-actions bot commented Oct 15, 2025

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 10/15/2025, 06:49:45 PM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Oct 15, 2025

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 10/15/2025, 07:13:33 PM UTC

📈 Summary

  • Total Tests: 497
  • Passed: 463 ✅
  • Failed: 0
  • Flaky: 4 ⚠️
  • Skipped: 30 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 454 / ❌ 0 / ⚠️ 4 / ⏭️ 30
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 6 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 15, 2025
@benceruleanlu benceruleanlu marked this pull request as ready for review October 15, 2025 20:44
@benceruleanlu
Copy link
Member Author

the adjacent ts code in WorkflowTabs.vue has some suspicious parts with bugs in not stopping watcchers and poking into $el internals, but it's out of scope for this

@benceruleanlu
Copy link
Member Author

codex did not post the link

it's here: #6080

honestly optional to review, can drop it entirely, no biggie

@christian-byrne christian-byrne added the claude-review Add to trigger a PR code review from Claude Code label Oct 17, 2025
const offsetLeft = tabRect.left - containerRect.left
const offsetRight = tabRect.right - containerRect.right
activeTabElement.scrollIntoView({ block: 'nearest', inline: 'nearest' })
Copy link

Choose a reason for hiding this comment

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

[quality] medium Priority

Issue: Missing error handling for DOM operations that could fail
Context: The scrollIntoView method can throw errors if the element is not properly attached to DOM or if scrolling is restricted
Suggestion: Wrap the scrollIntoView call in a try-catch block to handle potential DOM exceptions gracefully

Copy link
Member Author

Choose a reason for hiding this comment

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

non blocking

'.p-scrollpanel-content'
)
if (!container) return
const scrollPanelElement = scrollPanelRef.value?.$el as
Copy link

Choose a reason for hiding this comment

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

[performance] low Priority

Issue: Potentially redundant DOM queries in scroll behavior
Context: The function queries scrollPanelElement and then queries within it, but could cache the scroll panel content element for better performance
Suggestion: Consider caching the scroll panel content element reference to avoid repeated queries, especially since this function is called frequently during scroll events

Copy link
Member Author

Choose a reason for hiding this comment

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

non blocking

() => workflowStore.activeWorkflow,
async () => {
if (!selectedWorkflow.value) return
const ensureActiveTabVisible = async () => {
Copy link

Choose a reason for hiding this comment

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

[architecture] low Priority

Issue: Function scope could be better optimized for component lifecycle
Context: The ensureActiveTabVisible function is defined in component scope but could benefit from being memoized or having better lifecycle management
Suggestion: Consider using useMemo or moving to a composable if this function will be reused across components, or add better cancellation for pending async operations when component unmounts

Copy link
Member Author

Choose a reason for hiding this comment

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

non blocking

const offsetLeft = tabRect.left - containerRect.left
const offsetRight = tabRect.right - containerRect.right
activeTabElement.scrollIntoView({ block: 'nearest', inline: 'nearest' })
Copy link

Choose a reason for hiding this comment

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

[quality] low Priority

Issue: ScrollIntoView options may not be supported in all target browsers
Context: The block: 'nearest' and inline: 'nearest' options are relatively modern features that may not be supported in older browsers
Suggestion: Consider checking browser compatibility requirements or add a fallback for older browsers. Alternatively, document the minimum browser version requirements if not already specified

Copy link
Member Author

Choose a reason for hiding this comment

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

non blocking

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Comprehensive PR Review

This review is generated by Claude. It may not always be accurate, as with human reviewers. If you believe that any of the comments are invalid or incorrect, please state why for each. For others, please implement the changes in one way or another.

Review Summary

PR: Use scrollIntoView to keep active workflow tab visible (#6077)
Impact: 19 additions, 22 deletions across 1 file

Issue Distribution

  • Critical: 0
  • High: 0
  • Medium: 1
  • Low: 3

Category Breakdown

  • Architecture: 1 issue
  • Security: 0 issues
  • Performance: 1 issue
  • Code Quality: 2 issues

Key Findings

Architecture & Design

The change follows Vue 3 Composition API patterns correctly and maintains the established component structure. The refactored function ensureActiveTabVisible provides better separation of concerns by extracting the scroll logic into a dedicated function. However, consider lifecycle management optimizations for better component performance.

Security Considerations

No security vulnerabilities identified. The DOM manipulation uses safe element queries and doesn't introduce XSS or injection risks.

Performance Impact

The simplified scrollIntoView approach should be more performant than manual getBoundingClientRect calculations. However, there are opportunities for optimization through DOM query caching and better error handling.

Integration Points

This change maintains backward compatibility with existing scroll behavior and doesn't affect the extension system or other components. The fix addresses issue #6057 regarding hidden active tabs.

Positive Observations

  • Clean simplification that replaces complex manual scroll calculations with native browser API
  • Maintains proper Vue 3 Composition API patterns
  • Good separation of concerns with extracted function
  • Proper null checking and early returns
  • Resolves the reported bug effectively

References

Next Steps

  1. Address the medium priority error handling issue before merge
  2. Consider the low priority performance and architecture improvements for future iterations
  3. Verify browser compatibility if targeting older browsers
  4. Test the scroll behavior across different screen sizes and tab configurations

This is a comprehensive automated review. For architectural decisions requiring human judgment, please request additional manual review.

@github-actions github-actions bot removed the claude-review Add to trigger a PR code review from Claude Code label Oct 17, 2025
Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

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

LGTM!

@christian-byrne christian-byrne merged commit 9f046a1 into main Oct 17, 2025
38 checks passed
@christian-byrne christian-byrne deleted the codex/fix-issue-6057-in-comfyui branch October 17, 2025 07:37
christian-byrne pushed a commit that referenced this pull request Oct 17, 2025
> "The watcher that should keep the active workflow tab visible compares
the tab’s bounds against the scroll panel’s content element, whose
rectangle spans the entire scroll width instead of the visible viewport.
As a result, when the active tab starts off-screen, the computed offsets
stay ≤ 0 and no corrective scroll occurs, so the selected tab remains
hidden."

fixes #6057

------
https://chatgpt.com/codex/tasks/task_e_68efe2b5b4a08330940a20552c1db339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Active Tab is not visible when number of tabs exceed window width

2 participants