Skip to content

[Bug Fix] Fix /docs/dropdown_menu 404 (#428)#429

Merged
djalmaaraujo merged 2 commits into
mainfrom
fix/dropdown-menu-docs-404
Jun 16, 2026
Merged

[Bug Fix] Fix /docs/dropdown_menu 404 (#428)#429
djalmaaraujo merged 2 commits into
mainfrom
fix/dropdown-menu-docs-404

Conversation

@djalmaaraujo

@djalmaaraujo djalmaaraujo commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #428/docs/dropdown_menu returned a 404.

Root cause

Two stacked problems:

  1. Broken docs example. The "Non-navigational item" example added in [Feature] Allow DropdownMenuItem to render as a div via as: #427 referenced a DialogClose component that does not exist in the gem. VisualCodeExample evaluates the snippet at render time (instance_eval), so it raised NoMethodError: undefined method 'DialogClose' and the page failed to render.
  2. Error masking. config.exceptions_app was a lambda that always rendered the not_found action, so the resulting 500 surfaced as a 404 page — hiding the real error and making the issue look like a missing route.

Changes

  • docs/app/views/docs/dropdown_menu.rb — close the dialog with the documented pattern (Button wired to click->ruby-ui--dialog#dismiss, the same approach used in dialog_docs.rb) instead of the nonexistent DialogClose.
  • docs/config/application.rb — point exceptions_app at the router. The /404 and /500 routes already exist, so the response status now matches the actual error and ErrorsController#internal_server_error becomes reachable. This un-masks future 500s.

Verification

  • Live (docker): /docs/dropdown_menu200, renders clean. Exercised the example in-browser — dropdown opens, "Delete" item opens the Dialog, the Delete button dismisses it.
  • bin/rails test → 70 runs, 0 failures. standardrb clean.

Note on search (⌘K)

Investigated the reported search issue too: production search works (verified in-browser — click opens the command dialog and focuses the input). The local breakage was a stale, gitignored asset build predating the command-dialog controller; rebuilding assets fixes it. No code change needed, so nothing for it here.


Summary by cubic

Fixes the /docs/dropdown_menu 404 by correcting the docs example and routing exceptions through the Rails router so real 500s aren’t masked as 404s.

  • Bug Fixes
    • Replaced nonexistent DialogClose in the “Non‑navigational item” example with a Button wired to click->ruby-ui--dialog#dismiss.
    • Set config.exceptions_app = routes so /404 and /500 handle errors and status codes reflect the actual failure.

Written for commit 6b79055. Summary will update on new commits.

Review in cubic

The 'Non-navigational item' example (added in #427) referenced a
DialogClose component that does not exist in the gem. VisualCodeExample
evaluates the snippet at render time, so it raised NoMethodError and the
whole /docs/dropdown_menu page failed to render.

Close the dialog with the documented pattern instead: a Button wired to
click->ruby-ui--dialog#dismiss (same approach used in dialog_docs.rb).

Fixes #428
…d as 404

config.exceptions_app pointed at a lambda that always rendered the
not_found action, so every unhandled error (including 500s such as a
raising view) surfaced as a 404. That masked the DropdownMenu render
error behind a misleading 'not found' page.

Point exceptions_app at the router instead; the /404 and /500 routes
already exist, so the response status now matches the actual error and
ErrorsController#internal_server_error is finally reachable.
@djalmaaraujo djalmaaraujo requested a review from cirdes as a code owner June 16, 2026 15:50

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

@djalmaaraujo djalmaaraujo merged commit a896333 into main Jun 16, 2026
8 checks passed
@djalmaaraujo djalmaaraujo deleted the fix/dropdown-menu-docs-404 branch June 16, 2026 16:17
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.

Documentation for dropdown menu is not working

1 participant