Skip to content

feat: add the ship funnel stats page - #1357

Merged
cskartikey merged 3 commits into
hackclub:mainfrom
jeremy46231:feat/ship-funnel
Sep 30, 2026
Merged

cskartikey merged 3 commits into
hackclub:mainfrom
jeremy46231:feat/ship-funnel

Conversation

@jeremy46231

@jeremy46231 jeremy46231 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

what's this do?

adds a new public stats page, the ship funnel (/stats/ship_funnel, linked from /admin next to Hour Funnel). it's a sankey of every shipped hour and where it is now: devlogged (optional), shipped, ship review, GOI, fraud check, airtable, and then final pass/ unified.

  • toggles for software / hardware / both and hours / ships
  • "show unshipped hours" adds a devlogged column

it's self-contained: its own service, controller, policy, view, stimulus controller, job and stylesheet. a job recomputes it every hour and caches it for 2. anyone can view it, only admins see the recompute button.

some stuff will still be janky until #1355 is merged

show it works

image

ai?

claude code

A Sankey of every shipped hour, left to right through ship review
(Shipwrights, or build review for hardware), GOI, the fraud check and
Airtable, split into Unified, the final-pass queue, errors and
collisions by reading the submission table.

It toggles between software, hardware or both and between hours and
ships, and can add a devlogged column in front for hours that never
reached a ship. Loops the chart can't draw are counted underneath.

Cached for an hour and recomputed on demand, like the hour funnel.
Admin only.
Brakeman flagged the loop counts as a possible SQL injection. The
only interpolated value was an enum integer, but plain ActiveRecord
queries work too, so no problem
Move the Ship Funnel from /admin/ship_funnel to /stats/ship_funnel so
anyone can view it, as Max approved. Only admins see the Update button
and the link back to /admin.

- Rename Admin::ShipFunnel to ShipFunnel, cached for 2 hours
- Add ShipFunnelRefreshJob, run hourly from recurring.yml, so viewers
  who aren't admins read the cached numbers instead of computing them
- Show a "check back in a minute" note while the cache is empty
- Merge the admin view and partial into a single page
- Move the styles out of admin.scss and reset the toggle borders that
  public pages pick up
- Pull the Sankey node padding out into a NODE_PADDING constant
- Link to the page from /admin, shown to admins only
@jeremy46231 jeremy46231 changed the title feat(admin): add the ship funnel dashboard feat: add the ship funnel stats page Sep 30, 2026
@jeremy46231

Copy link
Copy Markdown
Contributor Author

make it public!

@cskartikey
cskartikey added this pull request to the merge queue Sep 30, 2026
Merged via the queue into hackclub:main with commit 269b3dc Sep 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants