refactor(hub): improve dock diagnostics DF8101/DF8102#31
Open
posva wants to merge 2 commits into
Open
Conversation
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Improves dock-related diagnostics by making DF8101/DF8102 messages more actionable (with contextual parameters), updates docs to match, and adds/updates unit tests to validate the new behavior.
Changes:
- Parameterized DF8101/DF8102 diagnostics messages and added “fix” guidance.
- Updated host-docks to pass context into DF8101.
- Updated docs and tests to reflect the new diagnostic messages and added a DF8102 test.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/hub/src/node/host-docks.ts | Passes dock id context into DF8101 for a more informative error. |
| packages/hub/src/node/diagnostics.ts | Makes DF8101/DF8102 messages parameterized and adds clearer fix text. |
| packages/hub/src/node/tests/host-docks.test.ts | Updates DF8101 assertion and adds a DF8102 test case. |
| docs/errors/DF8102.md | Updates documented DF8102 message to match runtime diagnostics. |
| docs/errors/DF8101.md | Updates documented DF8101 message to include attempted id context. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+22
to
+23
| why: (p: { id: string, attempted: string }) => `Cannot change the id of dock "${p.id}" to "${p.attempted}". Dock ids are immutable once registered`, | ||
| fix: (p: { id: string, attempted: string }) => `Remove \`id\` from the patch to keep updating "${p.id}", or call register() with the full entry to add "${p.attempted}" as a new dock.`, |
| }, | ||
| DF8101: { | ||
| why: 'Cannot change the id of a dock. Use register() to add new docks.', | ||
| why: (p: { id: string, attempted: string }) => `Cannot change the id of dock "${p.id}" to "${p.attempted}". Dock ids are immutable once registered`, |
| }, | ||
| DF8102: { | ||
| why: (p: { id: string }) => `Dock with id "${p.id}" is not registered. Use register() to add new docks.`, | ||
| why: (p: { id: string }) => `Dock with id "${p.id}" is not registered and cannot be updated`, |
| expect(entry.title).toBe('Nuxt DevTools') | ||
|
|
||
| expect(() => handle.update({ id: 'other' })).toThrow('Cannot change the id of a dock') | ||
| expect(() => handle.update({ id: 'other' })).toThrow('Cannot change the id of dock "nuxt" to "other"') |
| title: 'Ghost', | ||
| icon: 'ph:ghost-duotone', | ||
| url: '/__ghost/', | ||
| })).toThrow('Dock with id "ghost" is not registered and cannot be updated') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found this while checking nostics usage 😆