[PR #13] [MERGED] feat: extract channel management to IChannelService and implement CRU… #15

Closed
opened 2026-09-04 00:49:42 +02:00 by Stone_Red · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/RedWizardsLab/EchoHub/pull/13
Author: @HueByte
Created: 2/21/2026
Status: Merged
Merged: 2/21/2026
Merged by: @HueByte

Base: devHead: dev_channel_logic_update


📝 Commits (4)

  • 0d959e3 feat: extract channel management to IChannelService and implement CRUD operations
  • 2cd3bbb chore: remove submodule NuGet config from CI workflows
  • 4930aee chore: update CI workflows to temporarily remove Terminal.Gui submodule's nuget.config to fix restore issues
  • dcb8bbc fix: exclude Terminal.Gui from formatting checks in CI workflow

📊 Changes

16 files changed (+427 additions, -222 deletions)

View changed files

📝 .github/workflows/ci.yml (+10 -5)
📝 .github/workflows/docs.yml (+5 -4)
📝 .github/workflows/release.yml (+12 -12)
📝 docs/changelog/v0.2.5.md (+15 -2)
📝 src/EchoHub.Client/UI/MainWindow.cs (+1 -1)
src/EchoHub.Core/Contracts/IChannelService.cs (+22 -0)
📝 src/EchoHub.Core/Contracts/IChatService.cs (+1 -5)
📝 src/EchoHub.Core/DTOs/CommonDtos.cs (+17 -0)
📝 src/EchoHub.Server.Irc/IrcCommandHandler.cs (+5 -2)
📝 src/EchoHub.Server.Irc/IrcGatewayService.cs (+2 -1)
📝 src/EchoHub.Server/Controllers/ChannelsController.cs (+37 -110)
📝 src/EchoHub.Server/Program.cs (+1 -0)
src/EchoHub.Server/Services/ChannelService.cs (+247 -0)
📝 src/EchoHub.Server/Services/ChatService.cs (+8 -68)
📝 src/EchoHub.Tests/Irc/IrcCommandHandlerTests.cs (+7 -6)
📝 src/EchoHub.Tests/Irc/TestHelpers.cs (+37 -6)

📄 Description

Extract channel logic into dedicated ChannelService + status bar improvements

Changes

  • Extracted channel CRUD, validation, and membership logic from ChannelsController and ChatService into a new IChannelService / ChannelService singleton
  • ChannelsController is now a thin adapter — delegates to IChannelService and maps ChannelError enum to HTTP status codes via MapChannelError()
  • ChatService.JoinChannelAsync delegates channel validation + membership to IChannelService.EnsureChannelMembershipAsync(), keeping only presence tracking + broadcasting + history
  • Added ChannelOperationResult result type with ChannelError enum (ValidationFailed, AlreadyExists, NotFound, Forbidden, Protected) for typed error handling across service boundaries
  • IRC gateway (IrcCommandHandler) now uses IChannelService for topic queries and channel listing instead of IChatService
  • Removed GetChannelTopicAsync, GetChannelListAsync, and ChannelListItem from IChatService (moved to IChannelService)
  • Enhanced status bar: "EchoHub" branding, color-coded connection state (green/red/yellow), channel type indicator (public/private)
  • Changed status bar brand color from blue to golden (218, 165, 32)
  • #general channel auto-recreation if missing, /leave prevention on #general, connect-while-connected guard
  • Added FakeChannelService test helper; updated all IRC handler tests for new dependency

Screenshots / recordings (optional)

How to test

  • dotnet build — all projects (Core, Server, Server.Irc, Client, Tests) compile with 0 errors
  • dotnet test — all 346 tests pass
  • Manual: verify controller endpoints return same responses (thinner code paths, same behavior)
  • Manual: verify status bar renders with golden branding, colored connection state, channel type

Checklist

  • I ran tests locally (or explained why not)
  • I kept changes focused and easy to review
  • I updated docs where needed (README/docs)
  • I verified no secrets/keys are committed
  • If this touches files/uploads/auth, I considered security implications

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/RedWizardsLab/EchoHub/pull/13 **Author:** [@HueByte](https://github.com/HueByte) **Created:** 2/21/2026 **Status:** ✅ Merged **Merged:** 2/21/2026 **Merged by:** [@HueByte](https://github.com/HueByte) **Base:** `dev` ← **Head:** `dev_channel_logic_update` --- ### 📝 Commits (4) - [`0d959e3`](https://github.com/RedWizardsLab/EchoHub/commit/0d959e317e401d490680b38a4518867e6027acb6) feat: extract channel management to IChannelService and implement CRUD operations - [`2cd3bbb`](https://github.com/RedWizardsLab/EchoHub/commit/2cd3bbb570101b87fcba8e93d97184a543f75a02) chore: remove submodule NuGet config from CI workflows - [`4930aee`](https://github.com/RedWizardsLab/EchoHub/commit/4930aee615822a4c31899654f6144b5aad6b6994) chore: update CI workflows to temporarily remove Terminal.Gui submodule's nuget.config to fix restore issues - [`dcb8bbc`](https://github.com/RedWizardsLab/EchoHub/commit/dcb8bbc05fe3db3774dcd919c0dabb6874a60665) fix: exclude Terminal.Gui from formatting checks in CI workflow ### 📊 Changes **16 files changed** (+427 additions, -222 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+10 -5) 📝 `.github/workflows/docs.yml` (+5 -4) 📝 `.github/workflows/release.yml` (+12 -12) 📝 `docs/changelog/v0.2.5.md` (+15 -2) 📝 `src/EchoHub.Client/UI/MainWindow.cs` (+1 -1) ➕ `src/EchoHub.Core/Contracts/IChannelService.cs` (+22 -0) 📝 `src/EchoHub.Core/Contracts/IChatService.cs` (+1 -5) 📝 `src/EchoHub.Core/DTOs/CommonDtos.cs` (+17 -0) 📝 `src/EchoHub.Server.Irc/IrcCommandHandler.cs` (+5 -2) 📝 `src/EchoHub.Server.Irc/IrcGatewayService.cs` (+2 -1) 📝 `src/EchoHub.Server/Controllers/ChannelsController.cs` (+37 -110) 📝 `src/EchoHub.Server/Program.cs` (+1 -0) ➕ `src/EchoHub.Server/Services/ChannelService.cs` (+247 -0) 📝 `src/EchoHub.Server/Services/ChatService.cs` (+8 -68) 📝 `src/EchoHub.Tests/Irc/IrcCommandHandlerTests.cs` (+7 -6) 📝 `src/EchoHub.Tests/Irc/TestHelpers.cs` (+37 -6) </details> ### 📄 Description ## Extract channel logic into dedicated ChannelService + status bar improvements ## Changes - Extracted channel CRUD, validation, and membership logic from `ChannelsController` and `ChatService` into a new `IChannelService` / `ChannelService` singleton - `ChannelsController` is now a thin adapter — delegates to `IChannelService` and maps `ChannelError` enum to HTTP status codes via `MapChannelError()` - `ChatService.JoinChannelAsync` delegates channel validation + membership to `IChannelService.EnsureChannelMembershipAsync()`, keeping only presence tracking + broadcasting + history - Added `ChannelOperationResult` result type with `ChannelError` enum (`ValidationFailed`, `AlreadyExists`, `NotFound`, `Forbidden`, `Protected`) for typed error handling across service boundaries - IRC gateway (`IrcCommandHandler`) now uses `IChannelService` for topic queries and channel listing instead of `IChatService` - Removed `GetChannelTopicAsync`, `GetChannelListAsync`, and `ChannelListItem` from `IChatService` (moved to `IChannelService`) - Enhanced status bar: "EchoHub" branding, color-coded connection state (green/red/yellow), channel type indicator (public/private) - Changed status bar brand color from blue to golden (218, 165, 32) - `#general` channel auto-recreation if missing, `/leave` prevention on `#general`, connect-while-connected guard - Added `FakeChannelService` test helper; updated all IRC handler tests for new dependency ## Screenshots / recordings (optional) <!-- Status bar now shows: EchoHub | v0.2.5 | [colored status] | User: name | #channel - public/private --> ## How to test - [x] `dotnet build` — all projects (Core, Server, Server.Irc, Client, Tests) compile with 0 errors - [x] `dotnet test` — all 346 tests pass - [x] Manual: verify controller endpoints return same responses (thinner code paths, same behavior) - [x] Manual: verify status bar renders with golden branding, colored connection state, channel type ## Checklist - [x] I ran tests locally (or explained why not) - [x] I kept changes focused and easy to review - [x] I updated docs where needed (README/docs) - [x] I verified no secrets/keys are committed - [x] If this touches files/uploads/auth, I considered security implications --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Stone_Red added the pull-request label 2026-09-04 00:49:42 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RedWizardsLab/EchoHub#15