-
Notifications
You must be signed in to change notification settings - Fork 440
fix: should allow autoCols=true when server doesn't provide size #7132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 12/04/2025, 02:21:48 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
📝 WalkthroughWalkthroughTerminal component simplified: auto-sizing enabled and server-provided terminal size handling removed. The update flow now writes only log entries to the terminal; any code paths that passed or applied a server-provided size were removed. Changes
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (15)**/*.vue📄 CodeRabbit inference engine (.cursorrules)
|
🎭 Playwright Test Results⏰ Completed at: 12/04/2025, 02:30:55 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.2 MB (baseline 3.2 MB) • 🟢 -117 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 972 kB (baseline 972 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 6.54 kB (baseline 6.54 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 298 kB (baseline 298 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 6 added / 6 removed UI Components — 169 kB (baseline 169 kB) • ⚪ 0 BReusable component library chunks
Status: 6 added / 6 removed Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 2 added / 2 removed Utilities & Hooks — 2.94 kB (baseline 2.94 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 1 added / 1 removed Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 3.81 MB (baseline 3.81 MB) • ⚪ 0 BBundles that do not match a named category
Status: 17 added / 17 removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/components/bottomPanel/tabs/terminal/LogsTerminal.vue (2)
35-48: EnsureautoCols: truedoesn’t override server-provided width when availableThe
serverProvidesSizeflag plus conditional logic inupdate()makes sense, but withautoCols: truethere’s a risk thatuseAutoSizemay still auto-resize the terminal based on container width even when the server is explicitly providingsize.cols, which would defeat the goal of preserving progress bar rendering.If
useAutoSizecurrently sets up aResizeObserver(or similar) wheneverautoCols: trueis passed, consider either:
- Providing a way to toggle auto-cols off once
serverProvidesSizebecomestrue, or- Keeping
autoCols: falsefor the server-size path and only enabling/using auto-cols when you’ve determined the server does not provide a size.If
autoColsonly affects howresize()computes sizes and does not schedule automatic resizing, it would be good to document that in a comment so future readers don’t assume auto-resize is still active in the server-size case.
51-62: Refine one-time size detection and avoid unnecessaryresize()callsTwo small points around the sizing logic in
update():
You lock in
serverProvidesSizebased solely on the first call. IfgetRawLogs()happens to return nosizebut subsequent WebSocket messages do include a validsize.cols, you’ll permanently treat this session as “no server size” and ignore later size information. If the backend contract doesn’t guaranteesizeon the first response, consider switching to an “ever seen size” approach (e.g. trackserverSizeColsand set it whensize?.cols > 0appears, rather than treating the firstundefinedas a permanentfalse).When
serverProvidesSizeisfalse,resize()is invoked on every update. Ifresize()is at all expensive (DOM reads/writes, font metrics, etc.), you might want to call it only when the sizing mode switches (or rely onuseAutoSize’s own observers) instead of per log message; a simple guard like a separateautoSizedOnceflag or throttling/debouncing could keep behaviour the same while avoiding unnecessary work.These are mostly behavioural/maintainability nits, but worth confirming against the backend’s actual
sizeemission patterns andresize()’s cost.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/bottomPanel/tabs/terminal/LogsTerminal.vue(1 hunks)
🧰 Additional context used
📓 Path-based instructions (15)
**/*.vue
📄 CodeRabbit inference engine (.cursorrules)
**/*.vue: Use setup() function for component logic in Vue 3 Composition API
Utilize ref and reactive for reactive state in Vue 3
Implement computed properties with computed() function
Use watch and watchEffect for side effects in Vue 3
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection in Vue 3
Use Vue 3.5 style of default prop declaration with defineProps()
Organize Vue components in <script> <style> order
Use Tailwind CSS for styling Vue components
Implement responsive design with Tailwind CSS
Do not use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage). Use replacements: Select, Popover, DatePicker, ToggleSwitch, Drawer, AutoComplete, Tabs, Stepper, Message respectively
Implement proper props and emits definitions in Vue components
Utilize Vue 3's Teleport component when needed
Use Suspense for async components in Vue 3
Follow Vue 3 style guide and naming conventions
Never use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage)Never use
:class="[]"to merge class names - always useimport { cn } from '@/utils/tailwindUtil'for class merging in Vue templates
**/*.vue: Use TypeScript with Vue 3 Single File Components (.vuefiles)
Name Vue components in PascalCase (e.g.,MenuHamburger.vue)Files:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vue**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.jsonFiles:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vue**/*.{ts,tsx,js,vue}
📄 CodeRabbit inference engine (.cursorrules)
Implement proper error handling in components and services
**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in.prettierrc
Organize imports by sorting and grouping by plugin, and runpnpm formatbefore committingFiles:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vuesrc/**/*.vue
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.vue: Use the Vue 3 Composition API instead of the Options API when writing Vue components (exception: when overriding or extending PrimeVue components for compatibility)
Use setup() function for component logic
Utilize ref and reactive for reactive state
Implement computed properties with computed()
Use watch and watchEffect for side effects
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection
Use vue 3.5 style of default prop declaration
Use Tailwind CSS for styling
Implement proper props and emits definitions
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Follow Vue 3 style guide and naming conventionsFiles:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vuesrc/**/*.{vue,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.jsonFiles:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vue**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit inference engine (CLAUDE.md)
Use camelCase for variable and setting names in TypeScript/Vue files
Files:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vue**/*.{vue,html}
📄 CodeRabbit inference engine (CLAUDE.md)
Never use
dark:ordark-theme:Tailwind variants - instead use semantic values fromstyle.csstheme, e.g.bg-node-component-surfaceFiles:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vue**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,vue}: Useconst settingStore = useSettingStore()andsettingStore.get('Comfy.SomeSetting')to retrieve settings in TypeScript/Vue files
Useawait settingStore.set('Comfy.SomeSetting', newValue)to update settings in TypeScript/Vue files
Check server capabilities usingapi.serverSupportsFeature('feature_name')before using enhanced features
Useapi.getServerFeature('config_name', defaultValue)to retrieve server feature configurationEnforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates
Files:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vuesrc/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebaseFiles:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vuesrc/**/{composables,components}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Clean up subscriptions in state management to prevent memory leaks
Files:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vuesrc/**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Follow Vue 3 composition API style guide
Files:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vuesrc/**/{components,composables}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Use vue-i18n for ALL user-facing strings by adding them to
src/locales/en/main.jsonFiles:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vuesrc/components/**/*.vue
📄 CodeRabbit inference engine (src/components/CLAUDE.md)
src/components/**/*.vue: Use setup() function in Vue 3 Composition API
Destructure props using Vue 3.5 style in Vue components
Use ref/reactive for state management in Vue 3 Composition API
Implement computed() for derived state in Vue 3 Composition API
Use provide/inject for dependency injection in Vue components
Prefer emit/@event-name for state changes over other communication patterns
Use defineExpose only for imperative operations (such as form.validate(), modal.open())
Replace PrimeVue Dropdown component with Select
Replace PrimeVue OverlayPanel component with Popover
Replace PrimeVue Calendar component with DatePicker
Replace PrimeVue InputSwitch component with ToggleSwitch
Replace PrimeVue Sidebar component with Drawer
Replace PrimeVue Chips component with AutoComplete with multiple enabled
Replace PrimeVue TabMenu component with Tabs without panels
Replace PrimeVue Steps component with Stepper without panels
Replace PrimeVue InlineMessage component with Message
Extract complex conditionals to computed properties
Implement cleanup for async operations in Vue components
Use lifecycle hooks: onMounted, onUpdated in Vue 3 Composition API
Use Teleport/Suspense when needed for component rendering
Define proper props and emits definitions in Vue componentsFiles:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vuesrc/components/**/*.{vue,css}
📄 CodeRabbit inference engine (src/components/CLAUDE.md)
src/components/**/*.{vue,css}: Use Tailwind CSS only for styling (no custom CSS)
Use the correct tokens from style.css in the design system packageFiles:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vuesrc/components/**/*.{vue,ts,js}
📄 CodeRabbit inference engine (src/components/CLAUDE.md)
src/components/**/*.{vue,ts,js}: Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners
Use useIntersectionObserver for visibility detection instead of custom scroll handlers
Use vue-i18n for ALL UI stringsFiles:
src/components/bottomPanel/tabs/terminal/LogsTerminal.vue⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: deploy-and-comment
- GitHub Check: lint-and-format
- GitHub Check: test
- GitHub Check: collect
- GitHub Check: setup
| if (serverProvidesSize === null) { | ||
| serverProvidesSize = size?.cols != null && size.cols > 0 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional:
- Nullish coalescing assign
!= nullisn't more expressive than a truthiness check, right?
| if (serverProvidesSize === null) { | |
| serverProvidesSize = size?.cols != null && size.cols > 0 | |
| } | |
| serverProvidesSize ??= size?.cols && size.cols > 0 |
Question: Would the server ever end a negative number?
| } | ||
| // Use server size if provided, otherwise auto sizing handles it | ||
| if (serverProvidesSize && size?.cols) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if the server starts sending the columns after the first response, we ignore it?
DrJKL
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a question about the logic around serverProvidesSize, but this is probably better than the baseline and if the response order sizing becomes an issue we can address it then.
Also a small style based suggestion.
|
Oh, check out the rabbit comments too. |
846db5e to
c1d95bc
Compare
|
After investigating the backend code, the original design doesn't make practical sense:
The correct approach is simply autoCols: true with minCols: 80 - let the frontend determine its own width based on the container, while maintaining the minimum width for edge cases. The server-provided size serves no practical purpose in the web frontend context. |
## Summary set autoCols = true by default for Logs Terminal ## Changes Previously, the logs terminal had autoCols: false to preserve server-side progress bar rendering, However, this caused large black empty areas when the server terminal was narrower than the UI panel, Many server environments don't provide terminal size at all, making this tradeoff not worthwhile. The original implementation set autoCols: false because the server renders progress bars based on its own terminal width. If the frontend used a different column count, progress bars would display incorrectly (e.g., wrapped or truncated). However, this created a poor user experience: 1. The terminal only filled a portion of the panel width (often 80 columns) 2. The remaining space appeared as a large black empty area 3. Many backend environments don't provide size data at all, making the fixed-width approach pointless fix #7117 ## Screenshots (if applicable) before https://github.com/user-attachments/assets/e38af410-9cf1-4175-8acc-39d11a5b73ce after https://github.com/user-attachments/assets/3d180318-609f-44c5-aac5-230f9e4ef596 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7132-fix-should-allow-autoCols-true-when-server-doesn-t-provide-size-2be6d73d365081e7bf3bf5988bdba39a) by [Unito](https://www.unito.io)
…n't provide size (#7249) Backport of #7132 to `core/1.33` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7249-backport-core-1-33-fix-should-allow-autoCols-true-when-server-doesn-t-provide-size-2c36d73d365081679b89fdf5ea4083d2) by [Unito](https://www.unito.io) Co-authored-by: Terry Jia <terryjia88@gmail.com>
Summary
set autoCols = true by default for Logs Terminal
Changes
Previously, the logs terminal had autoCols: false to preserve server-side progress bar rendering, However, this caused large black empty areas when the server terminal was narrower than the UI panel, Many server environments don't provide terminal size at all, making this tradeoff not worthwhile.
The original implementation set autoCols: false because the server renders progress bars based on its own terminal width. If the frontend used a different column count, progress bars would display incorrectly (e.g., wrapped or truncated).
However, this created a poor user experience:
fix #7117
Screenshots (if applicable)
before
https://github.com/user-attachments/assets/e38af410-9cf1-4175-8acc-39d11a5b73ce
after
https://github.com/user-attachments/assets/3d180318-609f-44c5-aac5-230f9e4ef596
┆Issue is synchronized with this Notion page by Unito