Skip to content

Commit 6650fdb

Browse files
refactor(companion): extract AvailabilityDetailScreen with AppPressable migration (calcom#26106)
* refactor(companion): extract AvailabilityDetailScreen with AppPressable migration Apply Phases 2, 3, 4 to availability-detail.tsx: - Phase 2: Extract screen logic (~995 lines) to components/screens/AvailabilityDetailScreen.tsx - Route file is now a minimal ~35 line wrapper with Stack.Screen config - Phase 3: ScrollView+map pattern kept (7 days is a fixed small list, FlatList not needed) - Phase 4: Migrate all TouchableOpacity to AppPressable (63 instances) Follows the same pattern as EventTypeDetailScreen extraction. * fix(companion): add GlassView header with Save button to AvailabilityDetailScreen (calcom#26107) * refactor(companion): extract BookingDetailScreen with AppPressable migration (calcom#26108) * refactor(companion): extract AvailabilityListScreen with AppPressable migration (calcom#26109) * fix(companion): add GlassView header with Save button to AvailabilityDetailScreen * refactor(companion): extract BookingDetailScreen with AppPressable migration * refactor(companion): extract AvailabilityListScreen with AppPressable migration * refactor(companion): Standardized error handling with dev-only debug logs (calcom#26110) * address cubics comments * address cubics comments * addressed typecheck erros * removed localhost from wxt.config for chrome extension * declare FullScreenModal FullScreenModalProps --------- Co-authored-by: Peer Richelsen <peer@cal.com> * add loggers for dev env --------- Co-authored-by: Peer Richelsen <peer@cal.com> --------- Co-authored-by: Peer Richelsen <peer@cal.com>
1 parent 9909ac5 commit 6650fdb

31 files changed

Lines changed: 2606 additions & 2343 deletions

companion/api/server.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ const sendFile = (res: ServerResponse, filePath: string) => {
5555

5656
const stream = createReadStream(filePath);
5757
stream.on("error", (error) => {
58-
console.error("Failed to read file:", error);
58+
console.error("Failed to read file");
59+
if (process.env.NODE_ENV !== "production") {
60+
const message = error instanceof Error ? error.message : String(error);
61+
const stack = error instanceof Error ? error.stack : undefined;
62+
console.debug("[companion/api] Failed to read file", { message, stack });
63+
}
5964
res.statusCode = 500;
6065
res.end("Internal Server Error");
6166
});
@@ -76,7 +81,12 @@ export default async function handler(req: IncomingMessage, res: ServerResponse)
7681
const filePath = await resolveFilePath(safePath);
7782
sendFile(res, filePath);
7883
} catch (error) {
79-
console.error("Server render error:", error);
84+
console.error("Server render error");
85+
if (process.env.NODE_ENV !== "production") {
86+
const message = error instanceof Error ? error.message : String(error);
87+
const stack = error instanceof Error ? error.stack : undefined;
88+
console.debug("[companion/api] Server render error", { message, stack });
89+
}
8090
res.statusCode = 500;
8191
res.end("Internal Server Error");
8292
}

0 commit comments

Comments
 (0)