oficina / slides Public

Make the projector a full-screen stage

Paul Campbell pushed by paul@keymail.dev 2cc431693ee8b7c9f1eb7e22b37c3b6260fe8890 parent ac57041
2 files changed, +20 −0
  • internal/slides/templates/present.html +14 −0
  • internal/slidestest/present_test.go +6 −0

CI failed — run details

diff --git a/internal/slides/templates/present.html b/internal/slides/templates/present.html
index b6499fd..2323771 100644
--- a/internal/slides/templates/present.html
+++ b/internal/slides/templates/present.html
@@ -21,9 +21,22 @@
/* The stage fills what it is given and keeps the slide's aspect;
everything else on this page is one line of chrome under it. */
[slides-surface] {
+ box-sizing: border-box;
display: flex;
flex-direction: column;
gap: var(--rst-sp-3);
+ min-block-size: 100dvh;
+ padding: var(--rst-sp-3);
+ }
+ /* The projector is its own full-screen stage, not a document inside
+ the ordinary constrained rst-page wrapper. Its capability is what
+ makes it safe to omit the app bar and account menu. */
+ [slides-present-stage] {
+ box-sizing: border-box;
+ inline-size: 100%;
+ max-inline-size: none;
+ min-block-size: 100dvh;
+ padding: 0;
}
[slides-stage] {
margin: 0;
@@ -58,6 +71,7 @@
margin: 0;
}
</style>{{end}}
+{{define "main"}}<main id="main" slides-present-stage>{{template "content" .}}</main>{{end}}
{{define "content"}}
{{/* The two URLs the script reads come DOWN rather than being built up
there: which capability this surface reads under is the handler's
diff --git a/internal/slidestest/present_test.go b/internal/slidestest/present_test.go
index fd69a71..121fb0b 100644
--- a/internal/slidestest/present_test.go
+++ b/internal/slidestest/present_test.go
@@ -144,6 +144,12 @@ func TestPresentCreatesSessionWithCodeAndRemoteUrl(t *testing.T) {
// The fullscreen surface is the sqid's own capability: anybody who
// has the address can watch, with no token and no session.
surface := mustGet(t, a, "/p/"+session, http.StatusOK, nil).Body.String()
+ if !strings.Contains(surface, `<main id="main" slides-present-stage>`) || strings.Contains(surface, `<main rst-page id="main">`) {
+ t.Errorf("the projector is not a full-screen stage outside the ordinary page wrapper:\n%s", surface)
+ }
+ if strings.Contains(surface, "<header estilo-bar") || strings.Contains(surface, "estilo-account") {
+ t.Errorf("the projector surface carries app chrome:\n%s", surface)
+ }
if !strings.Contains(surface, "<section slides-slide") {
t.Errorf("the fullscreen surface renders no slide:\n%s", surface)
}