Skip to content
Open
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: 1 addition & 1 deletion src/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Hero = () => {

<div className="pt-4 flex flex-wrap gap-4">
{/* Interactive Primary Link Button */}
<Link to='/track' className="group relative inline-flex items-center justify-center p-0.5 overflow-hidden text-sm font-semibold rounded-xl bg-gradient-to-br from-blue-600 via-cyan-500 to-teal-500 dark:from-blue-500 dark:via-cyan-400 dark:to-teal-400 text-slate-900 dark:text-white transition-all shadow-md dark:shadow-[0_0_20px_rgba(59,130,246,0.3)] hover:shadow-lg dark:hover:shadow-[0_0_35px_rgba(34,211,238,0.5)] transform hover:-translate-y-0.5">
<Link to='/track' className="group relative inline-flex items-center justify-center p-0.5 overflow-hidden text-sm font-semibold rounded-xl bg-gradient-to-br from-blue-600 via-cyan-500 to-teal-500 dark:from-blue-500 dark:via-cyan-400 dark:to-teal-400 text-slate-900 dark:text-white transition-all shadow-md dark:shadow-[0_0_20px_rgba(59,130,246,0.3)] hover:shadow-lg dark:hover:shadow-[0_0_35px_rgba(34,211,238,0.5)] transform hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2">
<span className="relative px-7 py-3.5 transition-all ease-in duration-75 bg-white dark:bg-[#030712] rounded-[10px] group-hover:bg-opacity-0 flex items-center space-x-2">
<Search className="h-5 w-5 text-blue-600 dark:text-cyan-400 group-hover:text-white transition-colors" />
<span className="text-slate-900 dark:text-white group-hover:text-white">Start Tracking</span>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const Navbar: React.FC = () => {
{/* Theme Toggle */}
<button
onClick={toggleTheme}
className="ml-2 p-2 rounded-xl border border-gray-300 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
className="ml-2 p-2 rounded-xl border border-gray-300 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2"
aria-label="Toggle Theme"
>
{mode === "dark" ? (
Expand All @@ -77,7 +77,7 @@ const Navbar: React.FC = () => {
{/* Theme Toggle */}
<button
onClick={toggleTheme}
className="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
className="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2"
aria-label="Toggle Theme"
>
{mode === "dark" ? (
Expand All @@ -90,7 +90,7 @@ const Navbar: React.FC = () => {
{/* Menu Toggle */}
<button
onClick={() => setIsOpen(!isOpen)}
className="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
className="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2"
aria-label="Toggle Menu"
>
{isOpen ? (
Expand Down
10 changes: 10 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,13 @@
.icon-issue-closed {
color: #cf222e;
}

/* Keyboard navigation: suppress focus ring for mouse, show for keyboard */
:focus:not(:focus-visible) {
outline: none;
}
:focus-visible {
outline: 2px solid #3b82f6;
outline-offset: 2px;
border-radius: 4px;
}
19 changes: 16 additions & 3 deletions src/pages/Tracker/Tracker.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react"
import React, { useState, useEffect, useRef, useCallback } from "react"
import {
IssueOpenedIcon,
IssueClosedIcon,
Expand Down Expand Up @@ -78,6 +78,14 @@ const Home: React.FC = () => {
const [selectedRepo, setSelectedRepo] = useState("");
const [startDate, setStartDate] = useState("");
const [endDate, setEndDate] = useState("");
const usernameInputRef = useRef<HTMLInputElement>(null);

const handleUsernameKeyDown = useCallback((e: React.KeyboardEvent<HTMLDivElement>) => {
if (e.key === "Escape") {
setUsername("");
usernameInputRef.current?.querySelector("input")?.focus();
}
}, [setUsername]);
Comment thread
coderabbitai[bot] marked this conversation as resolved.

// Fetch data when username, tab, or page changes
useEffect(() => {
Expand Down Expand Up @@ -173,7 +181,11 @@ const Home: React.FC = () => {
label="GitHub Username"
value={username}
onChange={(e) => setUsername(e.target.value)}
onKeyDown={handleUsernameKeyDown}
required
autoFocus
inputRef={usernameInputRef}
inputProps={{ "aria-label": "GitHub Username" }}
sx={{ flex: 1, minWidth: 150 }}
/>
<TextField
Expand Down Expand Up @@ -292,9 +304,10 @@ const Home: React.FC = () => {
setPage(0);
}}
sx={{ flex: 1 }}
aria-label="Data view tabs"
>
<Tab label={`Issues (${totalIssues})`} />
<Tab label={`Pull Requests (${totalPrs})`} />
<Tab label={`Issues (${totalIssues})`} aria-label={`Issues tab, ${totalIssues} total`}/>
<Tab label={`Pull Requests (${totalPrs})`} aria-label={`Pull Requests tab, ${totalPrs} total`} />
</Tabs>
<FormControl sx={{ minWidth: 150 }}>
<InputLabel sx={{ fontSize: "14px" }}>State</InputLabel>
Expand Down
Loading