Skip to content

feat(web): focused moderator view for Inbox-level access - #365

Open
Ferdinand99 wants to merge 8 commits into
v5.3from
feat/53-moderator-view
Open

Ferdinand99 wants to merge 8 commits into
v5.3from
feat/53-moderator-view

Conversation

@Ferdinand99

Copy link
Copy Markdown
Owner

What

Sylo 5.3 item 1. The dashboard adapts to the access level of the signed-in person in the selected server.

  • Inbox level: the server opens on the inbox (tickets) instead of the overview. The sidebar lists only the moderation tools (Tickets, Appeals, Applications, Suggestions, Moderation hub, Member data, Audit log). Module cards, setup pages, Server settings and the "More" links are left out of the sidebar, and the command palette lists only what that sidebar shows (no module pages, no settings).
  • A quiet "Show everything" link in the sidebar footer switches to the full, still locked, navigation (and "Show only moderation" back). The choice is remembered in localStorage (guarded with try/catch).
  • View keeps the full read-only dashboard, Edit is unchanged, operators keep their bot pages.
  • The level comes from the existing GET /api/v2/guilds/:id/access that AccessProvider already reads. No server-side permission change.
  • moderator-view is added to the feature strings of /api/mobile/info and documented in docs/mobile-app.md (and docs/self-hosting.md for the behaviour).

Notes

  • Only Inbox-level people are redirected from the overview; direct links to any page still open (the server guards each route as before).
  • GuildHome waits for the level of the opened server before choosing between overview and inbox, so another server's level never decides.

Tests

  • New web-v2/src/__tests__/moderatorView.test.jsx: Inbox landing and sidebar contents, Show everything (works, persists across a reload, undoes, works without storage), View/Edit full sidebar, other-server level, operator, palette filtering, and the navModel/paletteItems models.
  • test/mobileInfo.test.js checks the new feature string.
  • Lint, npm run test:v2 (852 passed), npm run build:v2 and npm test on SQLite (3892 passed, 0 failed) pass.

An Inbox-level person lands on the inbox and sees only the moderation tools
in the sidebar and the command palette. A quiet "Show everything" link in the
sidebar footer brings back the full, still locked, navigation and is
remembered in the browser. View and Edit keep the full dashboard.

Adds the moderator-view feature string to /api/mobile/info.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

No issues found by static checks — no coupling regressions or blocking issues in the code graph. That is not the same as safe to merge: see what was not checked.

Not checked: tests were not run; no formal proof of the changed code.


Graphify review — findings

Adds a focused dashboard for people with Inbox-level access in a server: the server opens on the inbox, and the sidebar lists only the moderation tools (Tickets, Appeals, Applications, Suggestions, Moderation, Member data, Audit log). A "Show everything" button at the foot of the sidebar restores the full, still locked, navigation and is remembered per browser in localStorage, with a "Show only moderation" button to undo it; View and Edit levels keep the full dashboard, and nothing changes server-side. Routes guilds/:guildId through a new GuildHome page that redirects Inbox users to the tickets page and otherwise renders the existing Overview, and the sidebar nav and command palette follow the same rules. Advertises a new moderator-view feature string from GET /api/mobile/info, so the mobile app can mirror the behaviour from the access field on each guild, and documents it in the mobile-app and self-hosting docs.

No blocking issues surfaced. 4 lower-confidence candidates did not survive cross-model review.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 350 functions depend on the 191 functions this change touches.

Health — this change adds coupling hotspots:

  • worse: Overview() — 7 callers, 18 callees
  • worse: Shell() — 7 callers, 6 callees
  • worse: Sidebar() — 4 callers, 5 callees
  • worse: paletteItems() — 5 callers, 4 callees
  • worse: AccessProvider() — 4 callers, 4 callees
  • worse: PaletteDialog() — 1 callers, 12 callees

Verification — 350 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 343 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

673 of 673 test file(s) selected (100%) via static blast radius.

Escalated to a full run for safety (noncode-change, uncovered-code) — the selection is not trustworthy on its own (see below). CI should run the whole suite.

  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Access/DashboardAccessTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Access/Round3Tests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Account/AccountConnectTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Account/AccountModelTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Account/ConnectCallbackSourceTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Account/NoDashboardLinkSourceTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Appeals/AppealsReviewTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Applications/ApplicationFormsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Applications/ApplicationPassthroughTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Applications/ApplicationSubmissionsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Applications/ApplicationWireTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Audit/AuditHistoryTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Audit/AuditLogTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/CallbackIssuerAddressTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/CallbackIssuerTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/KeychainTokenStoreTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/PKCETests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/SignInRequestTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Auth/TokenStoreTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Changelog/ChangelogTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Commands/CommandOverridesTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/CollectiblePictureTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/EconomyAdminTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/EconomyMembersTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/InventoryTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/ShopExtrasTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/ShopItemsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Economy/ShopModelTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Embeds/EmbedDraftTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Embeds/ModuleLimitsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Events/CommunityReviewFixesTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Events/EventEndpointsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Giveaways/GiveawayActionsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/GuildSettings/CommandPrefixTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/GuildSettings/GuildSettingsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Health/HealthTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Import/P6Tests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Insights/InsightsTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Leaderboard/LeaderboardTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Members/MemberDataTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Members/MemberSearchTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Messages/ComposedMessagesModelTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Messages/ComposedMessagesTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/ModelDecodingTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/ServerListTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/Sylo52PolishTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/UnknownKeysTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Models/Utf16TextLimitTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/Moderation/ModerationTests.swift — full-run-safety
  • apps/sylo-ios/SyloKit/Tests/SyloKitTests/ModuleSettings/AfkSettingsTests.swift — full-run-safety
  • … and 623 more

non-code file(s) changed (docs/mobile-app.md, docs/self-hosting.md, web-v2/src/styles/p1.css) → running the full suite for safety (a code graph can't see config/fixture/data deps)

changed code file(s) with no mapped test (docs/mobile-app.md, docs/self-hosting.md, src/web/routes/mobile.js, web-v2/src/App.jsx, web-v2/src/main.jsx) — a coverage gap or a missing link — running the full suite rather than only the selected tests

Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.

…an open

Inbox access no longer shows Ticket settings and Appeal settings (both pages
are locked for it), the unconfigured-appeals note says to ask a server admin,
and Needs attention on the overview offers no Fix link to a settings page.
The Show everything / Show only moderation switch moves to the top of the
menu, with a line that says which view is on, so the way back is never below
a long list of links.
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.

1 participant