#178

Collapse/expand for the queue sections

OpentheMackabuwants to merge intofrom

changes

  • implemented collapse/expand for the queue sections on both issues and pull requests
  • codebase side panel collapse state now persists

https://github.com/user-attachments/assets/0fd1234b-3376-47b8-8ecc-e886067a926d

Summary by CodeRabbit

  • New Features

    • Per-group collapse on Issues and Pulls with persistent state.
    • Shared sticky group headers with collapse toggles.
    • Dashboard counts deduplicated for more accurate totals.
  • Style

    • Improved command palette spacing and item layout.
    • Side panel collapse now persists across sessions.
    • Loading skeletons simplified (staggered animations removed).

Activity

27
coderabbitai[bot]6mo ago
📝 Walkthrough

Walkthrough

Persist side-panel and per-group collapse state to localStorage via new hooks; add shared StickyGroupHeader/StickyGroupContent (sticky detection, toggle, animations); deduplicate issue/pull counts with a new utility; remove staggered skeleton animations; minor styling and pnpm/miniflare patch.

Changes

Cohort / File(s)Summary
Side-panel & collapsed-groups storage
apps/dashboard/src/components/layouts/dashboard-side-panel.tsx, apps/dashboard/src/lib/collapsible-groups-storage.ts
Persist side-panel collapsed state to diffkit:side-panel-collapsed. Add useCollapsedGroups(storageKey) hook storing Record<string, boolean> in localStorage with validation and memoized updater.
Shared sticky header/content
apps/dashboard/src/components/shared/sticky-group-header.tsx
Add StickyGroupHeader (stuck detection, toggle, aria-expanded, chevron rotation) and StickyGroupContent (conditional rendering with AnimatePresence; chooses animation strategy by item count).
Issues & Pulls pages
apps/dashboard/src/routes/_protected/issues.tsx, apps/dashboard/src/routes/_protected/pulls.tsx
Replace route-local sticky header logic with shared components; wire per-group persistent collapse via useCollapsedGroups(...); metric clicks un-collapse groups; render items inside StickyGroupContent; change total counts to deduplicated totals.
Counts / utilities / layout
apps/dashboard/src/components/layouts/dashboard-layout.tsx, apps/dashboard/src/lib/count-unique.ts
Add countUniqueById and update dashboard layout to compute deduplicated pull/issue totals using it (replace summing of lengths).
Skeleton / animation removals
apps/dashboard/src/components/details/detail-page.tsx, apps/dashboard/src/components/compare/compare-page.tsx, apps/dashboard/src/components/issues/detail/issue-detail-page.tsx, apps/dashboard/src/components/pulls/detail/pull-detail-page.tsx
Remove staggered motion wrappers (StaggerItem/StaggerLoop) and mainItemCount usage; render static skeleton blocks directly.
Command palette styling
apps/dashboard/src/components/navigation/command-palette.tsx
Adjust Tailwind classes to remove horizontal padding and normalize group/item paddings and item rounding.
Miniflare patch & package config
package.json, patches/miniflare@4.20260409.0.patch
Add pnpm patched dependency entry for miniflare@4.20260409.0 and patch that adds v8Flags with --max-old-space-size=4096.

Sequence Diagram(s)

sequenceDiagram
  participant User as "User"
  participant Header as "StickyGroupHeader"
  participant Hook as "useCollapsedGroups"
  participant Storage as "localStorage\n(useLocalStorageState)"
  participant Content as "StickyGroupContent / Page"

  rect rgba(235,245,255,0.5)
  User->>Header: Click collapse toggle
  end

  rect rgba(220,255,235,0.5)
  Header->>Hook: setGroupCollapsed(groupId, newState)
  Hook->>Storage: write JSON for storageKey
  Storage-->>Hook: confirm write
  Hook-->>Header: update collapsedGroups
  end

  rect rgba(255,245,235,0.5)
  Hook->>Content: collapsedGroups change -> re-render
  Content-->>User: show/hide items with animation
  end

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • stylessh/diffkit#165 — modifies compare/PR surfaces and compare page components, overlapping compare-area changes.
  • stylessh/diffkit#166 — edits compare-page.tsx; touches same compare UI file updated here.
  • stylessh/diffkit#158 — touches shiki/highlighter and pnpm patch overrides related to similar patch workflow.

Suggested reviewers

  • stylessh
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check❓ InconclusiveThe PR description covers the main changes and includes a video demonstration, but lacks key template sections: missing Summary section context, no structured Changes list with details, and no Test Plan with checkboxes or testing confirmation.Expand the description to follow the template: add a Summary section explaining why this feature matters, detail the Changes with bullet points covering each file/feature, and include a Test Plan section with specific testing steps and checkboxes.
✅ Passed checks (3 passed)
Check nameStatusExplanation
Title check✅ PassedThe title 'Collapse/expand for the queue sections' directly and specifically describes the main feature added in this PR—collapsible/expandable queue sections for issues and pull requests.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]reviewed6mo ago
coderabbitai[bot]6mo ago
🧹 Nitpick comments (1)
apps/dashboard/src/routes/_protected/pulls.tsx (1)

316-405: Consider extracting StickyGroupHeader to a shared component.

The StickyGroupHeader implementation in pulls.tsx and issues.tsx is nearly identical. Extracting it to a shared component would reduce duplication and ensure consistent behavior across both pages.

This can be deferred to a follow-up PR if preferred.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/dashboard/src/routes/_protected/pulls.tsx` around lines 316 - 405,
Duplicate StickyGroupHeader exists in pulls.tsx and issues.tsx; extract it into
a shared component to remove duplication. Create a new component (e.g.,
StickyGroupHeader) in a shared UI/components location, preserve the same
props/signature (sectionRef, scrollContainerRef, stickyTop, icon, title, count,
isEmpty, isCollapsed, onCollapsedChange) and the internal logic (headerRef,
useEffect with updateStickyState, className handling and button JSX), export it,
then replace the local implementations in both pulls.tsx and issues.tsx with
imports that use the shared StickyGroupHeader so behavior and styling remain
identical. Ensure prop types and Icon component type match the original to avoid
type errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/dashboard/src/routes/_protected/pulls.tsx`:
- Around line 316-405: Duplicate StickyGroupHeader exists in pulls.tsx and
issues.tsx; extract it into a shared component to remove duplication. Create a
new component (e.g., StickyGroupHeader) in a shared UI/components location,
preserve the same props/signature (sectionRef, scrollContainerRef, stickyTop,
icon, title, count, isEmpty, isCollapsed, onCollapsedChange) and the internal
logic (headerRef, useEffect with updateStickyState, className handling and
button JSX), export it, then replace the local implementations in both pulls.tsx
and issues.tsx with imports that use the shared StickyGroupHeader so behavior
and styling remain identical. Ensure prop types and Icon component type match
the original to avoid type errors.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7009cc60-a824-4512-a11f-39b46287d533

📥 Commits

Reviewing files that changed from the base of the PR and between ab164025aff95b9e81cf9e986363c11d444784f4 and 1333b9a614d80f9f225daffb7c8031f84fecf819.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • apps/dashboard/src/components/layouts/dashboard-side-panel.tsx
  • apps/dashboard/src/components/navigation/command-palette.tsx
  • apps/dashboard/src/lib/collapsible-groups-storage.ts
  • apps/dashboard/src/routes/_protected/issues.tsx
  • apps/dashboard/src/routes/_protected/pulls.tsx
  • package.json
  • patches/miniflare@4.20260409.0.patch
stylessh6mo ago

@theMackabu this is nice!

i'm just not a big fan on animating lists display, bc anim gets weirder as the list gets longer.

theMackabu6mo ago

@theMackabu this is nice!

i'm just not a big fan on animating lists display, bc anim gets weirder as the list gets longer.

oh let me either remove or fix that, didn't consider long lists

stylessh6mo ago

let's remove the animation for now, sorry!

theMackabu6mo ago

animation removed

coderabbitai[bot]reviewed6mo ago
coderabbitai[bot]6mo ago

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/dashboard/src/components/details/detail-page.tsx`:
- Around line 86-92: DetailPageSkeletonLayout's API changed: it no longer
accepts mainItemCount nor exports StaggerItem; update consuming modules that
import StaggerItem and pass mainItemCount to instead pass the value as
sidebarSectionCount to DetailPageSkeletonLayout and remove any StaggerItem
usage/wrapping. Specifically, drop the StaggerItem import/JSX and directly
render the children previously wrapped by <StaggerItem>, and replace occurrences
like mainItemCount={N} on DetailPageSkeletonLayout with sidebarSectionCount={N};
update any references to the removed StaggerItem symbol accordingly so
type-checking/build succeed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 41d6b8c2-bff2-4cb7-a53a-23da9a63a6dd

📥 Commits

Reviewing files that changed from the base of the PR and between 3d15031fbdb4f5e7e28a9042d2acdd725867c2ae and fb028bee2b592b7f7cb0037e76fa5c728c3e5068.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • apps/dashboard/src/components/compare/compare-page.tsx
  • apps/dashboard/src/components/details/detail-page.tsx
  • apps/dashboard/src/components/issues/detail/issue-detail-page.tsx
  • apps/dashboard/src/components/pulls/detail/pull-detail-page.tsx
stylessh6mo ago

sorry! i made some changes conflicting with this, can you fix that? i will approved pr for now

stylesshapproved changes6mo ago
stylessh6mo ago

type checks are failing

theMackabu6mo ago

github prs seem to finally be working for me again LOL

stylessh6mo ago

@theMackabu can you fix checks?