Skip to content

refactor(docs): improve findTab error messages with available tab names#532

Closed
johnbenjaminlewis wants to merge 1 commit intoopenclaw:mainfrom
johnbenjaminlewis:refactor/findtab-error-messages
Closed

refactor(docs): improve findTab error messages with available tab names#532
johnbenjaminlewis wants to merge 1 commit intoopenclaw:mainfrom
johnbenjaminlewis:refactor/findtab-error-messages

Conversation

@johnbenjaminlewis
Copy link
Copy Markdown
Contributor

@johnbenjaminlewis johnbenjaminlewis commented Apr 27, 2026

refactor(docs): improve findTab error messages with available tab names

Summary

  • findTab now resolves tabs by exact ID first, then by case-insensitive title match, so users can pass either a tab ID or a human-readable name
  • When no match is found, the error now lists available tab titles (e.g. tab not found: "Shopping List" (available: "Inventory", "Markets")) instead of a bare "tab not found" message
  • findTab returns (*docs.Tab, error) instead of *docs.Tab so callers get structured errors
  • Covers both call sites: docs cat --tab and docs structure --tab (via buildParagraphMap)

Test plan

  • Existing TestDocsCat_TabNotFound and TestBuildParagraphMap_TabNotFound exercise the updated error paths
  • No new flags or user-facing behavior changes beyond improved error text

Return an error from findTab instead of nil, listing available tab
titles when no match is found. This gives users actionable feedback
instead of a bare "tab not found" message.

Made-with: Cursor
@johnbenjaminlewis johnbenjaminlewis changed the title 1. refactor(docs): improve findTab error messages with available tab names refactor(docs): improve findTab error messages with available tab names Apr 27, 2026
@steipete
Copy link
Copy Markdown
Collaborator

Landed directly on main as 922ca38 (with changelog entry in ee9b552). Thanks @johnbenjaminlewis.

@steipete
Copy link
Copy Markdown
Collaborator

Closing as landed on main.

@steipete steipete closed this Apr 27, 2026
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.

2 participants