Add device analytics middleware for data-driven responsive navigation decision #545
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.
Implements anonymous device type tracking to determine if mobile hamburger menu implementation justifies the effort based on actual traffic (30% mobile threshold per issue requirements).
Changes
Middleware & Analytics
DeviceAnalyticsMiddleware: Thread-safe UserAgent classification (Mobile/Tablet/Desktop) with in-memory aggregation/DeviceAnalyticspage: Real-time statistics dashboard with decision criteria displayIntegration
UseRequestLocalization()_Layout.cshtmlTesting
CustomWebApplicationFactoryto avoid database collision with parallel test executionPrivacy
Example Usage
Screenshots
Analytics Dashboard

Dashboard displays device breakdown with decision threshold guidance. After ~1 week of data collection, if mobile traffic ≥ 30%, proceed with hamburger menu implementation.
Next Phase (Post-Data Collection)
If mobile ≥ 30%: Implement responsive hamburger menu for ≤375px screens with accessibility focus and pure CSS (no Tailwind dependency as noted in issue).
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
copilot.microsoft.com/opt/microsoft/msedge/msedge --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=5141 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.com.microsoft.Edge.scoped_dir.jyiVCR --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,11189740950603331162,9514024058580901471,262144 --enable-features=msMetricsLogFastStartup,msSendMetricsLogOnClose --disable-features=IgnoreDuplicateNavs,PaintHolding,Prewarm --variations-seed-version --trace-process-track-uuid=3190708989122997041 --enable-logging=stderr --log-level=0(dns block)/opt/microsoft/msedge/msedge --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=5140 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.com.microsoft.Edge.scoped_dir.ZkPRhk --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,8377868810783681332,14933709638949223820,262144 --enable-features=msMetricsLogFastStartup,msSendMetricsLogOnClose --disable-features=IgnoreDuplicateNavs,PaintHolding,Prewarm --variations-seed-version --trace-process-track-uuid=3190708989122997041 --enable-logging=stderr --log-level=0(dns block)/opt/microsoft/msedge/msedge --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=5139 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.com.microsoft.Edge.scoped_dir.MCB7w8 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,18273167410963471777,9640053187149539141,262144 --enable-features=msMetricsLogFastStartup,msSendMetricsLogOnClose --disable-features=IgnoreDuplicateNavs,PaintHolding,Prewarm --variations-seed-version --trace-process-track-uuid=3190708989122997041 --enable-logging=stderr --log-level=0(dns block)edge.microsoft.com/opt/microsoft/msedge/msedge --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=5139 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.com.microsoft.Edge.scoped_dir.MCB7w8 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,18273167410963471777,9640053187149539141,262144 --enable-features=msMetricsLogFastStartup,msSendMetricsLogOnClose --disable-features=IgnoreDuplicateNavs,PaintHolding,Prewarm --variations-seed-version --trace-process-track-uuid=3190708989122997041 --enable-logging=stderr --log-level=0(dns block)/opt/microsoft/msedge/msedge --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=5141 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.com.microsoft.Edge.scoped_dir.jyiVCR --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,11189740950603331162,9514024058580901471,262144 --enable-features=msMetricsLogFastStartup,msSendMetricsLogOnClose --disable-features=IgnoreDuplicateNavs,PaintHolding,Prewarm --variations-seed-version --trace-process-track-uuid=3190708989122997041 --enable-logging=stderr --log-level=0(dns block)/opt/microsoft/msedge/msedge --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=5140 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.com.microsoft.Edge.scoped_dir.ZkPRhk --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,8377868810783681332,14933709638949223820,262144 --enable-features=msMetricsLogFastStartup,msSendMetricsLogOnClose --disable-features=IgnoreDuplicateNavs,PaintHolding,Prewarm --variations-seed-version --trace-process-track-uuid=3190708989122997041 --enable-logging=stderr --log-level=0(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.