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
13 changes: 10 additions & 3 deletions app/renderer/components/Punchcard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ export function Punchcard({ timeline }: { timeline: Timeline }) {
const track = (event: React.MouseEvent) => {
if (!cell.covered || !wrapRef.current) return
const r = wrapRef.current.getBoundingClientRect()
setHover({ x: event.clientX - r.left, y: event.clientY - r.top, wd, h })
// Clamp x so the centered tooltip never crops at the strip's
// edges; the y flip below handles the top rows.
const x = Math.min(Math.max(event.clientX - r.left, 70), r.width - 70)
setHover({ x, y: event.clientY - r.top, wd, h })
}
return (
<div key={h} style={{ aspectRatio: '1', display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 2 }} onMouseEnter={track} onMouseMove={track}>
Expand All @@ -118,8 +121,12 @@ export function Punchcard({ timeline }: { timeline: Timeline }) {
))}
{hover && hovered && (
<div style={{
pointerEvents: 'none', position: 'absolute', zIndex: 10, left: hover.x, top: hover.y - 8,
transform: 'translate(-50%, -100%)', borderRadius: 8, border: '1px solid var(--line)',
pointerEvents: 'none', position: 'absolute', zIndex: 10, left: hover.x,
// Top rows flip the tooltip BELOW the cursor: the scroll
// container clips anything above its own top edge.
top: hover.y < 56 ? hover.y + 14 : hover.y - 8,
transform: hover.y < 56 ? 'translate(-50%, 0)' : 'translate(-50%, -100%)',
borderRadius: 8, border: '1px solid var(--line)',
background: 'var(--bg)', padding: '5px 10px', fontSize: 'var(--fs-meta)', boxShadow: 'var(--card-shadow)',
}}>
<div style={{ fontWeight: 'var(--fw-medium)' as never, color: 'var(--ink)' }}>{WEEKDAYS_FULL[hover.wd]} {String(hover.h).padStart(2, '0')}:00</div>
Expand Down
10 changes: 6 additions & 4 deletions dash/src/components/Punchcard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ export function Punchcard({ timeline }: { timeline: GranularHistory }) {
onMouseEnter={(e) => {
if (!cell.covered || !wrapRef.current) return
const r = wrapRef.current.getBoundingClientRect()
setHover({ x: e.clientX - r.left, y: e.clientY - r.top, wd, h })
setHover({ x: Math.min(Math.max(e.clientX - r.left, 70), r.width - 70), y: e.clientY - r.top, wd, h })
}}
onMouseMove={(e) => {
if (!cell.covered || !wrapRef.current) return
const r = wrapRef.current.getBoundingClientRect()
setHover({ x: e.clientX - r.left, y: e.clientY - r.top, wd, h })
setHover({ x: Math.min(Math.max(e.clientX - r.left, 70), r.width - 70), y: e.clientY - r.top, wd, h })
}}
>
<div
Expand Down Expand Up @@ -158,8 +158,10 @@ export function Punchcard({ timeline }: { timeline: GranularHistory }) {

{hover && hovered && (
<div
className="pointer-events-none absolute z-10 -translate-x-1/2 -translate-y-full rounded-lg border border-border bg-popover px-2.5 py-1.5 text-xs shadow-xl ring-1 ring-black/5"
style={{ left: hover.x, top: hover.y - 8 }}
className="pointer-events-none absolute z-10 -translate-x-1/2 rounded-lg border border-border bg-popover px-2.5 py-1.5 text-xs shadow-xl ring-1 ring-black/5"
// Top rows flip the tooltip below the cursor; the overflow
// container clips anything above its own top edge.
style={{ left: hover.x, top: hover.y < 56 ? hover.y + 14 : hover.y - 8, transform: hover.y < 56 ? 'translateX(-50%)' : 'translate(-50%, -100%)' }}
>
<div className="font-medium text-foreground">
{WEEKDAYS_FULL[hover.wd]} {pad2(hover.h)}:00
Expand Down
127 changes: 0 additions & 127 deletions mac/Sources/CodeBurnMenubar/Data/WorkflowStrip.swift

This file was deleted.

1 change: 0 additions & 1 deletion mac/Sources/CodeBurnMenubar/Views/MenuBarContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ struct MenuBarContent: View {
ActivitySection()
Divider().opacity(0.5)
ModelsSection()
WorkflowSection()
PullRequestsSection()
Divider().opacity(0.5)
ToolingSection()
Expand Down
111 changes: 0 additions & 111 deletions mac/Sources/CodeBurnMenubar/Views/WorkflowSection.swift

This file was deleted.

Loading
Loading