Skip to content

QA feedback and appointment compatibility#687

Open
Akhill2020 wants to merge 4 commits into
mainfrom
reavamp/QA-feedback
Open

QA feedback and appointment compatibility#687
Akhill2020 wants to merge 4 commits into
mainfrom
reavamp/QA-feedback

Conversation

@Akhill2020
Copy link
Copy Markdown
Contributor

@Akhill2020 Akhill2020 commented May 15, 2026

Description: I have push QA feedback suggestions fixes and also push appointment compatibility fixes for welcome page% setup progress

Summary by CodeRabbit

  • New Features

    • Welcome flow now supports the Book an Appointment add-on with its own messaging and video.
  • Improvements

    • Pro/connect onboarding detection and progress logic refined to handle appointment vs Pro states.
    • Onboarding copy and button labels updated (e.g., “Continue setup →”, “Authenticate”) and capitalization tweaks.
    • Connect/Add‑Ons layout and spacing adjusted; API key badge now shows “checking” only during form submission.
  • Style

    • Various heading and card spacing refinements across admin screens.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5b4c0a43-99fe-4ab3-acf5-d30ce239941c

📥 Commits

Reviewing files that changed from the base of the PR and between befa4d8 and edf74e0.

📒 Files selected for processing (3)
  • assets/scss/connect.scss
  • includes/admin/pages/connect/partials/google-calendar-api-key-connect.php
  • includes/admin/pages/connect/steps/welcome.php
🚧 Files skipped from review as they are similar to previous changes (3)
  • includes/admin/pages/connect/partials/google-calendar-api-key-connect.php
  • includes/admin/pages/connect/steps/welcome.php
  • assets/scss/connect.scss

📝 Walkthrough

Walkthrough

The PR extends Simple Calendar's Connect onboarding to support a third welcome context type: "appointment." It adds a detection helper for the Book an Appointment add-on, updates context-determination logic to switch between core/pro/appointment flows, and adjusts UI and sidebar progress calculations accordingly.

Changes

Appointment Add-on Connect Flow

Layer / File(s) Summary
Appointment add-on detection foundation
includes/functions/admin.php
simcal_is_appointment_addon_active() added to detect the Book an Appointment add-on via constant, class checks, and plugin-activation probes; result is filterable.
Welcome context determination and controller integration
includes/functions/admin.php, includes/admin/pages/connect-controller.php
simcal_prepare_connect_sidebar_scope() now considers appointment activity when computing welcome_context. Controller normalizes $welcome_context_for_template and selects core/pro/appointment video URLs; normalized context is passed into $context.
Pro sidebar auth and progress logic
includes/admin/pages/connect/sidebar.php
Pro detection includes appointment; incoming flags are normalized to booleans; via/own auth detection combines stored health flags, runtime signals, and presence of own OAuth token; auth completion logic simplified and used for credentials progress completion.
Welcome step UI and asset usage
includes/admin/pages/connect/steps/welcome.php
Welcome step adds assets_base, selects heading/subtitle with an explicit appointment branch, builds logo URL from assets, and updates submit button label to “Continue setup →”.
Pro credentials templates and field rendering
includes/admin/pages/connect/steps/pro-credentials.php, includes/admin/pages/connect/partials/render-connect-fields.php, includes/admin/pages/connect/partials/oauth-via-simple-calendar.php
Credentials page copy and structure adjusted (headers, inline step-by-step help, labels); helper row removed; per-field field_after array safely initialized and conditional extra markup rendered; OAuth link label updated.
Connect layout, partials, and small template edits
includes/admin/pages/connect/layout.php, includes/admin/pages/connect/partials/google-calendar-api-key-connect.php, includes/admin/pages/connect/partials/helpful-links.php, includes/admin/pages/components/progress.php, includes/admin/pages.php, includes/admin/pages/add-ons.php
Header/sidebar conditional rendering tightened; API key/helpful-links labels capitalization adjusted; progress component wrapper/text updated; header-right labels removed from some settings pages; misc calendars form class added; fullcalendar add-on moved within catalog array.
Styling, design system, and admin JS tweaks
assets/scss/*, assets/js/admin.js
Added/adjusted SCSS for add-ons, connect, design-system, and misc-settings to tighten spacing and layout; admin JS moves API key "checking" badge to form submit flow.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • rosinghal

Poem

🐰 A rabbit hops through calendars bright,
Appointment flows join Pro in the light,
Detection, context, and sidebar align,
Welcome videos chosen, UI refined! ✨

🚥 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 clearly and specifically summarizes the main changes: QA feedback implementation and appointment add-on compatibility support across the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 reavamp/QA-feedback

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 PHPStan (2.1.54)

PHP Warning: require(/vendor/composer/../guzzlehttp/promises/src/functions_include.php): Failed to open stream: No such file or directory in /vendor/composer/autoload_real.php on line 39
Warning: require(/vendor/composer/../guzzlehttp/promises/src/functions_include.php): Failed to open stream: No such file or directory in /vendor/composer/autoload_real.php on line 39
PHP Fatal error: Uncaught Error: Failed opening required '/vendor/composer/../guzzlehttp/promises/src/functions_include.php' (include_path='.:/usr/share/php') in /vendor/composer/autoload_real.php:39
Stack trace:
#0 /vendor/composer/autoload_real.php(43): {closure}()
#1 /vendor/autoload.php(25): ComposerAutoloaderInit5c5d8f178617c8eed3b58686be0ffac6::getLoader()
#2 phar:///usr/bin/phpstan/bin/phpstan(46): require_once('...')
#3 phar:///usr/bin/phpstan/bin/phpstan(107): _PHPStan_c161e9ff7{closure}()
#4 /usr/bin/phpstan(7): require('...')
#5 {main}
thrown in /vendor/composer/autoload_real.php on line 39
Fatal error: Uncaught Error: Failed opening required '/vendor/composer/../guzzlehttp/promises/src/functions_include.php' (include_path='.:/usr/share/php') in /vendor/composer/autoload_real.php:39
Stack trace:
#0 /vendor/composer/autoload_real.php(43): {closure}()
#1 /vendor/autoload.php(25): ComposerAutoloaderInit5c5d8f178617c8eed3b58686be0ffac6::getLoader()
#2 phar:///usr/bin/phpstan/bin/phpstan(46): require_once('...')
#3 phar:///usr/bin/phpstan/bin/phpstan(107): _PHPStan_c161e9ff7{closure}()
#4 /usr/bin/phpstan(7): require('...')
#5 {main}
thrown in /vendor/composer/autoload_real.php on line 39


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

@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

Caution

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

⚠️ Outside diff range comments (1)
includes/functions/admin.php (1)

597-615: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Promote first-run appointment installs into the appointment context.

Line 598 defaults to core, and this block only rewrites previously saved pro/appointment values. On a fresh install with only Book an Appointment active, welcome_context stays core, then connect-controller.php normalizes that into pro, so users see the Pro welcome flow instead of the appointment-specific one.

Suggested fix
 	$welcome_context = (string) get_option('simple_calendar_connect_welcome_context', '');
 	$welcome_context = $welcome_context ? $welcome_context : 'core';
@@
-	if ('appointment' === $welcome_context && !$is_appointment_active) {
+	if ('core' === $welcome_context && $is_appointment_active && !$is_google_pro_active) {
+		$welcome_context = 'appointment';
+		update_option('simple_calendar_connect_welcome_context', $welcome_context, false);
+	} elseif ('appointment' === $welcome_context && !$is_appointment_active) {
 		$welcome_context = $is_google_pro_active ? 'pro' : 'core';
 		update_option('simple_calendar_connect_welcome_context', $welcome_context, false);
 	} elseif ('pro' === $welcome_context && !$is_google_pro_active && $is_appointment_active) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@includes/functions/admin.php` around lines 597 - 615, The current logic
defaults $welcome_context to 'core' and never promotes fresh installs where the
saved option is empty to 'appointment', causing Book an Appointment-only
installs to show the Pro flow; after computing $is_appointment_active,
$is_google_pro_active and $is_pro_active, detect a first-run (option was
empty/not set) or a default 'core' that came from no saved option and if
$is_appointment_active is true, set $welcome_context to 'appointment' and call
update_option('simple_calendar_connect_welcome_context', 'appointment', false);
keep the existing other branch checks (the elseif blocks that rewrite saved
'pro'/'appointment') intact and still use simcal_is_google_calendar_pro_active
and simcal_is_appointment_addon_active to decide availability.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@includes/admin/pages/connect/steps/welcome.php`:
- Around line 14-16: The welcome copy for the appointment flow is awkward and
contains capitalization/grammar issues; when $welcome_context === 'appointment'
update the $heading and $subtitle assignments so the heading reads "Welcome to
Simple Calendar — Book an Appointment" (correct capitalization and punctuation)
and the subtitle reads something like "You can book appointments on Google
Calendar using Simple Calendar" (fix pluralization and proper "Google Calendar"
casing). Locate the block that sets $heading and $subtitle for the 'appointment'
context and replace the current strings with the corrected versions.

---

Outside diff comments:
In `@includes/functions/admin.php`:
- Around line 597-615: The current logic defaults $welcome_context to 'core' and
never promotes fresh installs where the saved option is empty to 'appointment',
causing Book an Appointment-only installs to show the Pro flow; after computing
$is_appointment_active, $is_google_pro_active and $is_pro_active, detect a
first-run (option was empty/not set) or a default 'core' that came from no saved
option and if $is_appointment_active is true, set $welcome_context to
'appointment' and call update_option('simple_calendar_connect_welcome_context',
'appointment', false); keep the existing other branch checks (the elseif blocks
that rewrite saved 'pro'/'appointment') intact and still use
simcal_is_google_calendar_pro_active and simcal_is_appointment_addon_active to
decide availability.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: d2b43df6-86e1-42d9-9517-18758017aff7

📥 Commits

Reviewing files that changed from the base of the PR and between ef243f2 and 8075810.

📒 Files selected for processing (4)
  • includes/admin/pages/connect-controller.php
  • includes/admin/pages/connect/sidebar.php
  • includes/admin/pages/connect/steps/welcome.php
  • includes/functions/admin.php

Comment thread includes/admin/pages/connect/steps/welcome.php Outdated
Comment thread includes/admin/pages/connect/steps/welcome.php Outdated
Copy link
Copy Markdown

@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 (1)
includes/admin/pages/connect/steps/welcome.php (1)

81-81: ⚡ Quick win

Include the arrow in the translatable string.

The arrow is concatenated outside the __() call, which can cause layout issues in RTL languages and prevents translators from adjusting punctuation.

Proposed fix
-					<?php echo esc_html(__('Continue setup', 'google-calendar-events') . ' →'); ?>
+					<?php echo esc_html__('Continue setup →', 'google-calendar-events'); ?>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@includes/admin/pages/connect/steps/welcome.php` at line 81, The concatenated
arrow should be part of the translatable string so translators can move or
remove it; update the call that renders esc_html(__('Continue setup',
'google-calendar-events') . ' →') to pass the arrow inside the translation
function (e.g., __('Continue setup →', 'google-calendar-events')) and then
escape and echo that result using esc_html; ensure you only modify the string
passed to __() and leave esc_html/echo intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@includes/admin/pages/connect/steps/welcome.php`:
- Around line 16-20: Update the welcome copy by fixing title capitalization in
the $heading (change "Book An Appointment" to "Book an Appointment") and replace
the overly long $subtitle with a shorter, clearer line; edit the $subtitle
assignment to something concise like "Enable real-time Google Calendar bookings
and automatically block booked time slots to prevent double bookings" to improve
readability on the welcome screen (update the strings where $heading and
$subtitle are defined).

---

Nitpick comments:
In `@includes/admin/pages/connect/steps/welcome.php`:
- Line 81: The concatenated arrow should be part of the translatable string so
translators can move or remove it; update the call that renders
esc_html(__('Continue setup', 'google-calendar-events') . ' →') to pass the
arrow inside the translation function (e.g., __('Continue setup →',
'google-calendar-events')) and then escape and echo that result using esc_html;
ensure you only modify the string passed to __() and leave esc_html/echo intact.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: fc00c8cd-3177-43f1-92b9-c69b9d77de97

📥 Commits

Reviewing files that changed from the base of the PR and between 8075810 and befa4d8.

📒 Files selected for processing (17)
  • assets/js/admin.js
  • assets/scss/add-ons.scss
  • assets/scss/connect.scss
  • assets/scss/design-system.scss
  • assets/scss/misc-settings.scss
  • includes/admin/pages.php
  • includes/admin/pages/add-ons.php
  • includes/admin/pages/components/progress.php
  • includes/admin/pages/connect/layout.php
  • includes/admin/pages/connect/partials/google-calendar-api-key-connect.php
  • includes/admin/pages/connect/partials/helpful-links.php
  • includes/admin/pages/connect/partials/oauth-via-simple-calendar.php
  • includes/admin/pages/connect/partials/render-connect-fields.php
  • includes/admin/pages/connect/sidebar.php
  • includes/admin/pages/connect/steps/pro-credentials.php
  • includes/admin/pages/connect/steps/welcome.php
  • includes/post-types.php
✅ Files skipped from review due to trivial changes (7)
  • includes/admin/pages/connect/partials/helpful-links.php
  • includes/post-types.php
  • includes/admin/pages/connect/partials/oauth-via-simple-calendar.php
  • includes/admin/pages/connect/partials/google-calendar-api-key-connect.php
  • includes/admin/pages.php
  • assets/scss/add-ons.scss
  • includes/admin/pages/add-ons.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • includes/admin/pages/connect/sidebar.php

Comment on lines +16 to +20
$heading = __('Welcome to Book An Appointment', 'google-calendar-events');
$subtitle = __(
'Explore the Simple Calendar addon that allows Google Calendar appointment bookings directly from your website in real-time, while automatically blocking booked time slots to prevent double bookings.',
'google-calendar-events',
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Polish the appointment welcome copy before shipping.

The appointment heading uses inconsistent title-case ("Book An Appointment" should be "Book an Appointment"), and the subtitle is unusually long for a welcome screen—consider tightening it for better readability.

Suggested copy refinement
-	$heading = __('Welcome to Book An Appointment', 'google-calendar-events');
+	$heading = __('Welcome to Book an Appointment', 'google-calendar-events');
 	$subtitle = __(
-		'Explore the Simple Calendar addon that allows Google Calendar appointment bookings directly from your website in real-time, while automatically blocking booked time slots to prevent double bookings.',
+		'Let visitors book appointments in Google Calendar directly from your website, with automatic time-slot blocking to prevent double bookings.',
 		'google-calendar-events',
 	);
📝 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
$heading = __('Welcome to Book An Appointment', 'google-calendar-events');
$subtitle = __(
'Explore the Simple Calendar addon that allows Google Calendar appointment bookings directly from your website in real-time, while automatically blocking booked time slots to prevent double bookings.',
'google-calendar-events',
);
$heading = __('Welcome to Book an Appointment', 'google-calendar-events');
$subtitle = __(
'Let visitors book appointments in Google Calendar directly from your website, with automatic time-slot blocking to prevent double bookings.',
'google-calendar-events',
);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@includes/admin/pages/connect/steps/welcome.php` around lines 16 - 20, Update
the welcome copy by fixing title capitalization in the $heading (change "Book An
Appointment" to "Book an Appointment") and replace the overly long $subtitle
with a shorter, clearer line; edit the $subtitle assignment to something concise
like "Enable real-time Google Calendar bookings and automatically block booked
time slots to prevent double bookings" to improve readability on the welcome
screen (update the strings where $heading and $subtitle are defined).

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