Skip to content

Add error state UI feedback to NotebookPicker component #47

@coderabbitai

Description

@coderabbitai

Description

The NotebookPicker component in src/components/NotebookPicker.tsx currently logs initialization errors to the console but provides no visual feedback to users when panel.context.ready rejects. This leaves users with an empty dropdown and no explanation of what went wrong.

Proposed Solution

Add error state handling with visual feedback:

  1. Add an error state property (e.g., this.error: string | null) to the component
  2. Set the error state inside the catch block: this.error = error?.message || String(error); this.update()
  3. Update the render() method to display a user-friendly error message when this.error is non-null
  4. Optionally disable or hide the dropdown when in error state

Context

This issue was identified during PR review but determined to be out of scope for the lint rule fixes in that PR.

Related PR: #46
Discussion: #46 (comment)
Requested by: @jamesbhobbs

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions