feat(iter-12): collapsible schema panel, funnel analysis & ROW_NUMBER dedup levels - #26
Merged
Merged
Conversation
… dedup levels UI/UX: Right panel (Schema/Results) now collapses to a 40px rail on desktop via a › chevron in the tab bar. The SQL editor column changes from fixed-460px to flex-1 so it fills the freed space. A ‹ expand button + vertical "SCHEMA" label keep the affordance clear. Mobile layouts are unaffected. Implements the "collapsible schema panel" item from the UI/UX rotation. Game: Level 72 — Loan Product Acquisition Funnel: UNION ALL + CROSS JOIN scalar CTE funnel showing 20→15→12→5 customer conversion (100%→75%→60%→25%), ORDER BY customer_count DESC. The canonical product-analytics funnel pattern used at FAANG and digital banks. Level 73 — First Salary Credit Per Account: ROW_NUMBER() OVER (PARTITION BY account_id ORDER BY transaction_date ASC), WHERE rn = 1 dedup. Returns 4 rows (accounts 5,15,25,35). The universal dedup / latest-record-per-entity pattern for ETL, SCD, and data-quality work. Tests: 405 pass (up from 395 in iter-11). TypeScript clean.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
martinl5
marked this pull request as ready for review
June 30, 2026 18:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
›chevron; SQL editor expands to fill freed space;‹+ vertical "SCHEMA" label restore it. Mobile unaffected.UNION ALLmulti-stage aggregation +CROSS JOINscalar CTE yields 20→15→12→5 customers (100%→75%→60%→25%). Standard product-analytics funnel pattern.ROW_NUMBER() OVER (PARTITION BY account_id ORDER BY transaction_date ASC)+WHERE rn = 1dedup. 4 rows. Universal ETL/SCD dedup pattern.[UI/UX Improvements]
Collapsible schema panel (
GameProvider.tsx): The right-hand Schema/Results column now collapses to a 40 px desktop rail by clicking the›chevron appended to the tab bar's right edge. When collapsed:lg:w-[420px]→lg:w-10withtransition-all duration-200 ease-in-out‹expand button (gold, bordered) and a vertical "SCHEMA" text label so the affordance is always visiblelg:w-[460px] flex-shrink-0→lg:flex-1 min-w-0, growing to fill freed horizontal space — more room for long CTEs and window-function queriesuseState), not persisted — panel always opens on reloadaria-label+title; mobile stacked layout is unaffectedDirectly implements the "collapsible schema panel" item from the UI/UX rotation.
[Game Design Tweaks]
Level 72 (Expert, difficulty 4) — "Loan Product Acquisition Funnel": Teaches the canonical SQL product-analytics funnel using
UNION ALLof four scalar aggregate queries (tagged withord) and aCROSS JOINscalar CTE for the conversion-rate denominator. Four stages: All Customers (20, 100%), Loan Applicants (15, 75%), Active Loan Holders (12, 60%), Active Home Loan Holders (5, 25%).ORDER BY customer_count DESCgives natural funnel order (all counts distinct). Reinforces the CROSS JOIN scalar CTE idiom from Level 70 in a new product-analytics context. This exact UNION ALL + CROSS JOIN pattern is used in BigQuery/Redshift/Snowflake at FAANG and digital banks. No new data required.Level 73 (Expert, difficulty 4) — "First Salary Credit Per Account (ROW_NUMBER Dedup)": Teaches the universal SQL deduplication pattern:
ROW_NUMBER() OVER (PARTITION BY account_id ORDER BY transaction_date ASC)in a CTE, thenWHERE rn = 1. Compliance framing (MAS Notice 632 income-verification) makes the business case concrete. Returns 4 rows — accounts 5/15/25/35 (customers Aisha Binte Yusof, Chen Mei Ling, Nur Hidayah, Fiona Tan) with their first Salary Credit amounts ($3 750–$8 250) and dates in Jan–Feb 2024. Pattern is identical across BigQuery, Redshift, Snowflake, Spark SQL, and PostgreSQL. No new data required.[Database & Code Optimizations]
LevelUpModal.tsxEPOCH_NEXT_HINTextended with entries for levels 72 (funnel) and 73 (ROW_NUMBER dedup);nextHintKeysentinel array extended to[…, 71, 72, 73]; fallback updated?? 71→?? 73MAX_LEVELinprogression.tsauto-derives from the last level array entry (now 73) — zero touch pointslg:w-[460px] flex-shrink-0→lg:flex-1 min-w-0so the editor grows when the panel collapsesloans,transactions,accounts,customerstablesTest results
🤖 Generated with Claude Code
https://claude.ai/code/session_011AFkb4EU6i5RTHn6sVFhGs
Generated by Claude Code