Homepage card cleanup: density, grouped My Plans, content preview (COPLAN-22)#117
Conversation
…PLAN-22) Makes plan cards scannable so the homepage works at scale. * Default scope is now "Mine" — the homepage opens to your own plans grouped by status (developing → live → considering → brainstorm → abandoned). "All" is one click away. `scope` is validated against an allow-list to leave room for a future "team" scope. * New `Plan.prioritized_by_status` scope (DB-side CASE via `sanitize_sql_array`) keeps grouping in SQL — no Ruby-side sorts. * Cards show a 2-line markdown-stripped content preview via a new `PlansHelper#plan_content_preview` helper. The card reads `plan.try(:summary).presence` first so COPLAN-24's AI-summary column swaps in with no card changes when it lands. * Density pass: collapsed three filter strips into one tight toolbar, dropped the redundant "Plans" h1, smaller card padding, tags moved inline with meta. Result: at least 7 cards above the fold @ 1280x800. * Card meta separators use a `+ ::before` pseudo-element instead of per-item separator spans (cleaner DOM, per code-review feedback). * Eager-loads `:current_plan_version` to avoid an N+1 from the new preview helper. * Specs: helper unit specs + request specs for default scope, grouping, content preview, and scope=all parity. Adds factory traits for :developing, :live, :abandoned. Amp-Thread-ID: https://ampcode.com/threads/T-019e84ca-1a7e-7589-bc94-64454a438f90 Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53cb8055df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| PER_PAGE = 20 | ||
|
|
||
| SCOPES = %w[mine all].freeze | ||
| DEFAULT_SCOPE = "mine".freeze |
There was a problem hiding this comment.
Preserve all-scope links that omit scope
When a signed-in user clicks the existing landing-page link labeled Browse all plans →, it still calls plans_path without a scope (checked engine/app/views/coplan/welcome/_default_landing.html.erb:66), but this new default now routes that unscoped request to only the user's own plans. That makes a link explicitly promising all plans silently hide everyone else's published plans; update that caller (and any similar all-browse entry points) to pass scope: "all" or avoid changing the unscoped default for those paths.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch — fixed in a124a65. The 'Browse all plans →' link now passes scope: "all" explicitly so it keeps its promise. The primary 'Browse plans' CTA at the top stays unscoped (defaults to mine), which feels right for a signed-in user landing.
…ween cards * Remove border-bottom from .plans-list__section (Hampton: thin line felt out of place). * Pass previous page's last status through the Turbo Frame URL so the next page doesn't re-emit a section header when its first plan has the same status as the last one on the previous page. * Bump card-to-card gap to space-sm and card padding to a uniform space-md so the list reads less cramped. Amp-Thread-ID: https://ampcode.com/threads/T-019e84ca-1a7e-7589-bc94-64454a438f90 Co-authored-by: Amp <amp@ampcode.com>
The new default scope (mine) silently hid published plans when users clicked the 'Browse all plans →' link on the welcome landing page. Pass scope: "all" explicitly to match the link's promise. Amp-Thread-ID: https://ampcode.com/threads/T-019e84ca-1a7e-7589-bc94-64454a438f90 Co-authored-by: Amp <amp@ampcode.com>
Makes plan cards scannable so the homepage works at hundreds of plans.
Linear: COPLAN-22 · Cycle 2 1-pager: 019e3c85
What changed
developing → live → considering → brainstorm → abandoned). "All" is one click away.scopeis validated against an allow-list to leave room for a futureteamscope.PlansHelper#plan_content_previewhelper. The card readsplan.try(:summary).presencefirst so COPLAN-24's AI-summary column will swap in with no card changes.+ ::beforepseudo-element instead of per-item separator spans.:current_plan_versionso the new preview helper doesn't hit the DB per card.Out of scope (explicitly deferred)
Screenshots
Before
After — "Mine" (default, grouped)
After — "All" (flat by recency)
Tests
PlansHelper#plan_content_preview(markdown stripping, truncation, nil cases)