Skip to content
Closed
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
2 changes: 2 additions & 0 deletions resources/js/components/commit-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ export function CommitCard({
<div className="flex flex-wrap items-center gap-0.5">
<CommitStarButton
commit={commit}
keyShortcut="s"
className="px-2 py-0.5"
/>
<CommitPastelButton
Expand All @@ -503,6 +504,7 @@ export function CommitCard({
<>
<CommitStarButton
commit={commit}
keyShortcut="s"
className="px-2 py-0.5"
/>
<CommitPastelButton
Expand Down
8 changes: 7 additions & 1 deletion resources/js/components/commit-star-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ function starLabel(starred: boolean, count: number): string {

export function CommitStarButton({
commit,
keyShortcut,
className,
}: {
commit: Commit;
keyShortcut?: string;
className?: string;
}) {
const { auth } = usePage().props;
Expand Down Expand Up @@ -140,14 +142,18 @@ export function CommitStarButton({

return (
<>
<ActionTooltip label={starred ? 'Unstar' : 'Star'}>
<ActionTooltip
label={starred ? 'Unstar' : 'Star'}
shortcut={keyShortcut}
>
<button
ref={setElement}
aria-disabled={request.processing}
type="button"
onClick={toggle}
aria-pressed={starred}
aria-label={starLabel(starred, count)}
aria-keyshortcuts={keyShortcut}
className={cn(
'group/star inline-flex items-center gap-1 rounded-md px-1.5 py-1 font-mono text-[13px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground',
starred && 'text-primary hover:text-primary',
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/keyboard-shortcuts-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type Shortcut = { keys: string[]; label: string };
const shortcuts = (keys: KeyLabels): Shortcut[] => [
{ keys: ['j'], label: 'Next commit' },
{ keys: ['k'], label: 'Previous commit' },
{ keys: ['s'], label: 'Star or unstar the focused commit' },
{ keys: ['y'], label: 'Copy link to the focused commit' },
{ keys: ['↵'], label: 'Open the focused commit' },
{ keys: ['r'], label: 'Reply to commit' },
Expand Down