fix: build issue with latest main merge#49
Conversation
WalkthroughReplaced a UI geometry reference with a new Geometry import in PromptEditDialog, updating the max content size call. Added an explicit import for Geometry and adjusted the method invocation accordingly. Minor formatting change adding a trailing newline. No exported/public API signatures were altered. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude finished @tysonthomas9's task —— View job PR Review: Build Issue FixI've completed a thorough review of this build fix. The changes are minimal and address a specific import/namespace issue. Review Checklist
Changes SummaryThe PR fixes a build issue in
✅ Code Quality & Best Practices
✅ No Bugs or Issues Found
✅ Performance Considerations
✅ Security Concerns
✅ Test Coverage Assessment
Recommendations
Overall AssessmentThis is a high-quality, targeted fix that addresses the build issue without introducing any risks. The changes are minimal, follow established patterns, and maintain all existing functionality. The PR is ready for merge. |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
front_end/panels/ai_chat/ui/PromptEditDialog.ts (3)
5-7: Fix import order to satisfy ESLint (import/order).Place the geometry import before the legacy UI import to clear the linter error.
import * as i18n from '../../../core/i18n/i18n.js'; -import * as UI from '../../../ui/legacy/legacy.js'; -import * as Geometry from '../../../models/geometry/geometry.js'; +import * as Geometry from '../../../models/geometry/geometry.js'; +import * as UI from '../../../ui/legacy/legacy.js';
101-103: Geometry.Size usage looks right; consider handling viewport resize (or rely on CSS only).Right now the max size is computed once; resizing the window can desync dialog constraints vs. CSS 90vw/90vh. Either drop setMaxContentSize and rely on CSS, or recompute on resize and clean up.
- dialog.setMaxContentSize(new Geometry.Size(window.innerWidth * 0.9, window.innerHeight * 0.9)); + const updateMaxSize = (): void => { + dialog.setMaxContentSize(new Geometry.Size(window.innerWidth * 0.9, window.innerHeight * 0.9)); + }; + updateMaxSize(); + window.addEventListener('resize', updateMaxSize); + this.cleanupFunctions.push(() => window.removeEventListener('resize', updateMaxSize));
63-78: Localize the remaining status/error strings for consistency.A few user‑visible strings bypass i18n; wire them through UIStrings like the others.
defaultPromptIndicator: 'Using default prompt', + /** + *@description Error message when saving a prompt fails + */ + promptSaveError: 'Failed to save prompt', + /** + *@description Error message when restoring a prompt fails + */ + promptRestoreError: 'Failed to restore prompt', + /** + *@description Error message when the prompt is empty + */ + promptEmptyError: 'Prompt cannot be empty', } as const; @@ } catch (error) { logger.error('Failed to restore prompt:', error); - showStatus('Failed to restore prompt', 'error'); + showStatus(i18nString(UIStrings.promptRestoreError), 'error'); if (options.onError) { options.onError(error as Error); } } @@ if (!newPrompt) { - showStatus('Prompt cannot be empty', 'error'); + showStatus(i18nString(UIStrings.promptEmptyError), 'error'); return; } @@ } catch (error) { logger.error('Failed to save prompt:', error); - showStatus('Failed to save prompt', 'error'); + showStatus(i18nString(UIStrings.promptSaveError), 'error'); if (options.onError) { options.onError(error as Error); } }Also applies to: 438-441, 466-467, 509-512
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
front_end/panels/ai_chat/ui/PromptEditDialog.ts(3 hunks)
🧰 Additional context used
🪛 ESLint
front_end/panels/ai_chat/ui/PromptEditDialog.ts
[error] 7-7: ../../../models/geometry/geometry.js import should occur before import of ../../../ui/legacy/legacy.js
(import/order)
fix: build issue with latest main merge (#49)
Summary by CodeRabbit