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
49 changes: 47 additions & 2 deletions imagent-ui/app/components/LeaderboardBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,14 @@ function HistoryPanel({
query: string;
totalEntries: number;
}) {
const trimmedQuery = query.trim();
const filtersActive = filter !== "all" || trimmedQuery.length > 0;
const activeFilterLabel = historyFilters.find((item) => item.id === filter)?.label ?? "All";
const clearFilters = () => {
onFilterChange("all");
onQueryChange("");
};

return (
<section className="leaderboard-history-panel" aria-label="Merged and closed PR history">
<div className="leaderboard-history-head">
Expand All @@ -310,6 +318,16 @@ function HistoryPanel({
onChange={(event) => onQueryChange(event.target.value)}
placeholder="Search PR, agent, contributor"
/>
{trimmedQuery ? (
<button
aria-label="Clear search"
className="leaderboard-history-search-clear"
onClick={() => onQueryChange("")}
type="button"
>
<X size={14} />
</button>
) : null}
</label>
</div>

Expand All @@ -325,8 +343,26 @@ function HistoryPanel({
{item.label}
</button>
))}
{filtersActive ? (
<button
aria-label="Clear history filters and search"
className="leaderboard-history-clear"
onClick={clearFilters}
type="button"
>
Clear
</button>
) : null}
</div>

{filtersActive ? (
<p aria-live="polite" className="leaderboard-history-summary">
{totalEntries === 0
? `No matches for ${activeFilterLabel}${trimmedQuery ? ` · “${trimmedQuery}”` : ""}`
: `${totalEntries} match${totalEntries === 1 ? "" : "es"} · ${activeFilterLabel}${trimmedQuery ? ` · “${trimmedQuery}”` : ""}`}
</p>
) : null}

<div className="leaderboard-history-list custom-scrollbar">
{entries.length ? entries.map((entry) => (
<HistoryItem
Expand All @@ -338,8 +374,17 @@ function HistoryPanel({
)) : (
<div className="leaderboard-history-empty">
<History size={20} />
<strong>No Resolved PRs</strong>
<p>No merged or closed pull requests match this view.</p>
<strong>{filtersActive ? "No Matching PRs" : "No Resolved PRs"}</strong>
<p>
{filtersActive
? "Nothing in the archive matches this filter or search. Clear the controls to see the full history."
: "No merged or closed pull requests match this view."}
</p>
{filtersActive ? (
<button className="leaderboard-history-empty-action" onClick={clearFilters} type="button">
Clear filters
</button>
) : null}
</div>
)}
</div>
Expand Down
68 changes: 68 additions & 0 deletions imagent-ui/app/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -11856,6 +11856,29 @@ body .leaderboard-history-search input::placeholder {
font-family: var(--font-jetbrains), "JetBrains Mono", ui-monospace, monospace;
}

body .leaderboard-history-search-clear {
align-items: center;
background: rgba(0, 226, 251, 0.08);
border: 1px solid rgba(99, 222, 255, 0.18);
border-radius: 999px;
color: var(--leaderboard-cyan);
cursor: pointer;
display: inline-flex;
flex: 0 0 auto;
height: 22px;
justify-content: center;
margin-left: auto;
padding: 0;
width: 22px;
}

body .leaderboard-history-search-clear:hover,
body .leaderboard-history-search-clear:focus-visible {
background: rgba(0, 226, 251, 0.16);
border-color: rgba(0, 226, 251, 0.42);
outline: none;
}

body .leaderboard-history-filters {
align-items: center;
border-bottom: 1px solid rgba(99, 222, 255, 0.1);
Expand Down Expand Up @@ -11888,6 +11911,30 @@ body .leaderboard-history-filters button.active {
outline: none;
}

body .leaderboard-history-clear {
background: rgba(255, 120, 120, 0.08) !important;
border-color: rgba(255, 140, 140, 0.28) !important;
color: #ffb4b4 !important;
margin-left: auto;
}

body .leaderboard-history-clear:hover,
body .leaderboard-history-clear:focus-visible {
background: rgba(255, 120, 120, 0.16) !important;
border-color: rgba(255, 140, 140, 0.48) !important;
color: #ffd0d0 !important;
}

body .leaderboard-history-summary {
color: var(--leaderboard-muted);
font-family: var(--font-jetbrains), "JetBrains Mono", ui-monospace, monospace;
font-size: 10px;
font-weight: 700;
letter-spacing: 0.02em;
margin: 0;
padding: 8px 16px 0;
}

body .leaderboard-history-list {
display: grid;
min-height: 258px;
Expand Down Expand Up @@ -12087,6 +12134,27 @@ body .leaderboard-history-empty strong {
body .leaderboard-history-empty p {
font-size: 12px;
margin: 6px 0 0;
max-width: 34ch;
}

body .leaderboard-history-empty-action {
background: rgba(0, 226, 251, 0.1);
border: 1px solid rgba(0, 226, 251, 0.34);
border-radius: 999px;
color: #ffffff;
cursor: pointer;
font-family: var(--font-jetbrains), "JetBrains Mono", ui-monospace, monospace;
font-size: 10px;
font-weight: 850;
margin-top: 14px;
min-height: 32px;
padding: 0 14px;
}

body .leaderboard-history-empty-action:hover,
body .leaderboard-history-empty-action:focus-visible {
background: rgba(0, 226, 251, 0.18);
outline: none;
}

body .leaderboard-history-pagination {
Expand Down
Loading