Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(onboarding): mobile view fixes (#3386)

dev-rbae440c2f49ad
diff --git a/js/app/packages/app/component/onboarding/onboarding.tsx b/js/app/packages/app/component/onboarding/onboarding.tsx
index 1b55807fc4..dbcf673815 100644
--- a/js/app/packages/app/component/onboarding/onboarding.tsx
+++ b/js/app/packages/app/component/onboarding/onboarding.tsx
@@ -208,7 +208,7 @@ function OnboardingInner() {
});
return (
- <div class="flex items-center justify-center size-full relative overflow-y-auto py-8">
+ <div class="flex items-center mobile:items-stretch justify-center size-full relative overflow-y-auto py-8">
<style>
{`
input:-webkit-autofill,
@@ -244,23 +244,46 @@ function OnboardingInner() {
)}
>
<Show when={ctx.step() > 0}>
- <div class="w-full flex items-center gap-3 mb-10">
- <LogoProgress
- level={activeStepPosition()}
- total={activeStepCount()}
- class="w-7"
- />
- <Show when={activeStepCount() > 1}>
- <span class="text-xs font-mono text-ink-disabled">
- {activeStepPosition()}/{activeStepCount()}
- </span>
- </Show>
+ <div class="w-full flex items-center gap-3 mobile:justify-between mb-10">
+ <div
+ class={cn(
+ 'hidden mobile:block',
+ showBack() ? 'visible' : 'invisible'
+ )}
+ >
+ <button
+ type="button"
+ tabIndex={0}
+ onClick={() => ctx.back()}
+ class="flex items-center gap-1 text-xs text-ink-disabled hover:text-ink transition-colors outline-none rounded-sm focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
+ >
+ <ArrowLeftIcon class="size-3" />
+ Back
+ </button>
+ </div>
+ <div class="flex items-center gap-3">
+ <LogoProgress
+ level={activeStepPosition()}
+ total={activeStepCount()}
+ class="w-7"
+ />
+ <Show when={activeStepCount() > 1}>
+ <span class="text-sm font-mono font-semibold text-ink mobile:text-xs mobile:font-normal mobile:text-ink-disabled">
+ {activeStepPosition()}/{activeStepCount()}
+ </span>
+ </Show>
+ </div>
</div>
</Show>
- <div class="w-full flex flex-col gap-2">
+ <div class="w-full flex flex-col gap-2 mobile:flex-1 mobile:min-h-0">
<Show when={ctx.step() > 0}>
- <div class={showBack() ? 'visible' : 'invisible'}>
+ <div
+ class={cn(
+ 'mobile:hidden',
+ showBack() ? 'visible' : 'invisible'
+ )}
+ >
<button
type="button"
tabIndex={0}
@@ -277,7 +300,7 @@ function OnboardingInner() {
transition={Stepper.transitions.slideFull}
appear
class={cn(
- 'overflow-clip p-1 -m-1',
+ 'overflow-clip p-1 -m-1 mobile:flex-1 mobile:min-h-0',
ctx.step() > 0 && 'min-h-125'
)}
>
diff --git a/js/app/packages/app/component/onboarding/steps/intro-step.tsx b/js/app/packages/app/component/onboarding/steps/intro-step.tsx
index 06c71c566a..df741a78ca 100644
--- a/js/app/packages/app/component/onboarding/steps/intro-step.tsx
+++ b/js/app/packages/app/component/onboarding/steps/intro-step.tsx
@@ -6,6 +6,7 @@ import { AnimatedFileMdIcon } from '@icon/wide-fileMd';
import { AnimatedStarIcon } from '@icon/wide-star';
import { AnimatedTaskIcon } from '@icon/wide-task';
import ArrowRightIcon from '@phosphor/arrow-right.svg';
+import { A } from '@solidjs/router';
import { Button, cn } from '@ui';
import { For } from 'solid-js';
import { useOnboarding } from '../onboarding-context';
@@ -71,11 +72,11 @@ export function IntroStep() {
const ctx = useOnboarding();
return (
- <div class="flex flex-col items-center text-center gap-10 w-full">
+ <div class="flex flex-col items-center text-center gap-10 w-full mobile:h-full">
<div class="flex flex-col items-center gap-5">
<LogoIcon class="size-12 text-accent" />
<div class="flex flex-col gap-2">
- <h1 class="text-4xl font-semibold text-ink tracking-tight">
+ <h1 class="text-4xl mobile:text-2xl font-semibold text-ink tracking-tight">
Welcome to Macro
</h1>
<p class="text-sm text-ink-disabled">
@@ -84,19 +85,20 @@ export function IntroStep() {
</div>
</div>
- <div class="grid grid-cols-3 gap-3 w-full">
+ <div class="grid grid-cols-3 gap-3 w-full mobile:grid-cols-1 mobile:gap-4 mobile:flex-1 mobile:min-h-0 mobile:overflow-y-auto mobile:scrollbar-hidden">
<For each={BLOCKS}>
{(item) => (
<div
class={cn(
'group flex-1 flex flex-col gap-2.5 p-4 rounded-sm border border-edge-muted text-left transition-colors',
+ 'mobile:flex-row mobile:items-center mobile:gap-3 mobile:p-0 mobile:border-0 mobile:rounded-none',
item.hoverBg,
item.hoverBorder
)}
>
<div
class={cn(
- 'size-8 rounded-sm bg-hover flex items-center justify-center transition-colors',
+ 'size-8 rounded-sm bg-ink/5 flex items-center justify-center transition-colors shrink-0',
item.hoverIconBg
)}
>
@@ -113,15 +115,26 @@ export function IntroStep() {
</For>
</div>
- <Button
- variant="base"
- size="lg"
- onClick={() => ctx.next()}
- class="px-8 bg-accent text-surface border-accent not-disabled:hover:bg-accent/90 not-disabled:hover:text-surface focus-visible:bg-accent focus-visible:text-surface focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
- >
- Get started
- <ArrowRightIcon class="size-4" />
- </Button>
+ <div class="flex flex-col items-center gap-3 mobile:mt-auto mobile:w-full">
+ <Button
+ variant="base"
+ size="lg"
+ onClick={() => ctx.next()}
+ class="px-8 mobile:w-full bg-accent text-surface border-accent not-disabled:hover:bg-accent/90 not-disabled:hover:text-surface focus-visible:bg-accent focus-visible:text-surface focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
+ >
+ Get started
+ <ArrowRightIcon class="size-4" />
+ </Button>
+ <p class="text-sm text-ink-disabled">
+ Already have an account?{' '}
+ <A
+ href="/login"
+ class="text-accent hover:text-accent/80 font-medium outline-none rounded-sm focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
+ >
+ Sign in
+ </A>
+ </p>
+ </div>
</div>
);
}
diff --git a/js/app/packages/app/component/onboarding/steps/payment-step.tsx b/js/app/packages/app/component/onboarding/steps/payment-step.tsx
index 95c9961119..c9568fa252 100644
--- a/js/app/packages/app/component/onboarding/steps/payment-step.tsx
+++ b/js/app/packages/app/component/onboarding/steps/payment-step.tsx
@@ -100,7 +100,7 @@ function CheckoutView() {
};
return (
- <div class="flex flex-col gap-8 w-full">
+ <div class="flex flex-col gap-8 w-full mobile:h-full">
<div class="flex flex-col gap-1">
<h1 class="text-2xl font-semibold text-ink tracking-tight">
Review your plan
@@ -158,7 +158,7 @@ function CheckoutView() {
</div>
</div>
- <div class="flex flex-col gap-3">
+ <div class="flex flex-col gap-3 mobile:mt-auto">
<Button
variant="base"
size="lg"
@@ -201,7 +201,7 @@ function AlreadyPaidView() {
};
return (
- <div class="flex flex-col gap-8 w-full">
+ <div class="flex flex-col gap-8 w-full mobile:h-full">
<div class="flex flex-col gap-1">
<h1 class="text-2xl font-semibold text-ink tracking-tight">
You're all set
@@ -212,7 +212,7 @@ function AlreadyPaidView() {
</p>
</div>
- <div class="flex flex-col gap-2">
+ <div class="flex flex-col gap-2 mobile:mt-auto">
<Button
variant="base"
size="lg"
diff --git a/js/app/packages/app/component/onboarding/steps/profile-step.tsx b/js/app/packages/app/component/onboarding/steps/profile-step.tsx
index 80efb14fbb..2e09dcfa7c 100644
--- a/js/app/packages/app/component/onboarding/steps/profile-step.tsx
+++ b/js/app/packages/app/component/onboarding/steps/profile-step.tsx
@@ -128,7 +128,7 @@ export function ProfileStep() {
);
return (
- <div class="flex flex-col gap-8 w-full">
+ <div class="flex flex-col gap-8 w-full mobile:h-full">
<div class="flex flex-col gap-1">
<h1 class="text-2xl font-semibold text-ink tracking-tight">
{isAuthenticated() ? 'Your workspace' : 'Create your workspace'}
@@ -235,14 +235,14 @@ export function ProfileStep() {
variant="base"
size="lg"
onClick={handleContinueAuthed}
- class="w-full bg-accent text-surface border-accent not-disabled:hover:bg-accent/90 not-disabled:hover:text-surface focus-visible:bg-accent focus-visible:text-surface focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
+ class="w-full mobile:mt-auto bg-accent text-surface border-accent not-disabled:hover:bg-accent/90 not-disabled:hover:text-surface focus-visible:bg-accent focus-visible:text-surface focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
>
Continue
<ArrowRightIcon class="size-4" />
</Button>
}
>
- <div class="flex flex-col gap-3">
+ <div class="flex flex-col gap-3 mobile:mt-auto">
<Button
variant="base"
size="lg"
diff --git a/js/app/packages/app/component/onboarding/steps/team-step.tsx b/js/app/packages/app/component/onboarding/steps/team-step.tsx
index 759cf66e35..44397a33e3 100644
--- a/js/app/packages/app/component/onboarding/steps/team-step.tsx
+++ b/js/app/packages/app/component/onboarding/steps/team-step.tsx
@@ -114,7 +114,7 @@ export function TeamStep() {
};
return (
- <div class="flex flex-col gap-8 w-full">
+ <div class="flex flex-col gap-8 w-full mobile:h-full">
<div class="flex flex-col gap-1">
<h1 class="text-2xl font-semibold text-ink tracking-tight">
Invite your team
@@ -126,46 +126,48 @@ export function TeamStep() {
</p>
</div>
- <div class="flex flex-col gap-2">
- <Index each={entries()}>
- {(entry, index) => (
- <div class="flex flex-col gap-1">
- <div class="relative">
- <input
- id={`onb-invite-${index}`}
- type="email"
- value={entry().email}
- onInput={(e) => updateEmail(index, e.currentTarget.value)}
- onBlur={(e) => validateOnBlur(index, e.currentTarget.value)}
- placeholder={emailPlaceholder()}
- class={cn(
- 'w-full px-2.5 h-9 pr-9 text-sm rounded-sm border bg-transparent text-ink placeholder:text-ink-placeholder transition-colors',
- 'outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-surface',
- errors()[index] ? 'border-failure' : 'border-edge-muted'
- )}
- />
- <Show when={entry().email.trim() !== ''}>
- <Button
- variant="ghost"
- size="icon-sm"
- onClick={() =>
- entries().length > 1
- ? removeEntry(index)
- : updateEmail(index, '')
- }
- class="absolute right-1.5 top-1/2 -translate-y-1/2 text-ink-disabled not-disabled:hover:text-ink-muted"
- noTouchResize
- >
- <XIcon class="size-3.5" />
- </Button>
+ <div class="flex flex-col gap-2 mobile:min-h-0">
+ <div class="flex flex-col gap-2 p-1 -m-1 mobile:min-h-0 mobile:overflow-y-auto mobile:scrollbar-hidden">
+ <Index each={entries()}>
+ {(entry, index) => (
+ <div class="flex flex-col gap-1">
+ <div class="relative">
+ <input
+ id={`onb-invite-${index}`}
+ type="email"
+ value={entry().email}
+ onInput={(e) => updateEmail(index, e.currentTarget.value)}
+ onBlur={(e) => validateOnBlur(index, e.currentTarget.value)}
+ placeholder={emailPlaceholder()}
+ class={cn(
+ 'w-full px-2.5 h-9 pr-9 text-sm rounded-sm border bg-transparent text-ink placeholder:text-ink-placeholder transition-colors',
+ 'outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-surface',
+ errors()[index] ? 'border-failure' : 'border-edge-muted'
+ )}
+ />
+ <Show when={entry().email.trim() !== ''}>
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ onClick={() =>
+ entries().length > 1
+ ? removeEntry(index)
+ : updateEmail(index, '')
+ }
+ class="absolute right-1.5 top-1/2 -translate-y-1/2 text-ink-disabled not-disabled:hover:text-ink-muted"
+ noTouchResize
+ >
+ <XIcon class="size-3.5" />
+ </Button>
+ </Show>
+ </div>
+ <Show when={errors()[index]}>
+ <p class="text-xs text-failure">{errors()[index]}</p>
</Show>
</div>
- <Show when={errors()[index]}>
- <p class="text-xs text-failure">{errors()[index]}</p>
- </Show>
- </div>
- )}
- </Index>
+ )}
+ </Index>
+ </div>
<Show
when={hasValidEmail()}
@@ -185,15 +187,15 @@ export function TeamStep() {
variant="ghost"
size="sm"
onClick={addEntry}
- class="self-start"
+ class="w-full justify-center [&_svg]:size-3"
>
- <PlusIcon class="size-4" />
+ <PlusIcon />
Add another
</Button>
</Show>
</div>
- <div class="flex flex-col gap-2">
+ <div class="flex flex-col gap-2 mobile:mt-auto">
<Show
when={isLargeTeam()}
fallback={
diff --git a/js/app/packages/app/component/onboarding/steps/verify-step.tsx b/js/app/packages/app/component/onboarding/steps/verify-step.tsx
index 54a1533eda..97f3734552 100644
--- a/js/app/packages/app/component/onboarding/steps/verify-step.tsx
+++ b/js/app/packages/app/component/onboarding/steps/verify-step.tsx
@@ -152,7 +152,7 @@ export function VerifyStep() {
);
return (
- <div class="flex flex-col gap-8 w-full">
+ <div class="flex flex-col gap-8 w-full mobile:h-full">
<div class="flex flex-col gap-1">
<h1 class="text-2xl font-semibold text-ink tracking-tight">
Verify your email
@@ -193,25 +193,25 @@ export function VerifyStep() {
Verifying...
</div>
</Show>
+ </div>
- <div class="flex items-center justify-center">
- <button
- type="button"
- tabIndex={0}
- onClick={sendCode}
- disabled={!canResend()}
- class={cn(
- 'text-xs transition-colors outline-none rounded-sm focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface',
- canResend()
- ? 'text-accent hover:text-accent/80'
- : 'text-ink-disabled'
- )}
- >
- <Show when={resendTimer() > 0} fallback="Resend code">
- Resend in {resendTimer()}s
- </Show>
- </button>
- </div>
+ <div class="flex items-center justify-center mobile:mt-auto">
+ <button
+ type="button"
+ tabIndex={0}
+ onClick={sendCode}
+ disabled={!canResend()}
+ class={cn(
+ 'text-xs transition-colors outline-none rounded-sm focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface',
+ canResend()
+ ? 'text-accent hover:text-accent/80'
+ : 'text-ink-disabled'
+ )}
+ >
+ <Show when={resendTimer() > 0} fallback="Resend code">
+ Resend in {resendTimer()}s
+ </Show>
+ </button>
</div>
</div>
);