Skip to content

Moved to kebab-case formatting signup-form#16

Open
tomerqodo wants to merge 3 commits intocoderabbit_combined_20260121_qodo_grep_cursor_copilot_base_moved_to_kebab-case_formatting_signup-form_pr250from
coderabbit_combined_20260121_qodo_grep_cursor_copilot_head_moved_to_kebab-case_formatting_signup-form_pr250
Open

Moved to kebab-case formatting signup-form#16
tomerqodo wants to merge 3 commits intocoderabbit_combined_20260121_qodo_grep_cursor_copilot_base_moved_to_kebab-case_formatting_signup-form_pr250from
coderabbit_combined_20260121_qodo_grep_cursor_copilot_head_moved_to_kebab-case_formatting_signup-form_pr250

Conversation

@tomerqodo
Copy link

@tomerqodo tomerqodo commented Jan 21, 2026

Benchmark PR from qodo-benchmark#250

Summary by CodeRabbit

  • Bug Fixes

    • Email addresses are now trimmed of whitespace before submission
    • Improved error logging for URL history loading failures
  • Chores

    • Version bumped to 0.3.3
    • Added release process documentation to README

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

Walkthrough

The PR refactors the signup-form app to use kebab-case filename conventions, updating all corresponding import paths throughout the codebase. Additionally, it introduces an ESLint rule enforcing this naming convention, increments the package version, and makes minor functional adjustments to email handling and URL history logic.

Changes

Cohort / File(s) Summary
ESLint & Configuration
apps/signup-form/.eslintrc.cjs
New ESLint rule added: ghost/filenames/match-regex enforcing kebab/flat-lowercase filenames matching ^[a-z0-9.-]+$
Version & Documentation
apps/signup-form/package.json,
apps/signup-form/README.md
Version bumped from 0.3.2 to 0.3.3; README expanded with Release section documenting patch/minor/major release procedures and Ghost core integration steps
Import Path Updates (App Root)
apps/signup-form/src/index.tsx,
apps/signup-form/src/app.tsx,
apps/signup-form/.storybook/preview.tsx,
apps/signup-form/src/pages.tsx,
apps/signup-form/src/preview.stories.tsx
Updated imports to use kebab-case file paths: app.tsx, app-context, content-box, form-page, success-page
Import Path Updates (Components)
apps/signup-form/src/components/frame.tsx,
apps/signup-form/src/components/pages/form-page.tsx,
apps/signup-form/src/components/pages/form-view.tsx,
apps/signup-form/src/components/pages/form-view.stories.ts,
apps/signup-form/src/components/pages/success-page.tsx,
apps/signup-form/src/components/pages/success-view.tsx,
apps/signup-form/src/components/pages/success-view.stories.ts
Updated imports to reference kebab-case modules: iframe, form-view, success-view, app-context
Import Path Updates (Utils)
apps/signup-form/src/utils/helpers.tsx,
apps/signup-form/src/utils/options.tsx
Updated imports to use app-context instead of AppContext
Functional Changes
apps/signup-form/src/components/pages/form-page.tsx
Removed setLoading(false) call in minimal success path; now only sets success state
Functional Changes
apps/signup-form/src/components/pages/form-view.tsx
Added .trim() to email value before submission: email.trim()
Functional Changes
apps/signup-form/src/utils/helpers.tsx
getUrlHistory() now unconditionally returns getDefaultUrlHistory() result when embedded on same host (removed truthy guard); added console.warn() logging to catch blocks for failure visibility
Ghost Core Defaults
ghost/core/core/shared/config/defaults.json
Whitespace formatting adjustment only; no semantic changes

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 Files dressed in kebab, so neat and so clean,
Lowercase and dashing—the finest we've seen!
With imports aligned and rules set just right,
Our signup form shines with consistent delight! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Moved to kebab-case formatting signup-form' accurately describes the primary change in the changeset: renaming files to kebab-case conventions and enforcing this via ESLint rules.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

Copy link

@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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/signup-form/src/components/pages/form-page.tsx (1)

27-30: Reset loading state on minimal success.

In minimal mode, setLoading(true) is never cleared, so the UI can stay stuck in a loading state (Line 27–Line 30).

✅ Proposed fix
         if (minimal) {
             // Don't go to the success page, but show the success state in the form
             setSuccess(true);
+            setLoading(false);
         } else {
             setPage('SuccessPage', {
                 email
             });
         }
apps/signup-form/src/utils/helpers.tsx (1)

40-46: Avoid returning undefined URL history and skipping fallback.

getDefaultUrlHistory() can return undefined. Returning it unconditionally breaks the URLHistory contract and bypasses the fallback history construction, which can break callers expecting an array. Return only when history is present or fall back to the constructed history.

🛠️ Suggested fix
-        if (window.location.host === new URL(siteUrl).host) {
-            const history = getDefaultUrlHistory();
-            return history;
-        }
+        if (window.location.host === new URL(siteUrl).host) {
+            const history = getDefaultUrlHistory();
+            if (history && Array.isArray(history)) {
+                return history;
+            }
+            // fall through to build a minimal history entry
+        }
🧹 Nitpick comments (1)
apps/signup-form/.eslintrc.cjs (1)

18-31: Verify filename regex scope and align comment with behavior.

The regex assumes basename-only matching and allows dots/flat lowercase, which doesn’t strictly equal “kebab-case.” Please confirm ghost/filenames/match-regex matches the basename (not the full path) and decide whether to tighten the regex or update the comment for clarity.

♻️ Optional comment tweak to match current regex
-        // Enforce kebab-case (lowercase with hyphens) for all filenames
+        // Enforce lowercase filenames; hyphens and dots (extensions) allowed
         'ghost/filenames/match-regex': ['error', '^[a-z0-9.-]+$', false],
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4ebca49 and fa58658.

📒 Files selected for processing (22)
  • apps/signup-form/.eslintrc.cjs
  • apps/signup-form/.storybook/preview.tsx
  • apps/signup-form/README.md
  • apps/signup-form/package.json
  • apps/signup-form/src/app-context.ts
  • apps/signup-form/src/app.tsx
  • apps/signup-form/src/components/content-box.tsx
  • apps/signup-form/src/components/frame.tsx
  • apps/signup-form/src/components/iframe.tsx
  • apps/signup-form/src/components/pages/form-page.tsx
  • apps/signup-form/src/components/pages/form-view.stories.ts
  • apps/signup-form/src/components/pages/form-view.tsx
  • apps/signup-form/src/components/pages/success-page.tsx
  • apps/signup-form/src/components/pages/success-view.stories.ts
  • apps/signup-form/src/components/pages/success-view.tsx
  • apps/signup-form/src/index.tsx
  • apps/signup-form/src/pages.tsx
  • apps/signup-form/src/preview.stories.tsx
  • apps/signup-form/src/utils/helpers.tsx
  • apps/signup-form/src/utils/options.tsx
  • apps/signup-form/test/utils/is-test-env.js
  • ghost/core/core/shared/config/defaults.json
🔇 Additional comments (12)
ghost/core/core/shared/config/defaults.json (1)

305-305: No functional impact here.
Whitespace-only change; looks safe.

apps/signup-form/package.json (1)

3-3: Version bump looks consistent with the refactor.

apps/signup-form/.storybook/preview.tsx (1)

6-6: Import path update aligns with kebab-case rename.

apps/signup-form/src/index.tsx (1)

1-1: Import path update is consistent with the rename.

apps/signup-form/src/components/pages/form-view.tsx (2)

3-3: Import path update is consistent with kebab-case renames.


56-56: Nice touch trimming email before submit.

apps/signup-form/src/components/pages/success-view.tsx (1)

3-3: Import path update aligns with the rename.

apps/signup-form/src/components/pages/success-view.stories.ts (1)

3-3: Import casing update looks good.

Keeps module resolution consistent on case-sensitive filesystems (Line 3).

apps/signup-form/src/components/pages/success-page.tsx (1)

2-3: Import casing update looks good.

No behavioral impact; aligns with kebab-case rename (Line 2–Line 3).

apps/signup-form/README.md (1)

45-62: Release documentation addition is clear.

Nice to have explicit patch vs. minor/major steps and Ghost core update note (Line 45–Line 62).

apps/signup-form/src/components/frame.tsx (1)

1-5: Import casing update looks good.

No runtime impact; aligns with kebab-case paths (Line 1, Line 5).

apps/signup-form/src/app.tsx (1)

4-6: Import casing update looks good.

Consistent with repo-wide kebab-case migration (Line 4–Line 6).

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

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