Files
Sharepoint-Toolbox/.planning/phases/07-user-access-audit/07-05-SUMMARY.md
Dev c42140db1a docs(07-05): complete UserAccessAuditView plan
- 07-05-SUMMARY.md: view with people picker, summary banner, color-coded DataGrid
- STATE.md: progress updated to 85% (11/13), decisions recorded, session updated
- ROADMAP.md: phase 7 in progress with 6/8 summaries complete
2026-04-07 12:50:53 +02:00

6.1 KiB

phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, metrics
phase plan subsystem tags requires provides affects tech-stack key-files key-decisions metrics
07-user-access-audit 05 view
view
xaml
wpf
people-picker
datagrid
color-coding
grouping
filtering
summary-banner
phase provides
07-04
UserAccessAuditViewModel with all observable properties and commands
phase provides
07-01
UserAccessEntry
AccessType enum
UserAccessAuditView XAML + code-behind wired to UserAccessAuditViewModel
07-07
07-08
added patterns
PermissionsView two-panel layout
DataTrigger row color-coding
GroupStyle Expander
code-behind CollectionChanged wiring for autocomplete visibility
created modified
SharepointToolbox/Views/Tabs/UserAccessAuditView.xaml
SharepointToolbox/Views/Tabs/UserAccessAuditView.xaml.cs
Autocomplete ListBox visibility managed from code-behind via SearchResults.CollectionChanged rather than DataTrigger — WPF DataTrigger cannot compare to non-zero Count without a converter
Single ListBox for autocomplete (not Popup) following plan's recommended simpler alternative — avoids Popup placement complexity
Dialog factory wiring deferred to plan 07-07 (MainWindow.xaml.cs) as specified; code-behind is minimal
duration_minutes completed_date tasks_completed files_created files_modified
4 2026-04-07 2 2 0

Phase 7 Plan 05: UserAccessAuditView Summary

XAML view for User Access Audit tab with people-picker autocomplete (ListBox shown via CollectionChanged), removable user pills, site picker, scan options, 3-card summary banner, filter TextBox, group-by ToggleButton, color-coded DataGrid with access type icons, Guest badge for external users, warning icon for high-privilege rows, and GroupStyle Expander headers — zero-error build.

Performance

  • Duration: ~4 min
  • Started: 2026-04-07T10:46:02Z
  • Completed: 2026-04-07T10:49:45Z
  • Tasks: 2
  • Files modified: 2

Accomplishments

  • UserAccessAuditView.xaml (~415 lines) — two-panel layout following PermissionsView pattern with all required UI elements bound to UserAccessAuditViewModel properties
  • Left panel: People picker GroupBox (search TextBox + autocomplete ListBox + removable pill ItemsControl + SelectedUsersLabel), Site GroupBox (site picker button + SitesSelectedLabel), Scan Options GroupBox (3 checkboxes), action buttons (Run/Cancel + CSV/HTML export in 2x2 grid)
  • Right panel: Summary banner (3 stat cards for TotalAccessCount, SitesCount, HighPrivilegeCount with distinct color schemes), filter TextBox + group-by ToggleButton toolbar, DataGrid with ResultsView ICollectionView binding
  • DataGrid row style: DataTriggers for AccessType (Direct=blue #EBF5FB, Group=green #EAFAF1, Inherited=gray #F4F6F6) + FontWeight=Bold for IsHighPrivilege
  • DataGrid columns: User (with orange Guest badge for IsExternalUser), Site, Object, Permission Level (with warning triangle icon for IsHighPrivilege), Access Type (with Segoe UI Symbol icon + colored label), Granted Through
  • GroupStyle with Expander template showing group name + ItemCount
  • Status bar with ProgressBar (0-100) + StatusMessage spanning both columns
  • UserAccessAuditView.xaml.cs — minimal code-behind with DI constructor, CollectionChanged wiring for autocomplete visibility, and OnSearchResultClicked handler

Task Commits

  1. Task 1: Create UserAccessAuditView XAML layout - bb9ba9d (feat)
  2. Task 2: Create UserAccessAuditView code-behind - 975762d (feat)

Files Created/Modified

  • SharepointToolbox/Views/Tabs/UserAccessAuditView.xaml — Full audit tab XAML with two-panel layout, people picker, summary banner, color-coded DataGrid
  • SharepointToolbox/Views/Tabs/UserAccessAuditView.xaml.cs — Code-behind with ViewModel injection, autocomplete visibility wiring, click handler

Decisions Made

  1. Autocomplete ListBox visibility via code-behind — WPF DataTriggers can only match exact values (e.g., True/False), not "Count > 0". Rather than adding a converter or a HasSearchResults bool property to the ViewModel, the code-behind subscribes to SearchResults.CollectionChanged and sets SearchResultsList.Visibility directly. This keeps the ViewModel clean and avoids adding converter infrastructure.

  2. Simple ListBox instead of Popup — The plan listed a Popup as the primary approach and a "simpler alternative" of a ListBox directly below the TextBox. The ListBox approach was chosen to avoid Popup placement issues (the Popup can overlap other controls or escape the panel bounds). The visual result is equivalent.

  3. Dialog factory deferred to 07-07 — As specified in the plan, the SitePickerDialog factory is not wired in the code-behind. It will be set from MainWindow.xaml.cs in plan 07-07, following the same pattern used by PermissionsView.

Deviations from Plan

Auto-fixed Issues

1. [Rule 2 - Missing functionality] Autocomplete visibility from code-behind

  • Found during: Task 2
  • Issue: WPF DataTrigger cannot bind to SearchResults.Count > 0 without a value converter. The initial XAML used a CountToVisibilityConverter reference that did not exist, causing a build error.
  • Fix: Removed converter reference, set initial Visibility="Collapsed" on ListBox, wired SearchResults.CollectionChanged in code-behind to toggle visibility based on Count.
  • Files modified: UserAccessAuditView.xaml, UserAccessAuditView.xaml.cs
  • Commit: Included in 975762d

Issues Encountered

Build error MC2000 on first attempt — CountToVisibilityConverter reference was leftover from an intermediate version of the XAML. Fixed by switching to code-behind wiring.

User Setup Required

None — no external service configuration required.

Next Phase Readiness

  • UserAccessAuditView ready to be registered in DI and added as a tab in MainWindow (plan 07-07)
  • All ViewModel bindings are wired: people picker, site picker, scan options, run/cancel/export, DataGrid with grouping/filtering, summary banner
  • Dialog factory (OpenSitePickerDialog) left as null — to be wired in 07-07 from MainWindow.xaml.cs

Phase: 07-user-access-audit Completed: 2026-04-07