Skip to content

Commit 88ce786

Browse files
PeerRichdhairyashiilabhijeetsingh-22volneiCarinaWolli
authored
feat: companion expo and chrome (calcom#25022)
* feat: companion expo and chrome * fix: api-v2-fetch-bookings (calcom#25023) * migrated to app expo router * feat(companion): added availability screen and fix event type fetch (calcom#25025) * fix(companion): add host check in bookings (calcom#25036) * using liquid glass bottom nav experimental * added action sheet * added icons to event type tabs * added action bar for event-type details * long press for edit event types * added limits * added more limits * added more limits * added username to event types * feat(companion): config to set and show all the available meeting options a user has stalled (calcom#25081) * feat: Add tailwind support using nativewind. (calcom#25028) * init nativewind * replace styles with tailwind classes * changes * feat(companion): all locations options, icons, and apply nativewind to remaining files (calcom#25143) * feat: all locations options and icons and apply nativwind to reamaining files * icon bug fix * cal video icon * other location frontend * other location api * address cubics comment about correctly detects SVGs * feat(companion): edit availability (calcom#25149) * feat: companion-edit-availability * date override and use correct config for patch api endpoint * Android Alert supports a maximum of 3 buttons * feat: companion-ui-release-1 (calcom#25150) * feat(companion): Add event type & schedule creation flows with API expansion (calcom#25187) * feat(companion): event schedule creation and apis * profile section * limits, advanced, recurring tab * Clean Folder Structure * addressed cubics comments * fix cubiics comments * replaced text with cal.com svg logo * added correct more button for event-types * added copy link button * added extension popup * added chrome extension sidebar * achieved liquid glass buttons * nit * more progress * fixed ios bug, added icon * added cal icon to gmail * nit * nit * added dialog for one-off meeting * added one-time dialog * feat(companion): gmail plugin (calcom#25327) * Update Cal.com Companion to version 1.7.0 with enhanced background and content scripts. The background script now handles fetching event types from the Cal.com API and improved error handling. The content script has been updated to manage sidebar visibility and respond to messages more effectively. Removed deprecated dev background script and updated manifest permissions for better functionality. * chore: update companion .gitignore to exclude build outputs and env files * feat: insert Cal.com event link directly at cursor position in Gmail compose - Add insertTextAtCursor function to insert booking link where user is typing - Automatically positions cursor after inserted link for seamless typing - Fallback to clipboard copy if compose field not found - Improved UX: no need to manually paste the link * feat(companion): improve notification UI and add event types caching - Update notification to Cal.com brand style (black bg, check icon, smooth fade) - Change notification text to 'Link inserted' for subtlety - Move notification to bottom-right position (matching Cal.com toasts) - Add event types caching (5min duration) to reduce API calls - Cache automatically refreshes on page reload - Fix TypeScript error with composeBody.focus() type assertion * Notification toast border * conditional description * conditional description * feat(companion): Enhance UI with action buttons, tooltips, and Gmail extension improvements (calcom#25353) * feat: companion-and-gmail-ui-upgrade * feat: companion-and-gmail-ui-upgrade * feat: companion-and-gmail-ui-upgrade * feat: companion-and-gmail-ui-upgrade * feat(companion): one-off links (calcom#25355) * added one off prototype * resolve merge conflicts --------- Co-authored-by: Dhairyashil <dhairyashil10101010@gmail.com> * fixed sidebar iframe * fix: enable pointer events on sidebar while maintaining click-through on transparent area - Added pointerEvents: 'auto' to sidebar View component in _layout.tsx - Changed iframe width from 100% to 400px to match sidebar width - Changed iframe pointerEvents from 'none' to 'auto' to enable clicking - This allows sidebar items to be clickable while transparent area remains click-through * feat(companion): center all modals on full screen in browser extension (calcom#25380) * fix: companion-full-width-iframe * center the popups on extension view * feat(companion): center all modals on full screen in browser extension - Created FullScreenModal component that expands iframe to full width - Updated content script to handle instant iframe expansion/collapse - Converted 17 modals across 6 files to use FullScreenModal - All modals now appear centered on full browser viewport - Removed animations for instant modal appearance - Mobile app behavior remains unchanged Files updated: - companion/components/FullScreenModal.tsx (new) - companion/extension/entrypoints/content.ts - companion/app/(tabs)/event-types.tsx (5 modals) - companion/app/(tabs)/bookings.tsx (2 modals) - companion/app/(tabs)/availability.tsx (3 modals) - companion/app/booking-detail.tsx (2 modals) - companion/app/availability-detail.tsx (4 modals) - companion/components/Header.tsx (1 modal) * security(companion): validate postMessage origin in content script Add origin and source validation to postMessage listener to prevent malicious scripts on host pages from manipulating the companion iframe. - Verify event.source matches iframe.contentWindow - Verify event.origin matches iframe origin (localhost:8081) - Reject all unauthorized messages before processing This prevents external scripts from: - Forcing full-screen overlays - Intercepting pointer events - Manipulating the companion UI * fix(companion): center 'Add new event type' modal on full screen Replace KeyboardAvoidingView with TouchableOpacity pattern in the create event type modal to ensure it appears centered on the full screen like all other modals. This was the last remaining modal that wasn't properly centered. * fix(companion): resolve modal transition timing issue Fixed the 'Add new event type' modal not centering properly by: - Added 100ms delay when transitioning between modals - Prevents conflicting expand/collapse messages - Removed redundant postMessage calls from modal handlers - Added max-height constraint to modal content - Cleaned up debug console logs The issue was that when clicking 'New Event Type' from the 'New' menu, both modals were transitioning simultaneously, causing the create modal to collapse immediately. The delay ensures proper sequencing. All 17 modals now work correctly and appear centered on full screen. * added working date range * removed all of one-off event code * nit * feat(companion): Suggest `Cal.com` links and Embed using Gemini Ai in Gmail (calcom#25406) Co-authored-by: Peer Richelsen <peeroke@gmail.com> * add companion build on CI * feat: oauth companion (calcom#25526) * first implemenation of oauth * fix logout for web * revert app name * remove isUsingOAuth * clean up log out button * remove logs * clean up authcontext * simplify code generation * code clean up * clean up oauthService.ts * oauth browser extension * add redirect uri to .env.example * remove api key support * clean up _layout file * add identity * fix + clean up * improvements to oauth flow * code clean up * remove comments * clean up comments * add log out dialog * add confirm modal --------- Co-authored-by: CarinaWolli <wollencarina@gmail.com> --------- Co-authored-by: Dhairyashil Shinde <93669429+dhairyashiil@users.noreply.github.com> Co-authored-by: Abhijeet Singh <asingh9829@gmail.com> Co-authored-by: Dhairyashil <dhairyashil10101010@gmail.com> Co-authored-by: Volnei Munhoz <volnei.munhoz@gmail.com> Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Co-authored-by: CarinaWolli <wollencarina@gmail.com>
1 parent ba3838e commit 88ce786

73 files changed

Lines changed: 32839 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Companion Builds
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
env:
10+
EXPO_PUBLIC_CAL_API_KEY: ${{ secrets.CI_EXPO_PUBLIC_CAL_API_KEY || vars.CI_EXPO_PUBLIC_CAL_API_KEY || vars.EXPO_PUBLIC_CAL_API_KEY }}
11+
12+
jobs:
13+
build:
14+
name: Build Companion App & Extension
15+
runs-on: buildjet-4vcpu-ubuntu-2204
16+
timeout-minutes: 30
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: ./.github/actions/dangerous-git-checkout
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: npm
25+
cache-dependency-path: companion/package-lock.json
26+
- name: Install dependencies
27+
working-directory: companion
28+
run: npm ci
29+
- name: Build Expo web app
30+
working-directory: companion
31+
env:
32+
EXPO_NO_TELEMETRY: 1
33+
CI: true
34+
run: npx expo export --platform web
35+
- name: Build browser extension
36+
working-directory: companion
37+
run: npm run ext:build

.github/workflows/pr.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,13 @@ jobs:
146146
uses: ./.github/workflows/docs-build.yml
147147
secrets: inherit
148148

149+
build-companion:
150+
name: Companion builds
151+
needs: [changes, check-label, deps]
152+
if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
153+
uses: ./.github/workflows/companion-build.yml
154+
secrets: inherit
155+
149156
build:
150157
name: Production builds
151158
needs: [changes, check-label, deps]
@@ -244,6 +251,7 @@ jobs:
244251
build-api-v2,
245252
build-atoms,
246253
build-docs,
254+
build-companion,
247255
e2e,
248256
e2e-api-v2,
249257
e2e-embed,

companion/.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Cal.com OAuth Configuration
2+
EXPO_PUBLIC_CALCOM_OAUTH_CLIENT_ID=your_oauth_client_id_here
3+
4+
EXPO_PUBLIC_CALCOM_OAUTH_REDIRECT_URI=your_oauth_redirect_uri_here
5+

companion/.gitignore

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2+
3+
# dependencies
4+
node_modules/
5+
.yarn/
6+
.pnp.*
7+
8+
# Expo
9+
.expo/
10+
dist/
11+
web-build/
12+
expo-env.d.ts
13+
14+
# Native
15+
.kotlin/
16+
*.orig.*
17+
*.jks
18+
*.p8
19+
*.p12
20+
*.key
21+
*.mobileprovision
22+
23+
# Metro
24+
.metro-health-check*
25+
26+
# debug
27+
npm-debug.*
28+
yarn-debug.*
29+
yarn-error.*
30+
*.log
31+
32+
# macOS
33+
.DS_Store
34+
*.pem
35+
36+
# local env files
37+
.env*.local
38+
.env
39+
40+
# typescript
41+
*.tsbuildinfo
42+
43+
# generated native folders
44+
/ios
45+
/android
46+
47+
# WXT Chrome Extension build outputs
48+
.output/
49+
.wxt/
50+
dev/
51+
52+
# Extension builds (generated at build time)
53+
*.zip
54+
55+
# IDE
56+
.vscode/
57+
.idea/
58+
*.swp
59+
*.swo
60+
*~
61+
62+
# Testing
63+
coverage/
64+
.nyc_output/
65+
66+
# Misc
67+
*.code-workspace

companion/.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
cd companion
5+
npx lint-staged
6+

companion/.prettierrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
semi: true,
3+
trailingComma: "es5",
4+
singleQuote: false,
5+
printWidth: 100,
6+
tabWidth: 2,
7+
useTabs: false,
8+
arrowParens: "always",
9+
plugins: ["prettier-plugin-tailwindcss"],
10+
};

companion/app.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"expo": {
3+
"name": "expo-wxt-app",
4+
"slug": "expo-wxt-app",
5+
"scheme": "expo-wxt-app",
6+
"version": "1.0.0",
7+
"orientation": "portrait",
8+
"icon": "./assets/icon.png",
9+
"userInterfaceStyle": "light",
10+
"newArchEnabled": true,
11+
"splash": {
12+
"image": "./assets/splash-icon.png",
13+
"resizeMode": "contain",
14+
"backgroundColor": "#ffffff"
15+
},
16+
"ios": {
17+
"supportsTablet": true,
18+
"deploymentTarget": "18.0"
19+
},
20+
"android": {
21+
"adaptiveIcon": {
22+
"foregroundImage": "./assets/adaptive-icon.png",
23+
"backgroundColor": "#ffffff"
24+
},
25+
"edgeToEdgeEnabled": true
26+
},
27+
"web": {
28+
"favicon": "./assets/favicon.png",
29+
"bundler": "metro"
30+
}
31+
}
32+
}

companion/app/(tabs)/_layout.tsx

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import { Ionicons } from "@expo/vector-icons";
2+
import { isLiquidGlassAvailable } from "expo-glass-effect";
3+
import { Tabs } from "expo-router";
4+
import { NativeTabs, Icon, Label } from "expo-router/unstable-native-tabs";
5+
import { Platform } from "react-native";
6+
7+
export default function TabLayout() {
8+
// Check if liquid glass effect is available
9+
const supportsLiquidGlass = isLiquidGlassAvailable();
10+
11+
// Use NativeTabs for iOS 15+ (liquid glass support), fallback to standard Tabs
12+
if (supportsLiquidGlass) {
13+
return (
14+
<NativeTabs>
15+
<NativeTabs.Trigger name="event-types">
16+
<Icon sf="link" />
17+
<Label>Event Types</Label>
18+
</NativeTabs.Trigger>
19+
20+
<NativeTabs.Trigger name="bookings">
21+
<Icon sf="calendar" />
22+
<Label>Bookings</Label>
23+
</NativeTabs.Trigger>
24+
25+
<NativeTabs.Trigger name="availability">
26+
<Icon sf="clock" />
27+
<Label>Availability</Label>
28+
</NativeTabs.Trigger>
29+
30+
<NativeTabs.Trigger name="more">
31+
<Icon sf="ellipsis" />
32+
<Label>More</Label>
33+
</NativeTabs.Trigger>
34+
</NativeTabs>
35+
);
36+
}
37+
38+
// Fallback to standard Expo Router Tabs for older iOS and Android
39+
return (
40+
<Tabs
41+
screenOptions={{
42+
headerShown: false,
43+
tabBarActiveTintColor: "#000000",
44+
tabBarInactiveTintColor: "#8E8E93",
45+
tabBarStyle: {
46+
backgroundColor: "#ffffff",
47+
borderTopWidth: 0.5,
48+
borderTopColor: "#C6C6C8",
49+
paddingBottom: 4,
50+
paddingTop: 4,
51+
height: Platform.OS === "android" ? 74 : 66,
52+
},
53+
}}
54+
>
55+
<Tabs.Screen
56+
name="event-types"
57+
options={{
58+
title: "Event Types",
59+
tabBarIcon: ({ color, focused }) => (
60+
<Ionicons name={focused ? "link" : "link-outline"} size={24} color={color} />
61+
),
62+
}}
63+
/>
64+
65+
<Tabs.Screen
66+
name="bookings"
67+
options={{
68+
title: "Bookings",
69+
tabBarIcon: ({ color, focused }) => (
70+
<Ionicons name={focused ? "calendar" : "calendar-outline"} size={24} color={color} />
71+
),
72+
}}
73+
/>
74+
75+
<Tabs.Screen
76+
name="availability"
77+
options={{
78+
title: "Availability",
79+
tabBarIcon: ({ color, focused }) => (
80+
<Ionicons name={focused ? "time" : "time-outline"} size={24} color={color} />
81+
),
82+
}}
83+
/>
84+
85+
<Tabs.Screen
86+
name="more"
87+
options={{
88+
title: "More",
89+
tabBarIcon: ({ color, focused }) => (
90+
<Ionicons
91+
name={focused ? "ellipsis-horizontal" : "ellipsis-horizontal-outline"}
92+
size={24}
93+
color={color}
94+
/>
95+
),
96+
}}
97+
/>
98+
</Tabs>
99+
);
100+
}

0 commit comments

Comments
 (0)