fix(client): handle joining a deleted channel gracefully#471
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the client-side UX around deleted channels by adding a “delete channel” action and by attempting to block joining channels that are no longer valid, showing a dedicated “Channel Deleted” view instead of a generic join failure.
Changes:
- Extend the chat context API with
deleteChannel()and wire it into the provider. - Add a pre-join “channel status” check and surface a “Channel Deleted” UI in the setup overlay.
- Add a delete (trash) icon + header button to let users delete the current channel.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| client/src/types/index.ts | Adds deleteChannel() to the shared chat context type. |
| client/src/context/ChatContext.tsx | Adds status check before joining and implements deleteChannel() that calls the service delete API. |
| client/src/components/SetupOverlay/SetupOverlay.tsx | Adds a deleted view state and specialized UI when join fails due to deletion. |
| client/src/components/common/icons.tsx | Introduces TrashIcon for the new delete button. |
| client/src/components/ChatContainer/ChatHeader.tsx | Adds a “Delete Chat” header action that calls deleteChannel(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+60
to
+62
| // Check for channel status before joining | ||
| const baseUrl = process.env.CHATE2EE_API_URL || 'http://localhost:3001'; | ||
| const statusRes = await fetch(`${baseUrl}/chatHash/status/${hash}`); |
Comment on lines
+63
to
+67
| if (statusRes.status === 404) { | ||
| throw new Error('CHANNEL_DELETED'); | ||
| } | ||
| if (!statusRes.ok) { | ||
| throw new Error('Failed to verify channel status'); |
Comment on lines
+91
to
+96
| <Button | ||
| className="btn--icon" | ||
| variant="danger" | ||
| onClick={handleDelete} | ||
| title="Delete Chat" | ||
| > |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
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.



Closes #404