Summary#
Fixes UX issues when adding a project with an invalid path: raw stack traces in error messages and horizontal scrollbar overflow in the sidebar.
What changed#
- Contracts: Added
WsError schema and WS_ERROR_CODES for typed WebSocket error responses
- Server:
buildWsErrorForClient() normalizes errors to { code, message, path? } — users see "Project directory does not exist" instead of stack traces
- Sidebar:
min-w-0, overflow-hidden, break-words on add-project form to prevent horizontal overflow when error text is long
Why#
- Users saw full stack traces when adding non-existent paths
- Long error text caused horizontal scroll in the sidebar
- Structured errors are easier to extend and handle on the client
Before / After#
Before: Raw stack trace in UI, horizontal scrollbar
After: Clean message "Project directory does not exist", text wraps without overflow
Future improvement: A cleaner approach would be to add code and path to RouteRequestError when it is created. The current message based detection is used because Schema.is(RouteRequestError) did not reliably match when extracting the defect from Cause.squash.
Note
Add structured WsError payload with error codes and fix sidebar overflow on project import#
- Introduces
WS_ERROR_CODES and a WsError schema in packages/contracts/src/ws.ts with code, message, and optional path fields, replacing the previous { message: string } shape.
- Adds a
buildWsErrorForClient utility in apps/server/src/wsServer.ts that maps internal Effect/Cause failures to structured errors, including specific codes for known project path errors.
- Fixes horizontal overflow in
apps/web/src/components/Sidebar.tsx by adding min-w-0, overflow-hidden, and break-words to the project path entry container and error message.
- Behavioral Change: WebSocket error responses now require a
code field; clients expecting only { message } will need to handle the new shape.
Macroscope summarized 05cd2f8.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
6a399eac-b002-47f7-ba90-2dc4b9615b1cYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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
Tip
You can get early access to new features in CodeRabbit.
Enable the
early_accesssetting to enable early access features such as new models, tools, and more.