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
1 change: 1 addition & 0 deletions src/components/mobile/MobileTerminalTopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export default function MobileTerminalTopBar() {
{panelItems.map((it) => (
<DropdownMenuItem
key={it.key}
dataAttrs={{ "data-mobile-panel": it.key }}
icon={it.icon}
iconSize={16}
label={it.label}
Expand Down
9 changes: 8 additions & 1 deletion src/components/shared/DropdownMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,23 @@ interface Props {
* button, never a child — a button inside a button is invalid DOM.
*/
trailing?: ReactNode;
/**
* `data-*` hooks for the row. The mobile screens are driven over CDP by
* attribute selector, so a row that replaces a hand-written button has to
* carry the same hook the button did.
*/
dataAttrs?: Record<string, string>;
}

export function DropdownMenuItem({ icon, label, onClick, checked, iconSize = 20, sublabel, title, trailing }: Props) {
export function DropdownMenuItem({ icon, label, onClick, checked, iconSize = 20, sublabel, title, trailing, dataAttrs }: Props) {
const { createRipple, rippleEls } = useRipple();
const item = (
<button
type="button"
onClick={onClick}
onPointerDown={createRipple}
title={title}
{...dataAttrs}
className="w-full flex items-center gap-2.5 p-3 rounded-lg text-md font-medium-bold transition-colors whitespace-nowrap text-(--t-text-secondary) bg-transparent relative overflow-hidden"
onMouseEnter={(e) => {
(e.currentTarget as HTMLButtonElement).style.background = "var(--t-bg-card-hover)";
Expand Down