Skip to content

Promote Chats to top-level Configuration menu entry#1274

Draft
GonzoSpire wants to merge 5 commits into
masterfrom
feature/1273-chats-top-menu
Draft

Promote Chats to top-level Configuration menu entry#1274
GonzoSpire wants to merge 5 commits into
masterfrom
feature/1273-chats-top-menu

Conversation

@GonzoSpire

Copy link
Copy Markdown
Collaborator

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 Index view renders the existing Configuration/_Chats.cshtml partial — same table layout, row actions, and Add-new-chat link as before. Folders/EditFolder keeps its own folder-scoped Chats tab (different partial at Views/Folders/_Chats.cshtml) untouched.

Changes

  • NotificationsController.Index — new [HttpGet][AuthorizeIsAdmin] action returning View(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 by IsChatsPageAllowed.
  • UserRoleHelper.IsChatsPageAllowed — new helper mirroring IsUsersPageAllowed / IsConfigurationPageAllowed (admin-only).
  • Configuration/Index.cshtml — chats-tab button + pane removed.
  • ConfigurationViewModelChats property + IChatsManager chats ctor param dropped.
  • ConfigurationControllerIChatsManager chats DI param + using dropped.
  • NotificationsController.AddChat POST — redirect target switched from ConfigurationController.Indexnameof(Index).
  • Playwright: fixtures.ts cleanup.chat now navigates to /Notifications; modify_folder_chat.spec.ts test 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).
  • Login as admin → Configuration dropdown shows: Access keys, Users, Chats, divider, Settings, API.
  • Click Chats → URL is /Notifications, chats table renders, Add-new-chat + per-row action dropdown work.
  • Settings page (/Configuration) no longer has a Chats tab.
  • Add new chat → after Save, lands on /Notifications with the new chat in the list.
  • Folder edit page → Chats tab still renders the folder-scoped picker (unchanged).
  • Non-admin user does not see the Chats menu entry.
  • npx playwright test modify_folder_chat.spec.ts — both tests green.

Closes #1273

🤖 Generated with Claude Code

Siarhei Hanich and others added 5 commits July 17, 2026 18:50
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Promote Chats to top-level Configuration menu entry (after Users)

1 participant