mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
* feat(ui): add design tokens and one shared component set * style(ui): adopt the design system across the Settings window panes * style(ui): adopt the design system in the picker, inputs, capsules, and Linux * docs: add the design system guide and point agents to it * fix(ui): keep truncated lines at their final width and restore the sparkle icon * fix(ui): shape truncated lines at paint time against their final width * feat(ui): add overflow-menu, detail-header, and baseline primitives - Icon::Ellipsis, dropdown_menu, danger_menu_item, disabled_menu_item, and menu_separator for one reusable overflow menu - detail_header / detail_title / detail_body: one fixed, edge-to-edge ruled header for every detail card - list_section_label for group headings in list cards - baseline_offset puts smaller text on a larger line's baseline - MENU_WIDTH / MENU_OFFSET tokens; section labels inset to card text; pane_list centres its empty state * feat(ui): meetings overflow menu, neutral recording button, polish pass Meetings detail keeps Copy transcript and Rename visible and moves Copy summary, Reveal, Summarize/Regenerate, and Delete… into a … menu. Delete keeps its two-step confirmation in the action row; refusal rules are unchanged. Stop & transcribe is a Secondary button with a red dot and the elapsed time; the sidebar Update is Secondary with an accent dot. Polish: shared detail headers in Meetings, History, and Commands; timestamp and detail-row baselines; section labels on the card text edge; wider side segments; transcript labels on the bubble text; one menu width; Commands context moved into the detail; ... -> …; no closing period on one-phrase descriptions. Adds the --open-meeting-actions preview flag. * docs: document the accent and overflow-menu rules * fix(ui): history detail rows, delete confirmation row, side segments - History metadata rows sit directly in the detail body so values keep the full width (they collapsed to one character per line) - An armed meeting delete replaces the action row; actions wrap - Left / Either / Right selector width follows its segment widths - Ellipsis draws one icon size up to match the other glyphs optically * fix(ui): detail rows wrap long values inside the detail body * fix(ui): keep the detail body a block so detail rows wrap * fix(ui): detail rows fill their column again * refactor(ui): simplify design tokens, shared components, and meeting error banners
76 lines
2.1 KiB
Shell
Executable file
76 lines
2.1 KiB
Shell
Executable file
#!/bin/sh
|
|
set -eu
|
|
|
|
if [ "$#" -lt 2 ]; then
|
|
echo "usage: $0 OUTPUT TARGET [PREVIEW OPTIONS...]" >&2
|
|
exit 2
|
|
fi
|
|
|
|
output=$1
|
|
shift
|
|
target=$1
|
|
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
|
|
cd "$root"
|
|
if [ -n "${HEX_PREVIEW_BINARY:-}" ]; then
|
|
binary=$HEX_PREVIEW_BINARY
|
|
else
|
|
binary=$root/target/release/voice-control
|
|
fi
|
|
if [ -z "${HEX_PREVIEW_BINARY:-}" ] && [ "${HEX_PREVIEW_SKIP_BUILD:-0}" != "1" ]; then
|
|
CMAKE=${CMAKE:-/opt/homebrew/lib/python3.10/site-packages/cmake/data/bin/cmake} \
|
|
cargo build --release --bin voice-control
|
|
elif [ ! -x "$binary" ]; then
|
|
echo "preview binary does not exist: $binary" >&2
|
|
exit 1
|
|
fi
|
|
|
|
"$binary" preview "$@" &
|
|
pid=$!
|
|
cleanup() {
|
|
kill "$pid" 2>/dev/null || true
|
|
wait "$pid" 2>/dev/null || true
|
|
}
|
|
trap cleanup EXIT INT TERM
|
|
|
|
window_id=$(swift - "$pid" "$target" <<'SWIFT'
|
|
import CoreGraphics
|
|
import Foundation
|
|
|
|
let pid = Int(CommandLine.arguments[1])!
|
|
let target = CommandLine.arguments[2]
|
|
for _ in 0..<200 {
|
|
let windows = CGWindowListCopyWindowInfo(
|
|
[.optionOnScreenOnly, .excludeDesktopElements],
|
|
kCGNullWindowID
|
|
) as! [[String: Any]]
|
|
let candidates = windows.filter { window in
|
|
guard (window[kCGWindowOwnerPID as String] as? Int) == pid else {
|
|
return false
|
|
}
|
|
if target == "dictation-hud" || target == "meeting-offer" {
|
|
return true
|
|
}
|
|
let title = window[kCGWindowName as String] as? String
|
|
let bounds = window[kCGWindowBounds as String] as? [String: CGFloat]
|
|
return (title == nil || title == "" || title == "Hex")
|
|
&& (bounds?["Width"] ?? 0) >= 800
|
|
&& (bounds?["Height"] ?? 0) >= 400
|
|
}
|
|
if let window = candidates.max(by: {
|
|
let lhs = $0[kCGWindowBounds as String] as! [String: CGFloat]
|
|
let rhs = $1[kCGWindowBounds as String] as! [String: CGFloat]
|
|
return lhs["Width"]! * lhs["Height"]! < rhs["Width"]! * rhs["Height"]!
|
|
}) {
|
|
print(window[kCGWindowNumber as String] as! Int)
|
|
exit(0)
|
|
}
|
|
Thread.sleep(forTimeInterval: 0.05)
|
|
}
|
|
exit(1)
|
|
SWIFT
|
|
)
|
|
|
|
mkdir -p "$(dirname -- "$output")"
|
|
screencapture -x -l "$window_id" "$output"
|
|
echo "$output"
|