Skip to content

fix: make tab bar horizontally scrollable on mobile#66

Merged
nitrocode merged 4 commits into
mainfrom
copilot/fix-mobile-tabs-visibility
Apr 26, 2026
Merged

fix: make tab bar horizontally scrollable on mobile#66
nitrocode merged 4 commits into
mainfrom
copilot/fix-mobile-tabs-visibility

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 24, 2026

  • Merge latest main (c9d8857 — Node.js v22 update for .nvmrc + all 4 workflow files) — no file conflicts
  • Fix docs/prd/bundler.md line 94: ^0.28.00.28.0 (match actual package.json)
  • Fix docs/prd/bundler.md line 99: "six" → "five" build steps (matches build script in package.json)
  • Remove globalName: undefined from scripts/build-js.js esbuild.transformSync call
  • Run npm run build:js — script.js rebuilt successfully
  • Run npm run test:ci — 253 unit tests pass, 100% coverage

Summary by CodeRabbit

  • New Features

    • Tab bar now supports horizontal scrolling on mobile and narrow viewports with touch-friendly scrolling enabled.
  • Bug Fixes

    • Tab buttons no longer compress or wrap on mobile devices.
    • Cross-browser scrollbar handling improved.
  • Tests

    • Added mobile viewport tests for tab bar functionality.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a1e87395-72db-4d04-b5f2-aeee6a80a532

📥 Commits

Reviewing files that changed from the base of the PR and between 7cf0f3b and 62c5def.

📒 Files selected for processing (2)
  • docs/prd/bundler.md
  • scripts/build-js.js
💤 Files with no reviewable changes (1)
  • scripts/build-js.js
✅ Files skipped from review due to trivial changes (1)
  • docs/prd/bundler.md

📝 Walkthrough

Walkthrough

Listen here, fool! This PR makes some righteous changes to get that tab bar scrolling smooth on mobile viewports, adds some E2E tests to verify the behavior, trims down some build configuration, and updates the documentation. I pity the fool who don't appreciate mobile optimization, sucka!

Changes

Cohort / File(s) Summary
Mobile Tab Scrolling Styles
styles.css, styles/hero-tabs.css
Enables horizontal overflow scrolling on .tab-bar with touch-friendly behavior and hidden scrollbars. Adds flex-shrink: 0 and white-space: nowrap to .tab-btn to prevent wrapping. Mobile breakpoint adjusts padding and sizing for narrower viewports.
Mobile E2E Tests
tests/e2e/death-clock.spec.js
Introduces Playwright test suite validating 375px mobile viewport behavior, confirming all four tab buttons exist, tab bar has overflow, and clicking tabs activates corresponding panels.
Build Script Configuration
scripts/build-js.js
Removes globalName: undefined option from esbuild.transformSync minification call while preserving all other minification behavior and comment preservation.
Documentation Update
docs/prd/bundler.md
Updates esbuild dependency version pin from caret range to exact 0.28.0 and corrects build step count from six to five in the bundler PRD description.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Listen here, fool! You got yourself multiple file changes across different domains—styling modifications that repeat across two files, new test logic with specific assertions, documentation tweaks, and build script adjustments. I pity the fool who tries to review this without paying attention to both the CSS consistency and the test verification details, sucka! The changes ain't overly complex, but they span enough variety to demand separate consideration for each cohort.

Possibly related PRs

  • PR #61: This PR's removal of the globalName option directly modifies the same esbuild.transformSync minification call that was introduced or modified in that PR, sucka!

Suggested reviewers

  • nitrocode
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: make tab bar horizontally scrollable on mobile' directly and accurately summarizes the main change: adding horizontal scrolling to the tab bar on mobile viewports.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch copilot/fix-mobile-tabs-visibility

Comment @coderabbitai help to get the list of available commands and usage tips.

@nitrocode
Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

@nitrocode nitrocode marked this pull request as ready for review April 24, 2026 12:43
@nitrocode nitrocode self-requested a review as a code owner April 24, 2026 12:43
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 24, 2026

@copilot resolve the merge conflicts in this pull request

Done — merged main into this branch in commit 7cf0f3b. The only conflict was in the auto-generated styles.css (main had switched to esbuild minification), which was resolved by rebuilding it from the source files after the merge. All 253 unit tests still pass.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/e2e/death-clock.spec.js (1)

319-331: Add dashboard to the activation-flow loop.

Line 320 currently skips clicking dashboard, so the “each tab activates its panel” flow is only partially covered.

♻️ Suggested test hardening
-  test('each tab button is clickable and activates the correct panel', async ({ page }) => {
-    const tabs = [
-      { btn: '#tab-btn-news',      panel: '#tab-news' },
-      { btn: '#tab-btn-about',     panel: '#tab-about' },
-      { btn: '#tab-btn-changelog', panel: '#tab-changelog' },
-    ];
-    for (const { btn, panel } of tabs) {
-      // Scroll the button into view inside the tab bar before clicking
-      await page.locator(btn).scrollIntoViewIfNeeded();
-      await page.locator(btn).click();
-      await expect(page.locator(panel)).not.toHaveAttribute('hidden', /.*/);
-    }
-  });
+  test('each tab button is clickable and activates the correct panel', async ({ page }) => {
+    const tabs = ['dashboard', 'news', 'about', 'changelog'];
+    for (const tab of tabs) {
+      const btn = page.locator(`#tab-btn-${tab}`);
+      await btn.scrollIntoViewIfNeeded();
+      await btn.click();
+      const panelId = await btn.getAttribute('aria-controls');
+      expect(panelId).toBeTruthy();
+      await expect(page.locator(`#${panelId}`)).not.toHaveAttribute('hidden', /.*/);
+    }
+  });

Based on learnings, "Applies to tests/e2e/death-clock.spec.js : E2E tests in tests/e2e/death-clock.spec.js must validate DOM behaviour and visual flows; add E2E assertions when modifying script.js or index.html".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/e2e/death-clock.spec.js` around lines 319 - 331, The test's tabs array
omits the dashboard tab so the activation loop in test('each tab button is
clickable and activates the correct panel', ...) doesn't verify dashboard
behavior; add an entry for the dashboard (e.g. { btn: '#tab-btn-dashboard',
panel: '#tab-dashboard' }) to the tabs array used by the loop, keep the existing
scrollIntoViewIfNeeded/click/assert sequence, and ensure the test continues to
use the same btn and panel variables so the loop covers all tab activation
flows.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tests/e2e/death-clock.spec.js`:
- Around line 319-331: The test's tabs array omits the dashboard tab so the
activation loop in test('each tab button is clickable and activates the correct
panel', ...) doesn't verify dashboard behavior; add an entry for the dashboard
(e.g. { btn: '#tab-btn-dashboard', panel: '#tab-dashboard' }) to the tabs array
used by the loop, keep the existing scrollIntoViewIfNeeded/click/assert
sequence, and ensure the test continues to use the same btn and panel variables
so the loop covers all tab activation flows.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 514518f4-a84a-49e4-a91c-197f820c207a

📥 Commits

Reviewing files that changed from the base of the PR and between d301ba1 and abe24f3.

📒 Files selected for processing (3)
  • styles.css
  • styles/hero-tabs.css
  • tests/e2e/death-clock.spec.js

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
scripts/build-js.js (1)

80-90: Yo fool, this esbuild implementation is solid!

I pity the fool who doesn't appreciate clean minification code! The transformSync usage is correct, sucka. But listen here — that globalName: undefined on line 84 is redundant, fool! undefined is already the default value. You can drop that line and the code still works the same.

💪 Mr. T's clean-up suggestion
 const result = esbuild.transformSync(unminified, {
   minify:       true,
-  // Keep the IIFE wrapper intact; tell esbuild the code is already IIFE-wrapped.
-  globalName:   undefined,
   // Preserve the leading banner comment so tools can still identify the file.
   banner:       '/* AI DEATH CLOCK — browser/DOM layer (minified) */',
   // Target all modern browsers; no transpilation needed.
   target:       ['es2018'],
   loader:       'js',
 });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/build-js.js` around lines 80 - 90, The esbuild.transformSync call
includes an unnecessary option assignment; remove the redundant globalName:
undefined property from the options object passed to esbuild.transformSync (the
code around the esbuild.transformSync(...) invocation and its option keys like
minify, banner, target, loader) so the behavior remains identical while cleaning
up the config.
docs/prd/bundler.md (1)

94-94: Minor inconsistency with the version spec, fool!

The PRD says ^0.28.0 but package.json pins to exact 0.28.0 without the caret. This ain't a big deal since the PRD is a planning doc and the implementation is what matters, but you might wanna update this to match reality, sucka!

✏️ Proposed alignment
-1. **`esbuild` devDependency** added (`^0.28.0`).
+1. **`esbuild` devDependency** added (`0.28.0`).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/prd/bundler.md` at line 94, Update the PRD entry that currently lists
the esbuild devDependency as `^0.28.0` to match the actual implementation by
changing it to `0.28.0` (or alternatively update package.json to `^0.28.0` if
you prefer caret behavior); edit the PRD text where the esbuild devDependency is
declared so the version spec in the document matches the package.json, ensuring
consistency between the planning doc and implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/prd/bundler.md`:
- Around line 99-100: The PRD claim that the `build` script runs "all six build
steps" is wrong — the `package.json` `build` script only chains five tasks
(`build:milestones`, `build:changelog`, `build:project-stats`, `build:js`,
`build:css`), so update the text in bundler.md to say it runs five build steps
(or if a sixth task was intended, add the missing script to `package.json` and
include its name); reference the `build` script in package.json and the sentence
in docs/prd/bundler.md that currently says "all six build steps" and make the
wording consistent with the actual `build` chain.

---

Nitpick comments:
In `@docs/prd/bundler.md`:
- Line 94: Update the PRD entry that currently lists the esbuild devDependency
as `^0.28.0` to match the actual implementation by changing it to `0.28.0` (or
alternatively update package.json to `^0.28.0` if you prefer caret behavior);
edit the PRD text where the esbuild devDependency is declared so the version
spec in the document matches the package.json, ensuring consistency between the
planning doc and implementation.

In `@scripts/build-js.js`:
- Around line 80-90: The esbuild.transformSync call includes an unnecessary
option assignment; remove the redundant globalName: undefined property from the
options object passed to esbuild.transformSync (the code around the
esbuild.transformSync(...) invocation and its option keys like minify, banner,
target, loader) so the behavior remains identical while cleaning up the config.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e672a99-3eb8-4525-a465-a993d8bb8557

📥 Commits

Reviewing files that changed from the base of the PR and between abe24f3 and 7cf0f3b.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • .github/workflows/e2e-tests.yml
  • .github/workflows/unit-tests.yml
  • AGENTS.md
  • CLAUDE.md
  • docs/prd/README.md
  • docs/prd/bundler.md
  • package.json
  • renovate.json
  • script.js
  • scripts/build-css.js
  • scripts/build-js.js
  • styles.css
✅ Files skipped from review due to trivial changes (5)
  • CLAUDE.md
  • renovate.json
  • docs/prd/README.md
  • .github/workflows/unit-tests.yml
  • .github/workflows/e2e-tests.yml

Comment thread docs/prd/bundler.md Outdated
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
…edundant globalName from build-js.js

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Copilot AI requested a review from nitrocode April 25, 2026 12:31
@github-actions
Copy link
Copy Markdown
Contributor

👁️ PR Preview

🚀 Open Preview

Deployed from commit 62c5def · Updates on every push to this PR
(Preview is removed automatically when the PR is closed.)

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9176c88) to head (62c5def).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #66   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          233       233           
  Branches       107       107           
=========================================
  Hits           233       233           
Flag Coverage Δ
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9d8857...62c5def. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nitrocode nitrocode merged commit f8578c3 into main Apr 26, 2026
10 checks passed
@nitrocode nitrocode deleted the copilot/fix-mobile-tabs-visibility branch April 26, 2026 03:15
github-actions Bot added a commit that referenced this pull request Apr 26, 2026
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