Skip to content

Homepage card cleanup: density, grouped My Plans, content preview (COPLAN-22)#117

Merged
HamptonMakes merged 3 commits into
mainfrom
hampton/coplan-22/homepage-cards
Jun 1, 2026
Merged

Homepage card cleanup: density, grouped My Plans, content preview (COPLAN-22)#117
HamptonMakes merged 3 commits into
mainfrom
hampton/coplan-22/homepage-cards

Conversation

@HamptonMakes
Copy link
Copy Markdown
Collaborator

@HamptonMakes HamptonMakes commented Jun 1, 2026

Makes plan cards scannable so the homepage works at hundreds of plans.

Linear: COPLAN-22 · Cycle 2 1-pager: 019e3c85

What changed

  • Default scope is now "Mine" — 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.
  • Grouped by status with section headers inside "Mine" (skipped when a single status is already filtered, or on "All").
  • Content preview on cards — first ~200 chars of markdown-stripped content, line-clamped to 2 lines. New PlansHelper#plan_content_preview helper. The card reads plan.try(:summary).presence first so COPLAN-24's AI-summary column will swap in with no card changes.
  • Density pass — collapsed three filter strips into one tight toolbar, dropped the redundant "Plans" h1, smaller card padding, tags moved inline with the meta row. Meta separators use a CSS + ::before pseudo-element instead of per-item separator spans.
  • Result: ≥ 7 cards above the fold on a 1280×800 viewport (target was 6).
  • N+1 fix: eager-load :current_plan_version so the new preview helper doesn't hit the DB per card.

Out of scope (explicitly deferred)

  • Header search bar — owned by COPLAN-21
  • AI-summary column — owned by COPLAN-24; card will pick it up automatically when the column lands
  • "Your Queue" / "Suggested for You" — Cycle 3+

Screenshots

Before

Before

After — "Mine" (default, grouped)

After Mine

After — "All" (flat by recency)

After All

Tests

  • New helper specs for PlansHelper#plan_content_preview (markdown stripping, truncation, nil cases)
  • New request specs for: default scope = mine, scope=all parity, grouped section headers, no-grouping when status-filtered, content preview rendered, fallback when no content
  • All 297 model + plans request + helper specs pass locally
  • Full suite has unrelated failures from a sibling worktree migrating the shared test DB (pending-migrations error); my code's specs all pass in isolation

…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>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

HamptonMakes and others added 2 commits June 1, 2026 16:00
…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>
@HamptonMakes HamptonMakes merged commit 1647423 into main Jun 1, 2026
5 checks passed
@HamptonMakes HamptonMakes deleted the hampton/coplan-22/homepage-cards branch June 1, 2026 21:53
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.

1 participant