File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { StoryTitleBar } from "@/components/authoring/StoryTitleBar";
66import { MinervaLibraryPage } from "@/components/library/MinervaLibraryPage" ;
77import { PlaybackRouter } from "@/components/playback/PlaybackRouter" ;
88import { StoryReturnToLibraryBridge } from "@/components/StoryReturnToLibraryBridge" ;
9+ import { BuildStamp } from "@/components/shared/BuildStamp" ;
910import { FileHandler } from "@/components/shared/FileHandler" ;
1011import type { LoadedSourceSummary , ValidObj } from "@/components/shared/Upload" ;
1112import { Upload } from "@/components/shared/Upload" ;
@@ -1651,18 +1652,24 @@ const Main = (props: Props) => {
16511652
16521653 if ( props . demo_dicom_web || props . demo_url || hasAuthorShellSupport ( ) ) {
16531654 return (
1654- < StoryPersistenceRoot >
1655- < LibraryOrAuthor { ...props } />
1656- </ StoryPersistenceRoot >
1655+ < >
1656+ < StoryPersistenceRoot >
1657+ < LibraryOrAuthor { ...props } />
1658+ </ StoryPersistenceRoot >
1659+ < BuildStamp />
1660+ </ >
16571661 ) ;
16581662 } else {
16591663 return (
1660- < div >
1661- < p >
1662- Minerva needs a secure context (HTTPS or localhost). Serve this app
1663- over HTTPS and reload.
1664- </ p >
1665- </ div >
1664+ < >
1665+ < div >
1666+ < p >
1667+ Minerva needs a secure context (HTTPS or localhost). Serve this app
1668+ over HTTPS and reload.
1669+ </ p >
1670+ </ div >
1671+ < BuildStamp />
1672+ </ >
16661673 ) ;
16671674 }
16681675} ;
Original file line number Diff line number Diff line change 1+ import styled from "styled-components" ;
2+
3+ const Stamp = styled . div `
4+ position: fixed;
5+ right: max(10px, env(safe-area-inset-right));
6+ bottom: max(8px, env(safe-area-inset-bottom));
7+ z-index: 99999;
8+ pointer-events: none;
9+ font-size: 10px;
10+ line-height: 1.25;
11+ font-weight: 400;
12+ letter-spacing: 0.015em;
13+ opacity: 0.28;
14+ color: rgba(238, 238, 238, 0.85);
15+ ` ;
16+
17+ function utcShort ( iso : string ) : string | null {
18+ const t = Date . parse ( iso ) ;
19+ if ( Number . isNaN ( t ) ) return null ;
20+ return new Date ( t ) . toISOString ( ) . replace ( "T" , " " ) . slice ( 0 , 16 ) ;
21+ }
22+
23+ /** Unobtrusive UTC build time so deployed previews are easy to tell apart from `main`/production. */
24+ const BuildStamp = ( ) => {
25+ const label = utcShort (
26+ typeof __BUILD_TIME_ISO__ === "string" ? __BUILD_TIME_ISO__ : "" ,
27+ ) ;
28+ if ( ! label ) return null ;
29+ return (
30+ < Stamp aria-hidden title = { __BUILD_TIME_ISO__ } >
31+ Updated { label } UTC
32+ </ Stamp >
33+ ) ;
34+ } ;
35+
36+ export { BuildStamp } ;
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ declare module "deck.gl" {
99import "wicg-file-system-access" ;
1010declare var showOpenFilePicker : ShowOpenFilePicker ;
1111declare global {
12+ /** Set in `vite.config.js` via `define` on each bundle (dev restart / `vite build`). */
13+ const __BUILD_TIME_ISO__ : string ;
1214 namespace Handle {
1315 type File = FileSystemFileHandle ;
1416 type Dir = FileSystemDirectoryHandle ;
Original file line number Diff line number Diff line change @@ -6,7 +6,14 @@ import { standardCssModules } from "vite-plugin-standard-css-modules";
66import { viteStaticCopy } from "vite-plugin-static-copy" ;
77import svgr from "vite-plugin-svgr" ;
88
9+ /** ISO UTC time baked into each bundle; override in CI with `VITE_APP_BUILD_TIME` (ISO-8601). */
10+ const BUILD_TIME_ISO =
11+ process . env . VITE_APP_BUILD_TIME ?? new Date ( ) . toISOString ( ) ;
12+
913export default defineConfig ( {
14+ define : {
15+ __BUILD_TIME_ISO__ : JSON . stringify ( BUILD_TIME_ISO ) ,
16+ } ,
1017 assetsInclude : [ "**/*.wasm" ] ,
1118 worker : {
1219 format : "es" ,
You can’t perform that action at this time.
0 commit comments