diff --git a/README.md b/README.md index 1f5c7b08..2ffcb69d 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,9 @@ This section documents the external interface of the software, including where i - Required Outlook permission level for header retrieval: ReadWriteMailbox. - The app consumes Outlook mailbox APIs and does not expose a separate public REST API. +- The standalone About dialog and Outlook add-in diagnostics identify the build and source commit. +- Build metadata is available as JSON at `/Pages/build-info.json`. +- Local builds display `Local` and identify the Git commit on which the working tree is based. ## Installation Procedure @@ -112,7 +115,7 @@ For both IOS and Android click open an email, then press the three dots under th ### Add-in testing (VSCode) -- Follow the steps given [here](https://learn.microsoft.com/en-us/office/dev/add-ins/testing/debug-desktop-using-edge-chromium#use-the-visual-studio-code-debugger). +- Follow the steps for [using the Visual Studio Code debugger](https://learn.microsoft.com/en-us/office/dev/add-ins/testing/debug-desktop-using-edge-chromium#use-the-visual-studio-code-debugger). ### Add-in testing (Outlook Web App) diff --git a/eslint.config.js b/eslint.config.js index 9c15b413..06c2f8c7 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -47,8 +47,7 @@ export default [{ Office: "readonly", // Webpack defined globals (replaced at build time) __AIKEY__: "readonly", - __BUILDTIME__: "readonly", - __VERSION__: "readonly", + mhaBuildInfo: "readonly", // Node.js/TypeScript globals used in specific contexts process: "readonly", global: "readonly", diff --git a/index.d.ts b/index.d.ts index 5e0778d6..c7251c0b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,3 +1,9 @@ declare module "*.png"; declare module "*.jpg"; declare module "*.css"; + +declare const mhaBuildInfo: Readonly<{ + buildNumber: string; + commit: string; + builtAt: string; +}>; diff --git a/jest.config.ts b/jest.config.ts index e5cfafe9..0b123c21 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -7,7 +7,13 @@ const config: Config = { "^.+.tsx?$": ["ts-jest",{ diagnostics: { ignoreCodes: ["TS151001"] } }], }, globals: { - "__AIKEY__": "" + // Stand-ins for webpack DefinePlugin constants so code runs under Jest. + "__AIKEY__": "", + "mhaBuildInfo": { + buildNumber: "local", + commit: "0".repeat(40), + builtAt: "1970-01-01T00:00:00.000Z" + } }, collectCoverage: true, collectCoverageFrom: ["./src/**"], diff --git a/src/Content/classicDesktopFrame.css b/src/Content/classicDesktopFrame.css index 0bc04ae4..235709f3 100644 --- a/src/Content/classicDesktopFrame.css +++ b/src/Content/classicDesktopFrame.css @@ -322,10 +322,77 @@ button[aria-expanded="false"] .collapsibleSwitch::after { box-sizing: border-box; } -#feedbackLink { +#aboutLink { float: right; } +#aboutButton { + padding: 0; + border: 0; + background: transparent; + color: var(--primary-blue); + font: inherit; + text-decoration: underline; + cursor: pointer; +} + +#aboutDialog { + --dialog-width: min(360px, calc(100vw - 32px)); + overflow-x: hidden; +} + +#aboutDialog::part(control), +#aboutDialog::part(positioning-region), +#aboutDialog::part(overlay), +#aboutDialog::part(dialog) { + overflow-x: hidden; +} + +#aboutDialog[hidden] { + display: none; +} + +#aboutDialog .dialog-header, +#aboutDialog .dialog-content, +#aboutDialog .dialog-actions { + overflow-x: hidden; +} + +#aboutDialog .dialog-content { + padding: 16px 20px; +} + +#aboutDialog dl { + display: grid; + grid-template-columns: max-content minmax(0, 1fr); + gap: 8px 16px; + margin: 0 0 16px; + min-width: 0; +} + +#aboutDialog dt { + font-weight: 600; +} + +#aboutDialog dd { + min-width: 0; + margin: 0; + overflow-wrap: anywhere; + word-break: break-word; +} + +#aboutDialog p { + margin: 8px 0 0; + overflow-wrap: anywhere; +} + +#aboutDialog .dialog-actions { + display: flex; + justify-content: flex-end; + padding: 12px 20px 16px; + border-top: 1px solid var(--border-gray); +} + .commandBar { height: 44px; background-color: #f4f4f4; diff --git a/src/Pages/mha.html b/src/Pages/mha.html index f6693b5d..5b343c60 100644 --- a/src/Pages/mha.html +++ b/src/Pages/mha.html @@ -35,8 +35,8 @@

Input Headers

-