Skip to content

Commit 6ce571d

Browse files
authored
fix: public viewer full-width layout and implementor logo sizing (#225)
Remove max-width: 1200px constraint from .content so the public viewer renders full-width like the internal viewer. Scale implementor logos proportionally (height: 28px, width: auto) instead of forcing 24x24px. Flip share dialog defaults: show expiration checked, pre-fill notice text.
1 parent e780907 commit 6ce571d

File tree

4 files changed

+26
-15
lines changed

4 files changed

+26
-15
lines changed

pkg/portal/public_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ func TestPublicViewSuccess(t *testing.T) {
5454
assert.Contains(t, body, defaultLogoSVG)
5555
assert.Contains(t, body, `brand-platform`)
5656

57-
// No implementor on left by default
58-
assert.NotContains(t, body, `brand-implementor`)
57+
// No implementor on left by default (CSS has the class name, but no HTML element uses it)
58+
assert.NotContains(t, body, `class="brand brand-implementor"`)
5959

6060
// Dark mode toggle is present
6161
assert.Contains(t, body, `id="theme-toggle"`)

pkg/portal/templates/public_viewer.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@
6969
width: 24px;
7070
height: 24px;
7171
}
72+
.brand-implementor .brand-logo {
73+
width: auto;
74+
height: 28px;
75+
}
76+
.brand-implementor .brand-logo svg {
77+
width: auto;
78+
height: 28px;
79+
}
7280
.brand-name {
7381
font-size: 13px;
7482
font-weight: 500;
@@ -128,10 +136,8 @@
128136
line-height: 1.4;
129137
}
130138
.content {
131-
max-width: 1200px;
132139
width: 100%;
133-
margin: 0 auto;
134-
padding: 24px;
140+
padding: 16px;
135141
flex: 1;
136142
display: flex;
137143
flex-direction: column;

ui/src/components/ShareDialog.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,17 @@ export function ShareDialog({ assetId, open, onOpenChange }: Props) {
3131
const [email, setEmail] = useState("");
3232
const [copied, setCopied] = useState<string | null>(null);
3333
const [showOptions, setShowOptions] = useState(false);
34-
const [hideExpiration, setHideExpiration] = useState(false);
35-
const [noticeText, setNoticeText] = useState("");
34+
const [showExpiration, setShowExpiration] = useState(true);
35+
const [noticeText, setNoticeText] = useState(
36+
"Proprietary & Confidential. Only share with authorized viewers.",
37+
);
3638

3739
function handleCreatePublicLink() {
3840
createShare.mutate({
3941
assetId,
4042
expires_in: ttl,
41-
...(hideExpiration && { hide_expiration: true }),
42-
...(noticeText.trim() && { notice_text: noticeText.trim() }),
43+
...(!showExpiration && { hide_expiration: true }),
44+
notice_text: noticeText.trim(),
4345
});
4446
}
4547

@@ -117,11 +119,11 @@ export function ShareDialog({ assetId, open, onOpenChange }: Props) {
117119
<label className="flex items-center gap-2 text-sm">
118120
<input
119121
type="checkbox"
120-
checked={hideExpiration}
121-
onChange={(e) => setHideExpiration(e.target.checked)}
122+
checked={showExpiration}
123+
onChange={(e) => setShowExpiration(e.target.checked)}
122124
className="rounded border-input"
123125
/>
124-
Hide expiration notice
126+
Show expiration notice
125127
</label>
126128
<div>
127129
<label className="text-sm text-muted-foreground" htmlFor="notice-text">
@@ -130,11 +132,14 @@ export function ShareDialog({ assetId, open, onOpenChange }: Props) {
130132
<input
131133
id="notice-text"
132134
type="text"
133-
placeholder="Custom notice shown on the public page"
135+
placeholder="Leave empty to hide the notice"
134136
value={noticeText}
135137
onChange={(e) => setNoticeText(e.target.value)}
136138
className="mt-1 w-full rounded-md border bg-background px-3 py-1.5 text-sm outline-none ring-ring focus:ring-2"
137139
/>
140+
<p className="mt-1 text-xs text-muted-foreground">
141+
Clear to hide notice bar entirely.
142+
</p>
138143
</div>
139144
</div>
140145
)}

ui/src/mocks/handlers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,8 @@ export const handlers = [
846846
revoked: false,
847847
access_count: 0,
848848
created_at: new Date().toISOString(),
849-
hide_expiration: body.hide_expiration ? true : undefined,
850-
notice_text: body.notice_text ? String(body.notice_text) : undefined,
849+
hide_expiration: body.hide_expiration === true,
850+
notice_text: typeof body.notice_text === "string" ? body.notice_text : undefined,
851851
};
852852

853853
if (!portalShares[assetId]) portalShares[assetId] = [];

0 commit comments

Comments
 (0)