Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,16 @@ struct HomeGallerySection: View {
)

VCard(background: VColor.surfaceBase) {
HomeGreetingHeader(onStartNewChat: {}) {
HomeGreetingHeader(
onStartNewChat: {},
name: "Example Assistant"
) {
if let image = NSImage(systemSymbolName: "person.circle.fill", accessibilityDescription: nil) {
VAvatarImage(image: image, size: 40)
VAvatarImage(image: image, size: 56)
} else {
Circle()
.fill(VColor.surfaceActive)
.frame(width: 40, height: 40)
.frame(width: 56, height: 56)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,30 @@ import VellumAssistantShared

/// Greeting header for the Home feed.
///
/// Displays a caller-provided avatar on the leading edge and a primary
/// "New Chat" pill CTA on the trailing edge. The avatar speaks for itself —
/// the row deliberately carries no headline copy.
/// Displays a caller-provided avatar on the leading edge and an optional
/// display name next to it, with a primary "New Chat" pill CTA on the
/// trailing edge.
///
/// The caller is responsible for sizing the avatar (typical: 40x40pt) and for
/// any outer padding around the header.
/// The caller is responsible for sizing the avatar and for any outer padding
/// around the header.
struct HomeGreetingHeader<Avatar: View>: View {
let onStartNewChat: () -> Void
let name: String?
@ViewBuilder let avatar: () -> Avatar

var body: some View {
HStack(alignment: .center, spacing: VSpacing.md) {
avatar()

if let trimmed = name?.trimmingCharacters(in: .whitespacesAndNewlines),
!trimmed.isEmpty {
Text(trimmed)
.font(VFont.titleLarge)
.foregroundStyle(VColor.contentEmphasized)
}

Spacer()

// `leftIcon` is the VButton API for a leading icon (there is no
// `iconLeft`). `VIcon.squarePen` is the codebase's existing token
// for the "pen-to-square" / new conversation glyph.
VButton(
label: "New Chat",
leftIcon: VIcon.squarePen.rawValue,
Expand Down
13 changes: 7 additions & 6 deletions clients/macos/vellum-assistant/Features/Home/HomePageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ struct HomePageView: View {
// greeting-first appearance.
MeetStatusPanel(viewModel: meetStatusViewModel)

HomeGreetingHeader(onStartNewChat: onStartNewChat) {
// Inline avatar rendering so this view owns its own
// avatar resolution without depending on other views.
HomeGreetingHeader(
onStartNewChat: onStartNewChat,
name: store.state?.assistantName
) {
greetingAvatar
}
.padding(.top, VSpacing.xxl)
Expand Down Expand Up @@ -148,12 +149,12 @@ struct HomePageView: View {
// MARK: - Greeting avatar

/// Inline avatar rendering so this view doesn't depend on another
/// view's internals. 40pt sizing matches the Figma spec for the new
/// greeting row.
/// view's internals. 56pt sizing gives the greeting row visual weight
/// alongside the display-name heading.
@ViewBuilder
private var greetingAvatar: some View {
let appearance = AvatarAppearanceManager.shared
let avatarSize: CGFloat = 40
let avatarSize: CGFloat = 56
if appearance.customAvatarImage != nil {
VAvatarImage(
image: appearance.fullAvatarImage,
Expand Down