Skip to content

fix: Build errors#13

Merged
devohmycode merged 1 commit intomasterfrom
0.6.3
Mar 5, 2026
Merged

fix: Build errors#13
devohmycode merged 1 commit intomasterfrom
0.6.3

Conversation

@devohmycode
Copy link
Copy Markdown
Owner

@devohmycode devohmycode commented Mar 5, 2026

Summary by CodeRabbit

  • Refactor

    • Improved type safety and code organization across editor components for better maintainability.
    • Enhanced feed synchronization API to provide more comprehensive data during sync operations.
  • Chores

    • Internal code cleanup and dependency optimization.

@devohmycode devohmycode merged commit fd0726c into master Mar 5, 2026
1 check was pending
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 5, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 041976e1-94bd-42dc-9737-3906519387eb

📥 Commits

Reviewing files that changed from the base of the PR and between 5cbf0d6 and 3da3da3.

📒 Files selected for processing (9)
  • src/components/MarkdownCodeEditor.tsx
  • src/components/MarkdownFileTree.tsx
  • src/components/MarkdownSearchPanel.tsx
  • src/components/SourcePanel.tsx
  • src/components/SuperClipboard.tsx
  • src/components/SuperMarkdown.tsx
  • src/components/SuperTranslate.tsx
  • src/components/markdown-editor/live-preview.ts
  • src/hooks/useFeedStore.ts

📝 Walkthrough

Walkthrough

This PR performs code maintenance across multiple components, removing unused imports (React hooks and icons), renaming unused parameters with underscore prefixes to indicate internal-only usage, initializing timeout refs with explicit null values, refactoring constructor patterns in TypeScript classes, and updating the syncFeed return type to communicate richer success data including feed and new items or null.

Changes

Cohort / File(s) Summary
Unused import and parameter cleanup
src/components/MarkdownCodeEditor.tsx, src/components/MarkdownSearchPanel.tsx, src/components/SuperClipboard.tsx, src/components/SuperMarkdown.tsx
Removed unused imports (useCallback, X icon) and renamed unused destructured parameters with underscore prefix (filePath → _filePath, searchQuery → _searchQuery) to suppress linting warnings.
Timeout ref initialization
src/components/MarkdownSearchPanel.tsx, src/components/SuperTranslate.tsx
Changed debounceRef and saveTimeoutRef initialization from implicit undefined to explicit null to align with nullable ReturnType types.
Type and signature updates
src/components/MarkdownFileTree.tsx, src/components/markdown-editor/live-preview.ts, src/hooks/useFeedStore.ts
Narrowed FileTreeItem type with Omit<Props, 'entries'>, refactored ImageWidget constructor to use explicit field declarations, and expanded syncFeed return type to communicate feed and newItems data or null.
Property renaming in SourcePanel
src/components/SourcePanel.tsx
Renamed clipboard-related prop destructuring with underscore prefixes (_clipEntries, _selectedClipId, _onSelectClip, _onPasteClip, _onDeleteClip, _onTogglePinClip) to indicate internal-only usage.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Underscores mark the paths untrod,
Imports pruned with careful mod,
Null replaces undefined's fog,
Types now clear as morning's clog.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 0.6.3

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Fix TypeScript build errors and type inconsistencies

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Fixed TypeScript constructor property syntax in ImageWidget class
• Updated syncFeed return type to include feed and new items data
• Removed unused imports and function parameters across components
• Fixed uninitialized ref types by explicitly setting null defaults
Diagram
flowchart LR
  A["TypeScript Issues"] --> B["Constructor Syntax"]
  A --> C["Type Annotations"]
  A --> D["Unused Code"]
  B --> E["ImageWidget class"]
  C --> F["Ref initializations"]
  C --> G["Function return types"]
  D --> H["Unused imports/params"]
Loading

Grey Divider

File Changes

1. src/components/markdown-editor/live-preview.ts 🐞 Bug fix +3/-1

Fix ImageWidget constructor property syntax

src/components/markdown-editor/live-preview.ts


2. src/hooks/useFeedStore.ts 🐞 Bug fix +1/-1

Update syncFeed return type signature

src/hooks/useFeedStore.ts


3. src/components/MarkdownCodeEditor.tsx 🐞 Bug fix +3/-16

Remove unused imports and fix ref types

src/components/MarkdownCodeEditor.tsx


View more (6)
4. src/components/MarkdownFileTree.tsx 🐞 Bug fix +1/-1

Fix FileTreeItem type definition

src/components/MarkdownFileTree.tsx


5. src/components/MarkdownSearchPanel.tsx 🐞 Bug fix +2/-2

Remove unused import and fix ref type

src/components/MarkdownSearchPanel.tsx


6. src/components/SourcePanel.tsx 🐞 Bug fix +6/-6

Mark unused clipboard parameters with underscore

src/components/SourcePanel.tsx


7. src/components/SuperClipboard.tsx 🐞 Bug fix +0/-1

Remove unused import statement

src/components/SuperClipboard.tsx


8. src/components/SuperMarkdown.tsx 🐞 Bug fix +1/-1

Mark unused searchQuery parameter with underscore

src/components/SuperMarkdown.tsx


9. src/components/SuperTranslate.tsx 🐞 Bug fix +1/-1

Fix debounceRef initialization with null

src/components/SuperTranslate.tsx


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review bot commented Mar 5, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Search debounce ref error 🐞 Bug ✓ Correctness
Description
MarkdownSearchPanel initializes debounceRef with null but types it as non-null
ReturnType<typeof setTimeout>, which is incompatible with strict TypeScript settings and will
fail the build.
Code

src/components/MarkdownSearchPanel.tsx[20]

+  const debounceRef = useRef<ReturnType<typeof setTimeout>>(null);
Evidence
With strict: true, null cannot be assigned to ReturnType<typeof setTimeout>. This component
uses the same incorrect pattern as the editor timeout ref, while the codebase demonstrates the
correct union approach in NoteEditor.

src/components/MarkdownSearchPanel.tsx[11-21]
tsconfig.app.json[25-31]
src/components/NoteEditor.tsx[21-22]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`debounceRef` is declared as a non-null timeout type but initialized with `null`, which is a compile error under `strictNullChecks`.

### Issue Context
`tsconfig.app.json` sets `strict: true`. The codebase already uses `ReturnType&lt;typeof setTimeout&gt; | null` for debounce refs.

### Fix Focus Areas
- src/components/MarkdownSearchPanel.tsx[18-21]
- tsconfig.app.json[25-31]
- src/components/NoteEditor.tsx[18-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

const [selectedIndex, setSelectedIndex] = useState(-1);
const inputRef = useRef<HTMLInputElement>(null);
const debounceRef = useRef<ReturnType<typeof setTimeout>>();
const debounceRef = useRef<ReturnType<typeof setTimeout>>(null);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Search debounce ref error 🐞 Bug ✓ Correctness

MarkdownSearchPanel initializes debounceRef with null but types it as non-null
ReturnType<typeof setTimeout>, which is incompatible with strict TypeScript settings and will
fail the build.
Agent Prompt
### Issue description
`debounceRef` is declared as a non-null timeout type but initialized with `null`, which is a compile error under `strictNullChecks`.

### Issue Context
`tsconfig.app.json` sets `strict: true`. The codebase already uses `ReturnType<typeof setTimeout> | null` for debounce refs.

### Fix Focus Areas
- src/components/MarkdownSearchPanel.tsx[18-21]
- tsconfig.app.json[25-31]
- src/components/NoteEditor.tsx[18-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

1 participant