Skip to content

feat: add sync to google sheet button for mobile#8876

Merged
Ur-imazing merged 12 commits intomainfrom
urimchae/nes-1428-sync-to-google-option-missing-on-mobile-view
Mar 23, 2026
Merged

feat: add sync to google sheet button for mobile#8876
Ur-imazing merged 12 commits intomainfrom
urimchae/nes-1428-sync-to-google-option-missing-on-mobile-view

Conversation

@Ur-imazing
Copy link
Copy Markdown
Contributor

@Ur-imazing Ur-imazing commented Mar 19, 2026

Summary by CodeRabbit

  • New Features

    • Added a Google Sheets sync button on the visitors page with accessibility text and permission-aware disabling; page supports opening a Google Sheets sync dialog (including via URL) and shows success/error notifications.
  • Tests

    • Added/updated tests for the sync button (click, disabled state, tooltip) and adjusted dialog-trigger tests.
  • Refactor

    • Dialog control moved out of internal state to be externally driven.
  • Breaking Changes

    • FilterDrawer API changed: removed teamId prop; added onSyncDialogOpen callback.

@Ur-imazing Ur-imazing self-assigned this Mar 19, 2026
@Ur-imazing Ur-imazing added effort: 2 type: fix Iterations on existing features or infrastructure. priority: soon Bug labels Mar 19, 2026
@linear
Copy link
Copy Markdown

linear Bot commented Mar 19, 2026

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 19, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Visitors report page now handles Google integration creation and opens a Google Sheets sync dialog; FilterDrawer no longer manages sync state and exposes an onSyncDialogOpen callback. A new GoogleSheetsSyncButton component and tests were added; one localization entry was moved.

Changes

Cohort / File(s) Summary
Visitors page: integration & dialog
apps/journeys-admin/pages/journeys/[journeyId]/reports/visitors.tsx
Adds Google integration creation via useIntegrationGoogleCreate, snackbar success/error handling, local showSyncsDialog state, GoogleSheetsSyncDialog, GoogleSheetsSyncButton in header, and URL-driven dialog opening logic.
FilterDrawer component API & tests
apps/journeys-admin/src/components/JourneyVisitorsList/FilterDrawer/FilterDrawer.tsx, apps/journeys-admin/src/components/JourneyVisitorsList/FilterDrawer/FilterDrawer.spec.tsx
Removes internal Google integration/dialog logic and teamId prop; adds onSyncDialogOpen?: () => void prop and invokes it from the Sync button. Tests updated to assert the callback and drop teamId usage.
Google Sheets sync UI
apps/journeys-admin/src/components/JourneyVisitorsList/GoogleSheetsSyncButton/GoogleSheetsSyncButton.tsx, apps/journeys-admin/src/components/JourneyVisitorsList/GoogleSheetsSyncButton/GoogleSheetsSyncButton.spec.tsx, apps/journeys-admin/src/components/JourneyVisitorsList/GoogleSheetsSyncButton/index.ts
Adds GoogleSheetsSyncButton component with enabled/disabled states, tooltip/aria labeling, click handler; adds tests and re-export index.
Localization tweak
libs/locales/en/apps-journeys-admin.json
Moves the "Google integration created successfully" translation entry within the file (no string change).

Sequence Diagram(s)

sequenceDiagram
participant User
participant VisitorsPage as "Visitors Page"
participant IntegrationAPI as "Integration API"
participant SyncDialog as "GoogleSheetsSyncDialog"
participant Snackbar

User->>VisitorsPage: Click "Sync to Google Sheets"
VisitorsPage->>IntegrationAPI: Start Google integration (OAuth)
IntegrationAPI-->>VisitorsPage: success / error
alt success
VisitorsPage->>Snackbar: show success message
VisitorsPage->>SyncDialog: open
else error
VisitorsPage->>Snackbar: show error message
end
User->>SyncDialog: perform sync actions
SyncDialog-->>VisitorsPage: close
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 accurately summarizes the main change: adding a sync to Google Sheets button specifically for mobile view, which aligns with the primary objective of the PR.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch urimchae/nes-1428-sync-to-google-option-missing-on-mobile-view

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.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Mar 19, 2026

View your CI Pipeline Execution ↗ for commit fb7bf34

Command Status Duration Result
nx run videos-admin-e2e:e2e ✅ Succeeded 7s View ↗
nx run watch-modern-e2e:e2e ✅ Succeeded 5s View ↗
nx run journeys-admin-e2e:e2e ✅ Succeeded 28s View ↗
nx run journeys-e2e:e2e ✅ Succeeded 23s View ↗
nx run watch-e2e:e2e ✅ Succeeded 22s View ↗
nx run resources-e2e:e2e ✅ Succeeded 23s View ↗
nx run player-e2e:e2e ✅ Succeeded 4s View ↗
nx run-many --target=vercel-alias --projects=jo... ✅ Succeeded 2s View ↗
Additional runs (20) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-03-23 20:29:25 UTC

@Ur-imazing Ur-imazing requested a review from edmonday March 19, 2026 01:04
@github-actions github-actions Bot requested a deployment to Preview - journeys-admin March 19, 2026 01:05 Pending
@Ur-imazing
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 19, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions github-actions Bot temporarily deployed to Preview - videos-admin March 19, 2026 01:09 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch March 19, 2026 01:09 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin March 19, 2026 01:09 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys March 19, 2026 01:09 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch-modern March 19, 2026 01:09 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources March 19, 2026 01:10 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - player March 19, 2026 01:10 Inactive
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 19, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
player ✅ Ready player preview Tue Mar 24 09:21:43 NZDT 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 19, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch-modern ✅ Ready watch-modern preview Tue Mar 24 09:21:48 NZDT 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 19, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Tue Mar 24 09:22:01 NZDT 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 19, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
resources ✅ Ready resources preview Tue Mar 24 09:22:05 NZDT 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 19, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch ✅ Ready watch preview Tue Mar 24 09:22:01 NZDT 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 19, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Tue Mar 24 09:21:50 NZDT 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 19, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Tue Mar 24 09:24:32 NZDT 2026

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 (3)
apps/journeys-admin/src/components/JourneyVisitorsList/FilterDrawer/FilterDrawer.tsx (2)

82-84: Pre-existing: onClick should be on IconButton, not X2Icon.

The click handler is placed on the icon rather than the button. While this works, it's inconsistent with MUI patterns and may have accessibility implications. Consider moving it to the IconButton.

♻️ Suggested fix
-          <IconButton sx={{ ml: 'auto' }}>
-            <X2Icon onClick={handleClose} />
+          <IconButton sx={{ ml: 'auto' }} onClick={handleClose} aria-label={t('Close')}>
+            <X2Icon />
           </IconButton>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/journeys-admin/src/components/JourneyVisitorsList/FilterDrawer/FilterDrawer.tsx`
around lines 82 - 84, The onClick handler is currently assigned to X2Icon
instead of the parent IconButton; move the click handler to the IconButton
(i.e., add onClick={handleClose} to IconButton and remove onClick from X2Icon)
and ensure IconButton includes an appropriate aria-label for accessibility;
update the JSX using IconButton, X2Icon, and handleClose accordingly.

181-189: Consider adding a guard for onSyncDialogOpen when enabled.

When disableExportButton is false and onSyncDialogOpen is undefined, clicking the button does nothing silently. Consider making the prop required or adding defensive handling.

Additionally, the Sync button lacks the Tooltip treatment that the Export button has when disabled (lines 190-221), creating an inconsistent UX.

♻️ Consider consistent disabled state handling

If you want consistent tooltip behavior for both buttons when disabled:

+          {disableExportButton ? (
+            <Tooltip
+              title={t(
+                'Only team members and journey owners can export data.'
+              )}
+              placement="top"
+            >
+              <span>
+                <Button
+                  variant="contained"
+                  color="secondary"
+                  sx={{ width: '100%', mb: 2 }}
+                  disabled
+                >
+                  {t('Sync to Google Sheets')}
+                </Button>
+              </span>
+            </Tooltip>
+          ) : (
             <Button
               variant="contained"
               color="secondary"
               sx={{ width: '100%', mb: 2 }}
               onClick={onSyncDialogOpen}
-              disabled={disableExportButton}
             >
               {t('Sync to Google Sheets')}
             </Button>
+          )}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/journeys-admin/src/components/JourneyVisitorsList/FilterDrawer/FilterDrawer.tsx`
around lines 181 - 189, The Sync button currently calls onSyncDialogOpen
directly and shows no tooltip when disabled, so add defensive handling: ensure
onSyncDialogOpen is either required or provide a safe no-op fallback (e.g.,
check if onSyncDialogOpen is defined before invoking inside the Button's onClick
or default the prop to () => {}), and wrap the Sync Button with the same Tooltip
behavior used by the Export button when disableExportButton is true so disabled
state UX is consistent; update references to the Button rendering in
FilterDrawer (the Sync Button), the onSyncDialogOpen prop, and the
disableExportButton usage accordingly.
apps/journeys-admin/src/components/JourneyVisitorsList/GoogleSheetsSyncButton/GoogleSheetsSyncButton.tsx (1)

30-36: Remove onClick handler from the disabled button.

The onClick={onSyncClick} is assigned to the disabled IconButton. While MUI's disabled prop prevents clicks from firing, having the handler attached is unnecessary and slightly misleading. Removing it clarifies intent.

♻️ Suggested fix
             <IconButton
               aria-label={`${t('Sync to Google Sheets')} - ${disabledTooltip}`}
-              onClick={onSyncClick}
               disabled
             >
               <ArrowRefresh6 />
             </IconButton>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/journeys-admin/src/components/JourneyVisitorsList/GoogleSheetsSyncButton/GoogleSheetsSyncButton.tsx`
around lines 30 - 36, In GoogleSheetsSyncButton remove the unnecessary onClick
handler from the disabled IconButton; locate the IconButton component (the one
rendering ArrowRefresh6) and only pass onClick={onSyncClick} when the button is
enabled (e.g., conditionally set onClick to undefined or render a different prop
when disabled) so the disabled state does not include an attached handler and
intent is clear; reference IconButton, onSyncClick, and disabled/disabledTooltip
when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@apps/journeys-admin/src/components/JourneyVisitorsList/FilterDrawer/FilterDrawer.tsx`:
- Around line 82-84: The onClick handler is currently assigned to X2Icon instead
of the parent IconButton; move the click handler to the IconButton (i.e., add
onClick={handleClose} to IconButton and remove onClick from X2Icon) and ensure
IconButton includes an appropriate aria-label for accessibility; update the JSX
using IconButton, X2Icon, and handleClose accordingly.
- Around line 181-189: The Sync button currently calls onSyncDialogOpen directly
and shows no tooltip when disabled, so add defensive handling: ensure
onSyncDialogOpen is either required or provide a safe no-op fallback (e.g.,
check if onSyncDialogOpen is defined before invoking inside the Button's onClick
or default the prop to () => {}), and wrap the Sync Button with the same Tooltip
behavior used by the Export button when disableExportButton is true so disabled
state UX is consistent; update references to the Button rendering in
FilterDrawer (the Sync Button), the onSyncDialogOpen prop, and the
disableExportButton usage accordingly.

In
`@apps/journeys-admin/src/components/JourneyVisitorsList/GoogleSheetsSyncButton/GoogleSheetsSyncButton.tsx`:
- Around line 30-36: In GoogleSheetsSyncButton remove the unnecessary onClick
handler from the disabled IconButton; locate the IconButton component (the one
rendering ArrowRefresh6) and only pass onClick={onSyncClick} when the button is
enabled (e.g., conditionally set onClick to undefined or render a different prop
when disabled) so the disabled state does not include an attached handler and
intent is clear; reference IconButton, onSyncClick, and disabled/disabledTooltip
when making the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f210e166-ac72-4c30-a476-3660432a51d5

📥 Commits

Reviewing files that changed from the base of the PR and between 4b0bf27 and 17aab7d.

📒 Files selected for processing (7)
  • apps/journeys-admin/pages/journeys/[journeyId]/reports/visitors.tsx
  • apps/journeys-admin/src/components/JourneyVisitorsList/FilterDrawer/FilterDrawer.spec.tsx
  • apps/journeys-admin/src/components/JourneyVisitorsList/FilterDrawer/FilterDrawer.tsx
  • apps/journeys-admin/src/components/JourneyVisitorsList/GoogleSheetsSyncButton/GoogleSheetsSyncButton.spec.tsx
  • apps/journeys-admin/src/components/JourneyVisitorsList/GoogleSheetsSyncButton/GoogleSheetsSyncButton.tsx
  • apps/journeys-admin/src/components/JourneyVisitorsList/GoogleSheetsSyncButton/index.ts
  • libs/locales/en/apps-journeys-admin.json

@github-actions github-actions Bot temporarily deployed to Preview - journeys March 19, 2026 23:18 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources March 19, 2026 23:18 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin March 19, 2026 23:18 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch March 19, 2026 23:18 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch-modern March 19, 2026 23:18 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - videos-admin March 20, 2026 01:17 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - player March 20, 2026 01:17 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources March 20, 2026 01:17 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys March 20, 2026 01:17 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch-modern March 20, 2026 01:17 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch March 20, 2026 01:17 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin March 20, 2026 01:17 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch-modern March 22, 2026 20:08 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - player March 22, 2026 20:08 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - videos-admin March 22, 2026 20:08 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin March 22, 2026 20:08 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch March 22, 2026 20:08 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources March 22, 2026 20:08 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys March 22, 2026 20:08 Inactive
@blacksmith-sh

This comment has been minimized.

@github-actions github-actions Bot temporarily deployed to Preview - videos-admin March 23, 2026 03:13 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch March 23, 2026 03:13 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources March 23, 2026 03:13 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys March 23, 2026 03:13 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - player March 23, 2026 03:13 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug effort: 2 priority: soon type: fix Iterations on existing features or infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants