Skip to content

Comments

Moved to kebab-case formatting signup-form#43

Open
tomerqodo wants to merge 3 commits intocoderabbit_full_base_moved_to_kebab-case_formatting_signup-form_pr5from
coderabbit_full_head_moved_to_kebab-case_formatting_signup-form_pr5
Open

Moved to kebab-case formatting signup-form#43
tomerqodo wants to merge 3 commits intocoderabbit_full_base_moved_to_kebab-case_formatting_signup-form_pr5from
coderabbit_full_head_moved_to_kebab-case_formatting_signup-form_pr5

Conversation

@tomerqodo
Copy link

@tomerqodo tomerqodo commented Jan 28, 2026

Benchmark PR from agentic-review-benchmarks#5

Summary by CodeRabbit

Release Notes

  • New Features

    • Email input is now trimmed before submission for improved data quality
    • Enhanced error handling with improved logging during history operations
  • Documentation

    • Added comprehensive release guidelines for patch, minor, and major releases
  • Chores

    • Version bumped to 0.3.3
    • Code organization improvements

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 28, 2026

Walkthrough

This pull request standardizes file naming conventions across the signup-form application by converting filenames from PascalCase to lowercase-hyphenated format (kebab-case), updates all corresponding import paths throughout the codebase, adds ESLint rules to enforce this convention, includes minor logic adjustments for email handling and loading states, and extends the URLHistory type with an optional path field.

Changes

Cohort / File(s) Summary
ESLint Configuration
apps/signup-form/.eslintrc.cjs
Added ghost/filenames/match-regex ESLint rule to enforce lowercase filenames with characters [a-z0-9.-]. Minor capitalization adjustment in import sorting comment.
Package & Build Configuration
apps/signup-form/package.json
apps/signup-form/.storybook/preview.tsx
Version bump from 0.3.2 to 0.3.3. Updated import path for AppContext to app-context following new naming convention.
Main Application Entry Points
apps/signup-form/src/index.tsx
apps/signup-form/src/app.tsx
apps/signup-form/src/pages.tsx
Updated all import paths to reflect lowercase-hyphenated filenames: App.tsxapp.tsx, AppContextapp-context, ContentBoxcontent-box, Frameframe, FormPageform-page, SuccessPagesuccess-page.
Component Files
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/success-page.tsx
apps/signup-form/src/components/pages/success-view.tsx
Updated import paths across all components to use lowercase-hyphenated naming. Removed setLoading(false) call in form-page minimal success path (behavioral change). Added .trim() to email submission payload in form-view.
Storybook Story Files
apps/signup-form/src/components/pages/form-view.stories.ts
apps/signup-form/src/components/pages/success-view.stories.ts
apps/signup-form/src/preview.stories.tsx
Updated import paths to reference lowercase-hyphenated component filenames and AppContext module location.
Utility Files
apps/signup-form/src/utils/helpers.tsx
apps/signup-form/src/utils/options.tsx
Updated AppContext import paths to app-context. Extended URLHistory type with optional path?: string field. Enhanced error handling with console warnings when history loading fails. Switched string literal style for STORAGE_KEY from single to double quotes.
Documentation & Schema
apps/signup-form/README.md
ghost/core/core/shared/config/defaults.json
Added "Release" section to README documenting patch/minor/major release procedures with yarn ship and post-release steps. Removed unnecessary whitespace in JSON formatting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Files dressed in lowercase, hyphens so neat,
Naming conventions make the codebase complete!
From PascalCase to kebab, a tidy refrain,
With email trimmed fresh and logic reclaimed,
This signup form hopping to better terrain! 🌟

🚥 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 directly reflects the main change: a refactoring to kebab-case naming conventions across the signup-form application.

✏️ 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: 2

Caution

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

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

27-30: Clear loading state in minimal success path.

In minimal mode, loading stays true after success, leaving the form in a perpetual loading state.

🐛 Proposed fix
         if (minimal) {
             // Don't go to the success page, but show the success state in the form
+            setLoading(false);
             setSuccess(true);
         } else {
             setPage('SuccessPage', {
                 email
             });
🤖 Fix all issues with AI agents
In `@apps/signup-form/README.md`:
- Line 62: The README sentence ending with "core/shared/config/default.json" is
truncated; complete the sentence to state the exact action and context (e.g.,
"To use the new version of the signup form in Ghost, update the signup form
version value in Ghost core's default configuration file at
core/shared/config/default.json and restart Ghost."). Also ensure proper
punctuation and, if helpful, wrap the file path in code formatting (backticks)
and add a brief example config key (e.g., "signupForm.version") or a pointer to
the config section so readers know what to change.

In `@apps/signup-form/src/utils/helpers.tsx`:
- Around line 44-46: getUrlHistory currently returns the raw value from
getDefaultUrlHistory which can be undefined, violating its declared URLHistory
return type; update getUrlHistory to guard the result of getDefaultUrlHistory
(call getDefaultUrlHistory() inside getUrlHistory) and return an empty array
fallback when the result is falsy or not an array so the function always returns
a URLHistory; reference getUrlHistory and getDefaultUrlHistory to locate and
change the return path.
🧹 Nitpick comments (2)
apps/signup-form/README.md (1)

46-60: Consider clarifying the post-release step for patch releases.

The post-release step to update Ghost core's default.json is only mentioned under the minor/major section (line 62), but patch releases would also require this update to take effect in Ghost. Consider either:

  1. Moving this note to a shared "Post-release" section applicable to all release types, or
  2. Adding this step explicitly under the patch release section as well.
apps/signup-form/src/utils/helpers.tsx (1)

20-20: Minor: Quote style inconsistency with related files.

The STORAGE_KEY now uses double quotes, but related files in the codebase (apps/portal/src/utils/helpers.js and ghost/core/core/frontend/src/member-attribution/member-attribution.js) use single quotes for the same constant. This is a minor consistency concern and may be governed by ESLint rules.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66745e8 and 9b8f32c.

📒 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 context used
🧬 Code graph analysis (1)
apps/signup-form/src/utils/helpers.tsx (2)
ghost/core/core/frontend/src/member-attribution/member-attribution.js (2)
  • STORAGE_KEY (8-8)
  • history (43-43)
apps/portal/src/utils/helpers.js (1)
  • STORAGE_KEY (895-895)
🔇 Additional comments (17)
ghost/core/core/shared/config/defaults.json (1)

305-305: LGTM: Formatting consistency improved.

Removing the space before the colon aligns this key with standard JSON formatting and matches the rest of the file's style.

apps/signup-form/.eslintrc.cjs (1)

23-25: Filename regex aligns with the kebab‑case goal.

Looks good and still permits dotfiles/extensions as needed.

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

6-6: Import path update is correct and complete.

The import path has been successfully updated to reflect the kebab-case naming convention (app-context), and both AppContextProvider and AppContextType are properly exported from the new file. No lingering references to the old path remain in the codebase.

apps/signup-form/src/utils/options.tsx (1)

2-2: LGTM!

The import path update from '../AppContext' to '../app-context' correctly reflects the kebab-case file renaming convention applied across the project.

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

3-3: LGTM!

Patch version bump to 0.3.3 is appropriate for this non-breaking refactor that renames files to kebab-case.

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

1-5: LGTM!

Import paths correctly updated to reflect kebab-case file naming:

  • './IFrame''./iframe'
  • '../AppContext''../app-context'
apps/signup-form/src/components/pages/success-view.tsx (1)

3-3: LGTM!

Import path correctly updated from '../../AppContext' to '../../app-context' to match the kebab-case naming convention.

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

3-3: LGTM!

Import path correctly updated from './SuccessView' to './success-view' to match the kebab-case file naming convention.

apps/signup-form/src/preview.stories.tsx (1)

4-5: LGTM!

Import paths correctly updated to reflect kebab-case file naming:

  • './AppContext''./app-context'
  • './components/ContentBox''./components/content-box'
apps/signup-form/src/app.tsx (1)

4-6: LGTM!

The import paths have been correctly updated to use kebab-case formatting (app-context, content-box, frame), consistent with the PR's file renaming convention.

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

1-1: LGTM!

The import path has been correctly updated to reference the renamed app.tsx file.

apps/signup-form/src/utils/helpers.tsx (1)

1-1: LGTM!

Import path correctly updated to kebab-case convention.

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

3-3: LGTM!

Import path correctly updated to kebab-case convention.


54-57: Good addition: Trimming email input.

Trimming the email before submission is a sensible improvement that prevents accidental whitespace from causing validation failures or storing malformed email addresses.

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

3-3: LGTM!

Import path correctly updated to reference the renamed form-view module.

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

2-3: Kebab-case import update looks good.

Aligns with the renamed module paths; no behavioral impact.

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

2-3: Import path normalization looks good.

Matches the new kebab-case module naming.

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

2. Merge the release commit to `main`
3. Wait until a new version of Ghost is released

To use the new version of signup form in Ghost, update the version in Ghost core's default configuration (currently at `core/shared/config/default.json`)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Documentation appears truncated.

Line 62 ends abruptly with a file path reference but no closing context. Consider completing the sentence or adding proper formatting:

-To use the new version of signup form in Ghost, update the version in Ghost core's default configuration (currently at `core/shared/config/default.json`)
+To use the new version of signup form in Ghost, update the version in Ghost core's default configuration (currently at `core/shared/config/default.json`).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
To use the new version of signup form in Ghost, update the version in Ghost core's default configuration (currently at `core/shared/config/default.json`)
To use the new version of signup form in Ghost, update the version in Ghost core's default configuration (currently at `core/shared/config/default.json`).
🤖 Prompt for AI Agents
In `@apps/signup-form/README.md` at line 62, The README sentence ending with
"core/shared/config/default.json" is truncated; complete the sentence to state
the exact action and context (e.g., "To use the new version of the signup form
in Ghost, update the signup form version value in Ghost core's default
configuration file at core/shared/config/default.json and restart Ghost."). Also
ensure proper punctuation and, if helpful, wrap the file path in code formatting
(backticks) and add a brief example config key (e.g., "signupForm.version") or a
pointer to the config section so readers know what to change.

Comment on lines 44 to 46
const history = getDefaultUrlHistory();
if (history) {
return history;
}
return history;
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Potential undefined return when history is not found.

getDefaultUrlHistory() can return undefined (when sessionStorage is empty or on error), but getUrlHistory has a return type of URLHistory (an array). This change removes any guard and directly returns the potentially undefined value.

Consider adding a fallback to return an empty array:

Suggested fix
         if (window.location.host === new URL(siteUrl).host) {
             const history = getDefaultUrlHistory();
-            return history;
+            return history ?? [];
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const history = getDefaultUrlHistory();
if (history) {
return history;
}
return history;
}
if (window.location.host === new URL(siteUrl).host) {
const history = getDefaultUrlHistory();
return history ?? [];
}
🤖 Prompt for AI Agents
In `@apps/signup-form/src/utils/helpers.tsx` around lines 44 - 46, getUrlHistory
currently returns the raw value from getDefaultUrlHistory which can be
undefined, violating its declared URLHistory return type; update getUrlHistory
to guard the result of getDefaultUrlHistory (call getDefaultUrlHistory() inside
getUrlHistory) and return an empty array fallback when the result is falsy or
not an array so the function always returns a URLHistory; reference
getUrlHistory and getDefaultUrlHistory to locate and change the return path.

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