Promote Chats to top-level Configuration menu entry#1274
Draft
GonzoSpire wants to merge 5 commits into
Draft
Conversation
Chats was buried as the 5th tab inside Configuration/Settings, even though Users and Access keys already have their own top-level entries in the Configuration dropdown. Move the page to /Notifications (NotificationsController.Index) and link to it from the Configuration dropdown right after Users — keeping Settings/API below the divider. NotificationsController already had ChatsManager wired; the new Index view just renders the existing Configuration/_Chats.cshtml partial, so the table layout, row actions, and Add-new-chat link are unchanged. Configuration/Settings loses its Chats tab and the now-unused Chats property + IChatsManager ctor param on ConfigurationViewModel. Folders/EditFolder keeps its own folder-scoped Chats tab (different partial at Views/Folders/_Chats.cshtml) untouched. Closes #1273 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…iew cycle 1) The Index view rendered its own <h5>Notification chats</h5>, but Configuration/_Chats.cshtml:13 already opens with the same heading (it was a sub-heading back when the partial lived inside a Settings tab). On the dedicated /Notifications page the heading would show twice. Drop the view-level wrapper + heading and let the partial own its own header, matching how it rendered inside Configuration/Settings. Also drop @using HSMServer.Constants and HSMServer.Controllers — the view doesn't reference them directly (the partial brings its own usings for ViewConstants and NotificationsController). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…e 2)
The XSS test opened the Configuration dropdown with getByRole('link', { name: 'Configuration' }),
but the toggle in _Layout.cshtml:98 is an <a role="button" class="dropdown-toggle">. Explicit ARIA
role wins over the <a> tag default, so getByRole('link') misses it and the test would fail at the
navigation step. Switch to getByRole('button', ...) — the same role the existing openUsersPage
helper in users.ts:4 uses.
Also assert toHaveURL(/.*Notifications/) after the Chats click to catch a redirect miss early
instead of an opaque 'Add new chat' selector failure downstream.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…le 3) After Save on a new Slack chat, the test jumped straight to asserting the chat row was visible. If TryAdd silently fails (or the redirect target ever moves), the row assertion fails with an opaque 'row not found' instead of pointing at the real cause. Mirror the cycle-2 URL check from the XSS test — assert toHaveURL(/.*Notifications/) first, then the row. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.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.
Summary
Chats was the 5th tab inside Configuration/Settings, even though Users and Access keys already have their own top-level entries in the Configuration dropdown. This PR moves Chats to
/Notifications(NotificationsController.Index) and links to it from the Configuration dropdown right after Users, above the divider. Settings (server config) and API (docs) stay below.The new
Indexview renders the existingConfiguration/_Chats.cshtmlpartial — same table layout, row actions, and Add-new-chat link as before.Folders/EditFolderkeeps its own folder-scoped Chats tab (different partial atViews/Folders/_Chats.cshtml) untouched.Changes
NotificationsController.Index— new[HttpGet][AuthorizeIsAdmin]action returningView(new ChatsSettingsViewModel(ChatsManager)).Views/Notifications/Index.cshtml— new wrapper view rendering the partial.Views/Shared/_Layout.cshtml— new Chats<li>in Configuration dropdown after Users, gated byIsChatsPageAllowed.UserRoleHelper.IsChatsPageAllowed— new helper mirroringIsUsersPageAllowed/IsConfigurationPageAllowed(admin-only).Configuration/Index.cshtml— chats-tab button + pane removed.ConfigurationViewModel—Chatsproperty +IChatsManager chatsctor param dropped.ConfigurationController—IChatsManager chatsDI param +usingdropped.NotificationsController.AddChatPOST — redirect target switched fromConfigurationController.Index→nameof(Index).fixtures.tscleanup.chatnow navigates to/Notifications;modify_folder_chat.spec.tstest 2 selector switched from tab to dropdown link; test 1 post-Save tab click removed (redirect lands on the chats list directly).Test plan
dotnet build src/server/HSMServer/HSMServer.csproj— 0 errors (verified locally)./Notifications, chats table renders, Add-new-chat + per-row action dropdown work./Configuration) no longer has a Chats tab./Notificationswith the new chat in the list.npx playwright test modify_folder_chat.spec.ts— both tests green.Closes #1273
🤖 Generated with Claude Code