Skip to content

Restructure docs sidebar and simplify page titles - #42

Merged
YusukeIwaki merged 9 commits into
mainfrom
docs-restructure-sidebar
May 8, 2026
Merged

YusukeIwaki merged 9 commits into
mainfrom
docs-restructure-sidebar

Conversation

@YusukeIwaki

Copy link
Copy Markdown
Owner

Summary

  • Group the flat docs sidebar into Introduction / Learn / Browser Tests / Comparisons / Reference categories, modeled after the Vitest guide.
  • Drop SEO-stuffed titles so each page's <title>, <h1>, and sidebar entry match (e.g. Pytest-style Fixtures in Ruby → Fixtures). Search keywords stay in the description frontmatter, which Docusaurus renders as <meta name="description">.
  • Use sidebar_label only where the sidebar entry should be shorter than the page title (Playwright, Rails, vs Pytest, vs RSpec, vs Minitest).
  • Fix the broken first sentence in intro.md after renaming the H1 (Smartest → Why Smartest).

Sidebar before / after

Before                                    After
---------------------------------------   -------------------------------
Pytest-style fixtures for Ruby            Introduction
Getting Started                             Why Smartest
Writing Tests                               Getting Started
Running Test Suites                       Learn
Skipping Tests                              Writing Tests
Pytest-style Fixtures in Ruby               Fixtures
Stubs                                       Stubs
Matchers                                    Matchers
Helpers                                     Helpers
Playwright-style Browser Tests in Ruby      Skipping Tests
Rails Browser Tests                         Running Tests
Comparisons                               Browser Tests
  Pytest-style Fixtures for Ruby            Playwright
  Smartest vs RSpec                         Rails
  Smartest vs Minitest                    Comparisons
Reference                                   vs Pytest
  Errors                                    vs RSpec
                                            vs Minitest
                                          Reference
                                            Errors

Test plan

  • npm run build passes in documentation/
  • Local npm run serve verified via Playwright: page <title> is Fixtures | Smartest, sidebar shows the new category structure, breadcrumb is Home > Learn > Fixtures, prev/next nav uses the new labels
  • Vercel preview renders the same on deploy

🤖 Generated with Claude Code

Group the flat sidebar into Introduction / Learn / Browser Tests /
Comparisons / Reference categories, modeled after the Vitest guide.
Drop SEO-stuffed titles so each page's title, H1, and sidebar entry
match; keep search keywords in the description frontmatter (rendered
as <meta name="description">). Use sidebar_label only where the
sidebar entry should be shorter than the page title (Playwright,
Rails, vs Pytest, vs RSpec, vs Minitest).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented May 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
smartest Ready Ready Preview, Comment May 8, 2026 0:34am

Rename the two Browser Tests pages from generic tool/framework names
(Playwright, Rails) to scenario-driven titles that say what the page
helps you do. This anticipates a future "Test a Rails app in Docker"
page so the three sit naturally side by side.

- Playwright page: "Test a remote site"
- Rails page: "Test a Rails app locally"

Drop the now-redundant sidebar_label entries since the new titles are
already short enough for the sidebar.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Playwright page is the entry point of the Browser Tests category —
it answers "why does this exist?" before the Quick Start. Rename it
from a scenario title to a Why-style title that mirrors "Why Smartest"
in Introduction, matching how Vitest pairs "Why Vitest" with
"Why Browser Mode".

Add a 4-line summary at the top, drawn from the dev.to article, that
positions Smartest as making Ruby browser testing *smarter*, not just
slightly nicer — pytest-style fixtures replace scattered RSpec/Minitest
setup so the Playwright lifecycle is expressed directly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous summary opened with a critique of mainstream Ruby browser
testing, which buried the actual reason Smartest exists: it follows the
move Playwright Test made — choosing a dedicated runner over a Jest
plugin because browser testing is a different domain from unit testing.
Reframe so that inspiration leads, and the Ruby implication ("rebuild
the runner around pytest-style fixtures") follows from it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The page used to break flow with a "Why It Feels Like Playwright Test
Fixtures" section between the intro and the Quick Start, which was
disorienting for someone who had never tried browser testing with this
library. Reorganize so a first-time reader gets a single Why up front,
goes straight into the four-step scaffold, and only then meets the
internals.

- Drop the "Why It Feels Like Playwright Test Fixtures" section. The
  Playwright Test inspiration is already covered by the new Why intro,
  and the lifecycle bullets are restated alongside the actual fixture
  code in the "Browser lifecycle fixture" subsection.
- Replace the old transition sentence with a practical bridge: "in
  practice you stay in Ruby … the four steps below take you from zero
  to a passing browser test."
- Rename "Customization Points" to "How it works" so the second half of
  the page reads as an explanation of the scaffold rather than as
  advanced customization.
- Reword the opening to "Smartest is invented to make Ruby browser
  testing smarter".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous intro just said "Smartest can run Rails browser tests against
your Rails test environment." That doesn't speak to the audience most likely
to land on this page: Rails engineers whose existing system-test suite is
flaky and hard to customize.

Rewrite the opening as a 4-sentence pitch that:

1. credits Rails system tests as a wonderful idea for edge-case browser
   testing — FactoryBot, ActiveRecord, Rails helpers shaping state from Ruby
2. names the two operational problems that surface over time — Capybara is
   hard to customize beyond its defaults, and the architecture tends to
   produce flaky tests
3. positions Smartest as a Capybara-independent replacement built on
   Playwright and pytest-style fixtures
4. reassures the reader that it coexists with existing system tests, so
   migration can be gradual rather than a rewrite

Also update the page description so search snippets surface the same framing
("Capybara-independent ... coexists ... gradual migration").

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Capybara is the existing answer for Rails browser testing, so engineers
considering Smartest most often arrive comparing it against Capybara —
not against RSpec or Minitest. Add a dedicated comparison page so that
audience can self-serve.

The page is structured around two questions an engineer feeling
operational pain actually asks:

- "Should I migrate my login-form test?" → no, Capybara is great at
  short synchronous flows and there is no leverage to gain.
- "Should I migrate my flaky modal/Turbo/SPA test?" → yes, the standard
  escape hatch (capybara-playwright-driver's with_playwright_page) adds
  a nested-callback layer that gets disproportionate fast, while in
  Smartest the same scenario is a flat sequence against a Playwright
  Page supplied by the page: fixture.

The intro cites the Zenn article on with_playwright_page friction. The
body follows the vs RSpec / vs Minitest layout: At a Glance table,
concrete code-side-by-side comparisons, a DSL reference table, setup
and stubbing, fit criteria, and a coexistence/migration section.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two related changes that future docs PRs should not have to rediscover:

documentation/AGENTS.md (new)
  Capture the framing and structural decisions made while restructuring the
  site:

    - what Smartest is for (smarter Ruby browser testing, not a nicer
      RSpec) so individual pages do not have to re-establish it
    - the sidebar shape (Introduction / Learn / Browser Tests /
      Comparisons / Reference) and why
    - per-page primary purpose for all 15 pages
    - the title / sidebar_label / description split, and the SEO-stuffing
      mistake we have already corrected
    - the tone conventions (one Why per page, scenario titles, first-time
      reader flow)
    - an explicit overlap warning for "Test a Rails app locally" and
      "vs Capybara": when editing one, read the other in the same change
      and verify roles do not blur into duplication

AGENTS.md
  Point the root agent instructions at documentation/AGENTS.md so editorial
  decisions are loaded once, not re-derived per change.

documentation/docs/smartest-vs-capybara.md
  Drop the citation to a specific Zenn article on with_playwright_page
  friction. The point holds independently — the friction is widely
  observed, not unique to one writeup — and the citation gave that one
  article disproportionate authority. Replace with a direct claim
  ("the resulting nested-callback style feels disproportionate when all
  you wanted was a slightly more stable browser test").

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The "System" qualifier is redundant — system tests are the only context the
class is used in, and the class is application-scoped. Rename the example
class and the matching example file path so documentation does not push
the verbose name on readers writing their first fixture.

- ApplicationSystemFixture -> ApplicationFixture
- smartest/fixtures/application_system_fixture.rb -> smartest/fixtures/application_fixture.rb

Affects rails-browser-tests.md and smartest-vs-capybara.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@YusukeIwaki
YusukeIwaki merged commit 5320eb4 into main May 8, 2026
9 checks passed
@YusukeIwaki
YusukeIwaki deleted the docs-restructure-sidebar branch May 8, 2026 00:35

This branch was successfully deployed

1 active deployment
Preview — f1d769a8 Deployed May 8, 2026 by vercel[bot]
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