Skip to content

Add MS Footer#160

Merged
danzhu54 merged 13 commits into
mainfrom
footer
Jun 30, 2026
Merged

Add MS Footer#160
danzhu54 merged 13 commits into
mainfrom
footer

Conversation

@Kelvin-Macapagal

Copy link
Copy Markdown
Member

This pull request introduces several significant improvements to the site's layout, accessibility, cookie consent management, and code organization. The most notable updates are the addition of a Microsoft-compliant footer, integration of a cookie consent banner and management, migration of inline JavaScript to a dedicated file, and various CSS refactorings for consistency and maintainability.

Site layout and footer enhancements:

  • Added a Microsoft Universal Header/Footer (UHF) style footer to MainLayout.razor, including legal links, privacy choices, and a "Manage cookies" option that appears conditionally. The layout is wrapped in a new page-shell container to support sticky footer behavior. ([[1]](https://github.com/dotnet/apisof.net/pull/160/files#diff-a75adf43377fd160f139e964bf61af9f9c968ced08800643d935318a4ef97acfR87-R124), [[2]](https://github.com/dotnet/apisof.net/pull/160/files#diff-a75adf43377fd160f139e964bf61af9f9c968ced08800643d935318a4ef97acfR3), [[3]](https://github.com/dotnet/apisof.net/pull/160/files#diff-a75adf43377fd160f139e964bf61af9f9c968ced08800643d935318a4ef97acfL58-R59), [[4]](https://github.com/dotnet/apisof.net/pull/160/files#diff-ca43a2acdcba8c0ea687629dd8a3ea0190f5c61e38a985a7288a025196c18c25R637-R705))

Cookie consent and privacy controls:

  • Integrated Microsoft cookie consent by adding the wcp-consent.js script, a cookie banner element, and supporting logic to show/hide the "Manage cookies" link based on consent requirements. Related functionality is implemented in the new site.js file. ([[1]](https://github.com/dotnet/apisof.net/pull/160/files#diff-7758fe1efe1e812cf4550817459c72f89f8c7a94421d9f916a097134822fe9dcR19-R23), [[2]](https://github.com/dotnet/apisof.net/pull/160/files#diff-c5e1c74b492428d82683256def70df171e2959e5522078d7614f020c78bebb5bR1-R79), [[3]](https://github.com/dotnet/apisof.net/pull/160/files#diff-a75adf43377fd160f139e964bf61af9f9c968ced08800643d935318a4ef97acfR87-R124))

JavaScript organization and accessibility:

  • Moved previously inline JavaScript from _Host.cshtml into site.js, improving maintainability and ensuring accessibility features like "Skip to main content" and popover behaviors remain functional. ([[1]](https://github.com/dotnet/apisof.net/pull/160/files#diff-7758fe1efe1e812cf4550817459c72f89f8c7a94421d9f916a097134822fe9dcL39-R42), [[2]](https://github.com/dotnet/apisof.net/pull/160/files#diff-c5e1c74b492428d82683256def70df171e2959e5522078d7614f020c78bebb5bR1-R79))

Styling and CSS refactoring:

  • Refactored and reformatted site.css for consistency, including improved selector formatting, new classes for the footer, and better support for dark mode and responsive layouts. ([[1]](https://github.com/dotnet/apisof.net/pull/160/files#diff-ca43a2acdcba8c0ea687629dd8a3ea0190f5c61e38a985a7288a025196c18c25L3-R3), [[2]](https://github.com/dotnet/apisof.net/pull/160/files#diff-ca43a2acdcba8c0ea687629dd8a3ea0190f5c61e38a985a7288a025196c18c25L70-R71), [[3]](https://github.com/dotnet/apisof.net/pull/160/files#diff-ca43a2acdcba8c0ea687629dd8a3ea0190f5c61e38a985a7288a025196c18c25R637-R705), and related CSS changes)

Configuration updates:

  • Added development configuration settings for Azure Storage and webhook secrets in appsettings.Development.json. ([src/apisof.net/appsettings.Development.jsonL9-R11](https://github.com/dotnet/apisof.net/pull/160/files#diff-723d71275eca9efca9ee20ca88e68312bfd658fb902e98e026508603f3ece7a0L9-R11))

@danzhu54 danzhu54 changed the title Footer Add MS Footer Jun 25, 2026
Comment thread src/apisof.net/Shared/MainLayout.razor
Comment thread src/apisof.net/wwwroot/js/site.js Outdated
});
}

function createCookiePreferencesControl() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We don't need to create this from scratch, it should use the API provided in the wcpconsent script

Kelvin-Macapagal and others added 6 commits June 27, 2026 06:09
Encapsulate site.js in an IIFE so internal helpers (siteConsent,
setCookieManagementVisibility, initializeCookieConsent,
scrollIntoMainContent, observer) no longer leak onto window and risk
name collisions. openCookiePreferences is still explicitly exported via
window.openCookiePreferences since it is invoked from the footer
"Manage cookies" link. Also adds "use strict".
@danzhu54 danzhu54 merged commit 99a3d58 into main Jun 30, 2026
5 checks passed
@danzhu54 danzhu54 deleted the footer branch June 30, 2026 20:23
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.

2 participants