// // BookmarksBarView.swift // Zyquo Atlas // // Author: Simon-Pierre Boucher // Mail: contact@spboucher.ai // // The toggleable bookmarks bar under the toolbar: the on-bar favorites as // compact clickable chips. Toggled via the customization panel's "Bookmarks // bar" switch; full organization lives in the bookmarks manager. // import SwiftUI struct BookmarksBarView: View { let onOpen: (String) -> Void @EnvironmentObject private var env: AppEnvironment @EnvironmentObject private var themeEngine: ThemeEngine private var theme: AtlasTheme { themeEngine.theme } var body: some View { ScrollView(.horizontal, showsIndicators: false) { HStack(spacing: ZyquoSpacing.xs) { ForEach(env.bookmarks.barBookmarks) { bm in Button { onOpen(bm.url) } label: { HStack(spacing: ZyquoSpacing.xxs) { Image(systemName: "globe").font(.system(size: 9)) .foregroundStyle(theme.accent) Text(bm.title).font(.system(size: 11, weight: .medium)).lineLimit(1) .foregroundStyle(theme.textSecondary) } .padding(.horizontal, ZyquoSpacing.xs) .frame(height: 22) .contentShape(Rectangle()) } .buttonStyle(.plain) .help(bm.url) } if env.bookmarks.barBookmarks.isEmpty { Text("Bookmark a page (⌘D) to add it here") .font(.system(size: 11)).foregroundStyle(theme.textTertiary) } } .padding(.horizontal, ZyquoSpacing.sm) } .frame(height: 30) .background(theme.surface) .overlay(alignment: .bottom) { Rectangle().fill(theme.border).frame(height: ZyquoMetrics.hairline) } } }