Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(ui): stack the Show Page Access section and fill its audience row (#1620)

Max6db18c846288
diff --git a/ui/src/components/workbench/ShowPageSharingSettings.test.tsx b/ui/src/components/workbench/ShowPageSharingSettings.test.tsx
index 3c27b7817..155c43efe 100644
--- a/ui/src/components/workbench/ShowPageSharingSettings.test.tsx
+++ b/ui/src/components/workbench/ShowPageSharingSettings.test.tsx
@@ -151,6 +151,40 @@ describe('ShowPageSharingSettings', () => {
expect(screen.queryByRole('button', { name: 'Apply' })).toBeNull();
});
+ it('stacks Access as title, select, then status, and lets the audience row fill the panel', async () => {
+ api.getShowAccessSettings.mockResolvedValue({
+ show_access: showAccess({
+ access_mode: 'limited',
+ normalized_emails: ['[email protected]'],
+ }),
+ });
+ getPermissions.mockResolvedValue(ORGANIZATION);
+ renderSettings();
+
+ const trigger = await screen.findByRole('button', { name: 'Access: Limited' });
+ const title = screen.getByText('Access');
+ const status = screen.getByRole('status');
+ // One vertical stack: the title, the mode select, and the autosave status
+ // are siblings in that order -- no label-left/control-right row.
+ const stack = trigger.parentElement;
+ expect(title.parentElement).toBe(stack);
+ expect(status.parentElement).toBe(stack);
+ expect(Array.from(stack?.children ?? [])).toEqual([title, trigger, status]);
+ expect(status.textContent).toContain('Changes save automatically');
+ // The select stays its own fixed width instead of stretching to the panel.
+ expect(trigger.className).toContain('w-40');
+
+ // The audience field, by contrast, adapts to the container: the input takes
+ // the free space and the add button ends the row at its right edge.
+ const input = await audience();
+ const add = screen.getByRole('button', { name: 'Add email' });
+ const row = add.parentElement;
+ expect(input.parentElement?.className).toContain('flex-1');
+ expect(row?.lastElementChild).toBe(add);
+ expect(row?.parentElement?.className).toContain('w-full');
+ expect(row?.parentElement?.className).not.toMatch(/max-w-/);
+ });
+
it('starts an Organization page as Private with no audience field', async () => {
api.getShowAccessSettings.mockResolvedValue({ show_access: showAccess() });
getPermissions.mockResolvedValue(ORGANIZATION);
diff --git a/ui/src/components/workbench/ShowPageSharingSettings.tsx b/ui/src/components/workbench/ShowPageSharingSettings.tsx
index 0f794d2a6..b19ae04bc 100644
--- a/ui/src/components/workbench/ShowPageSharingSettings.tsx
+++ b/ui/src/components/workbench/ShowPageSharingSettings.tsx
@@ -89,8 +89,11 @@ function AccessModeSelect({
<ChevronDown className="size-4 shrink-0 text-muted" />
</button>
</PopoverTrigger>
+ {/* Anchored to the trigger's leading edge: the trigger is left-aligned in
+ the panel, and a 16rem list hung off the right edge of a 10rem trigger
+ would reach past the panel and rely on collision shifting. */}
<PopoverContent
- align="end"
+ align="start"
sideOffset={4}
role="listbox"
aria-label={t('chat.showPage.sharingAccess')}
@@ -220,7 +223,7 @@ function AudienceCombobox({
return (
<div
ref={containerRef}
- className="relative w-full max-w-[17.5rem]"
+ className="relative w-full"
onBlur={(event) => {
if (containerRef.current?.contains(event.relatedTarget as Node | null)) return;
setFocused(false);
@@ -700,29 +703,30 @@ export function ShowPageSharingSettings({
aria-label={t('chat.showPage.sharingAccess')}
className={clsx('space-y-2.5', sharedMode && 'border-t border-border pt-3')}
>
- <div className="flex items-center justify-between gap-3">
- <div className="min-w-0">
- <div className="text-sm font-medium">{t('chat.showPage.sharingAccess')}</div>
- <div className="mt-0.5 flex items-center gap-1 text-[11px] text-muted" role="status">
- {saving ? (
- <>
- <Loader2 className="size-3 animate-spin" />
- {t('common.saving')}
- </>
- ) : (
- <>
- <Check className="size-3 text-mint-ink" />
- {t('chat.showPage.sharingAutoSave')}
- </>
- )}
- </div>
- </div>
+ {/* Title, then control, then status — the same vertical rhythm the
+ Custom link section above uses, so the panel reads as one
+ stack of labelled fields instead of one stack plus one row. */}
+ <div className="space-y-1.5">
+ <div className="text-sm font-medium">{t('chat.showPage.sharingAccess')}</div>
<AccessModeSelect
value={mode}
disabled={!editable}
onChange={changeMode}
ownerWindowId={ownerWindowId}
/>
+ <div className="flex items-center gap-1 text-[11px] text-muted" role="status">
+ {saving ? (
+ <>
+ <Loader2 className="size-3 animate-spin" />
+ {t('common.saving')}
+ </>
+ ) : (
+ <>
+ <Check className="size-3 text-mint-ink" />
+ {t('chat.showPage.sharingAutoSave')}
+ </>
+ )}
+ </div>
</div>
{mode === 'limited' ? (