Skip to content

Conversation

@simandebvu
Copy link
Owner

This commit adds a quick format selector in the workspace and resolves critical Prompt API initialization issues.

Features Added:

  • FormatQuickSelector component for in-workspace format selection
  • Quick preset buttons (Study Guide, Quick Reference, etc.)
  • Individual format toggles with validation
  • Real-time format preference persistence to localStorage
  • Integrated into WorkspacePage output panel

Prompt API Fixes:

  • Fixed "expectedOutputs" iterator error by removing unsupported property
  • Added automatic polling (2s interval) to detect model download completion
  • Fixed button disabled state to auto-enable when model becomes ready
  • Added MODEL_NOT_READY error code to PromptErrorCode type
  • Improved error logging for session creation failures
  • Added check to prevent session creation when model is downloading

Components Modified:

  • src/components/workspace/FormatQuickSelector.tsx (new)
  • src/pages/workspace/WorkspacePage.tsx
  • src/hooks/useFormatTransform.ts (new)
  • src/components/input/TextInputPanel.tsx
  • src/lib/chrome-ai/services/PromptService.ts
  • src/lib/chrome-ai/prompt.ts
  • src/lib/chrome-ai/types.ts

UX Improvements:

  • Users can now change formats without navigating to Preferences
  • Process text button automatically enables when model is ready
  • Clearer error messages for API initialization failures
  • Better handling of model download states

Resolves issues with:

  • Process text button staying disabled after model download
  • LanguageModel.create() failing with iterator errors
  • No feedback during model download state changes

🤖 Generated with Claude Code

This commit adds a quick format selector in the workspace and resolves
critical Prompt API initialization issues.

Features Added:
- FormatQuickSelector component for in-workspace format selection
- Quick preset buttons (Study Guide, Quick Reference, etc.)
- Individual format toggles with validation
- Real-time format preference persistence to localStorage
- Integrated into WorkspacePage output panel

Prompt API Fixes:
- Fixed "expectedOutputs" iterator error by removing unsupported property
- Added automatic polling (2s interval) to detect model download completion
- Fixed button disabled state to auto-enable when model becomes ready
- Added MODEL_NOT_READY error code to PromptErrorCode type
- Improved error logging for session creation failures
- Added check to prevent session creation when model is downloading

Components Modified:
- src/components/workspace/FormatQuickSelector.tsx (new)
- src/pages/workspace/WorkspacePage.tsx
- src/hooks/useFormatTransform.ts (new)
- src/components/input/TextInputPanel.tsx
- src/lib/chrome-ai/services/PromptService.ts
- src/lib/chrome-ai/prompt.ts
- src/lib/chrome-ai/types.ts

UX Improvements:
- Users can now change formats without navigating to Preferences
- Process text button automatically enables when model is ready
- Clearer error messages for API initialization failures
- Better handling of model download states

Resolves issues with:
- Process text button staying disabled after model download
- LanguageModel.create() failing with iterator errors
- No feedback during model download state changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@simandebvu simandebvu self-assigned this Oct 20, 2025
@simandebvu simandebvu linked an issue Oct 20, 2025 that may be closed by this pull request
7 tasks
…-fixes

Resolved merge conflicts by integrating both feature branches:
- Merged format transformation features (multi-format support, streaming)
- Merged comparison view feature (side-by-side text comparison)
- Updated TextInputPanel callback to include originalText parameter
- Integrated ComparisonView alongside FormattedOutput
- Updated WorkspacePage to support both output modes

Conflicts resolved:
- src/components/input/TextInputPanel.tsx: Merged callback signatures
- src/pages/workspace/WorkspacePage.tsx: Combined format selector and comparison view

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@simandebvu
Copy link
Owner Author

@claude review this PR

- Removed unused handleCopyFormat function
- Removed onCopy props from FormattedOutput components (callback is optional)
- Copy functionality is already handled within FormatSection component

Fixes ESLint errors:
- '_format' is defined but never used
- '_content' is defined but never used

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@simandebvu simandebvu merged commit 665a99a into main Oct 22, 2025
1 of 2 checks passed
@simandebvu simandebvu deleted the feat/12-workspace-format-selector-and-prompt-fixes branch October 22, 2025 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Content Restructuring Engine

3 participants