Skip to content

Commit 3ca3899

Browse files
authored
Optimize thread counting and add license headers to workflow files (#1949)
# READ CAREFULLY THEN REMOVE Remove bullet points that are not relevant. PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI. - Pull requests that do not follow these guidelines will be closed without review or comment. - If you use AI to write your PR description your pr will be close without review or comment. - If you are unsure about anything, feel free to ask for clarification. ## Description Please provide a clear description of your changes. --- ## Type of Change Please delete options that are not relevant. - [ ] 🐛 Bug fix (non-breaking change which fixes an issue) - [ ] ✨ New feature (non-breaking change which adds functionality) - [ ] 💥 Breaking change (fix or feature with breaking changes) - [ ] 📝 Documentation update - [ ] 🎨 UI/UX improvement - [ ] 🔒 Security enhancement - [ ] ⚡ Performance improvement ## Areas Affected Please check all that apply: - [ ] Email Integration (Gmail, IMAP, etc.) - [ ] User Interface/Experience - [ ] Authentication/Authorization - [ ] Data Storage/Management - [ ] API Endpoints - [ ] Documentation - [ ] Testing Infrastructure - [ ] Development Workflow - [ ] Deployment/Infrastructure ## Testing Done Describe the tests you've done: - [ ] Unit tests added/updated - [ ] Integration tests added/updated - [ ] Manual testing performed - [ ] Cross-browser testing (if UI changes) - [ ] Mobile responsiveness verified (if UI changes) ## Security Considerations For changes involving data or authentication: - [ ] No sensitive data is exposed - [ ] Authentication checks are in place - [ ] Input validation is implemented - [ ] Rate limiting is considered (if applicable) ## Checklist - [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document - [ ] My code follows the project's style guidelines - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in complex areas - [ ] I have updated the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix/feature works - [ ] All tests pass locally - [ ] Any dependent changes are merged and published ## Additional Notes Add any other context about the pull request here. ## Screenshots/Recordings Add screenshots or recordings here if applicable. --- _By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._ <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Improved thread counting performance by batching label queries and added Apache license headers to workflow files. - **Refactors** - Replaced individual thread count queries with a single batched query for all labels. - Added license headers to workflow-related source files. <!-- End of auto-generated description by cubic. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved thread counting performance by enabling batch counting of threads across multiple folders or labels. * **Refactor** * Streamlined folder synchronization logic and removed unused or commented-out code for better maintainability. * **Documentation** * Added Apache 2.0 license headers to several files to clarify usage and licensing terms. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 18314cd commit 3ca3899

File tree

31 files changed

+241
-229
lines changed

31 files changed

+241
-229
lines changed

apps/mail/app/(auth)/login/login-client.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,13 @@ function LoginClientContent({ providers, isProd }: LoginClientProps) {
201201
</button>
202202

203203
<div
204-
className={`overflow-hidden transition-all duration-300 ease-in-out ${expandedProviders[provider.id] ? 'max-h-[500px] opacity-100' : 'max-h-0 opacity-0'}`}
204+
className={`overflow-hidden duration-300 ease-in-out ${expandedProviders[provider.id] ? 'max-h-[500px] opacity-100' : 'max-h-0 opacity-0'}`}
205205
>
206-
<div className="bg-black/3 p-4 font-mono text-sm dark:bg-white/3">
206+
<div className="bg-black/3 dark:bg-white/3 p-4 font-mono text-sm">
207207
{provider.envVarStatus.map((envVar) => (
208208
<div
209209
key={envVar.name}
210-
className={`mb-3 flex items-start transition-all duration-300 ease-in-out last:mb-0 ${expandedProviders[provider.id] ? 'translate-y-0 opacity-100' : 'translate-y-2 opacity-0'}`}
210+
className={`mb-3 flex items-start duration-300 ease-in-out last:mb-0 ${expandedProviders[provider.id] ? 'translate-y-0 opacity-100' : 'translate-y-2 opacity-0'}`}
211211
style={{
212212
transitionDelay: expandedProviders[provider.id]
213213
? `${provider.envVarStatus.indexOf(envVar) * 50}ms`

apps/mail/app/(full-width)/contributors.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ export default function OpenPage() {
380380
</div>
381381

382382
{/* Project Stats */}
383-
<div className="mb-8 overflow-hidden rounded-xl border bg-linear-to-b from-white/50 to-white/10 p-6 backdrop-blur-sm dark:border-neutral-700 dark:from-neutral-900/50 dark:to-neutral-900/30">
383+
<div className="bg-linear-to-b mb-8 overflow-hidden rounded-xl border from-white/50 to-white/10 p-6 backdrop-blur-sm dark:border-neutral-700 dark:from-neutral-900/50 dark:to-neutral-900/30">
384384
<div className="flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center">
385385
<div className="space-y-1">
386386
<div className="flex items-center gap-2">
@@ -484,7 +484,7 @@ export default function OpenPage() {
484484

485485
<div className="mt-6 grid gap-4 lg:grid-cols-3">
486486
{/* Repository Growth */}
487-
<Card className="col-span-full border-neutral-100 bg-white/50 p-4 transition-all hover:bg-white/60 lg:col-span-2 dark:border-neutral-800 dark:bg-neutral-900/50 dark:hover:bg-neutral-900/60">
487+
<Card className="col-span-full border-neutral-100 bg-white/50 p-4 hover:bg-white/60 lg:col-span-2 dark:border-neutral-800 dark:bg-neutral-900/50 dark:hover:bg-neutral-900/60">
488488
<h3 className="mb-4 text-sm font-medium text-neutral-600 dark:text-neutral-400">
489489
Repository Growth
490490
</h3>
@@ -576,7 +576,7 @@ export default function OpenPage() {
576576
</Card>
577577

578578
{/* Activity Chart */}
579-
<Card className="col-span-full border-neutral-200 bg-white/50 p-4 transition-all hover:bg-white/60 lg:col-span-1 dark:border-neutral-800 dark:bg-neutral-900/50 dark:hover:bg-neutral-900/60">
579+
<Card className="col-span-full border-neutral-200 bg-white/50 p-4 hover:bg-white/60 lg:col-span-1 dark:border-neutral-800 dark:bg-neutral-900/50 dark:hover:bg-neutral-900/60">
580580
<h3 className="mb-4 text-sm font-medium text-neutral-600 dark:text-neutral-400">
581581
Recent Activity
582582
</h3>
@@ -672,7 +672,7 @@ export default function OpenPage() {
672672
{filteredCoreTeam?.map((member, index) => (
673673
<div
674674
key={member.login}
675-
className="group relative flex items-center gap-4 rounded-xl border bg-white/50 p-4 transition-all hover:-translate-y-1 hover:bg-white hover:shadow-lg dark:border-neutral-800 dark:bg-neutral-900/50 dark:hover:bg-neutral-900 dark:hover:shadow-neutral-900/50"
675+
className="group relative flex items-center gap-4 rounded-xl border bg-white/50 p-4 hover:-translate-y-1 hover:bg-white hover:shadow-lg dark:border-neutral-800 dark:bg-neutral-900/50 dark:hover:bg-neutral-900 dark:hover:shadow-neutral-900/50"
676676
style={{
677677
animationDelay: `${index * 100}ms`,
678678
animation: 'fadeInUp 0.5s ease-out forwards',
@@ -783,7 +783,7 @@ export default function OpenPage() {
783783
key={contributor.login}
784784
href={contributor.html_url}
785785
target="_blank"
786-
className="group relative flex flex-col items-center rounded-xl border bg-white/50 p-4 transition-all hover:-translate-y-1 hover:bg-white hover:shadow-lg dark:border-neutral-800 dark:bg-neutral-900/50 dark:hover:bg-neutral-900 dark:hover:shadow-neutral-900/50"
786+
className="group relative flex flex-col items-center rounded-xl border bg-white/50 p-4 hover:-translate-y-1 hover:bg-white hover:shadow-lg dark:border-neutral-800 dark:bg-neutral-900/50 dark:hover:bg-neutral-900 dark:hover:shadow-neutral-900/50"
787787
style={{
788788
animationDelay: `${index * 50}ms`,
789789
animation: 'fadeInUp 0.5s ease-out forwards',
@@ -908,7 +908,7 @@ export default function OpenPage() {
908908
</div>
909909

910910
<div className="mb-8">
911-
<div className="relative overflow-hidden rounded-xl border bg-linear-to-br from-neutral-50 to-white shadow-sm dark:border-neutral-800 dark:from-neutral-900/80 dark:to-neutral-900/30">
911+
<div className="bg-linear-to-br relative overflow-hidden rounded-xl border from-neutral-50 to-white shadow-sm dark:border-neutral-800 dark:from-neutral-900/80 dark:to-neutral-900/30">
912912
<div className="absolute inset-0 opacity-20 dark:opacity-20"></div>
913913

914914
<div className="relative p-6">
@@ -928,7 +928,7 @@ export default function OpenPage() {
928928
<div className="mt-5 flex flex-wrap gap-3">
929929
<Button
930930
asChild
931-
className="relative overflow-hidden bg-neutral-900 text-white transition-all hover:bg-neutral-800 dark:bg-white dark:text-neutral-900 dark:hover:bg-neutral-100"
931+
className="relative overflow-hidden bg-neutral-900 text-white hover:bg-neutral-800 dark:bg-white dark:text-neutral-900 dark:hover:bg-neutral-100"
932932
>
933933
<a
934934
href={`https://github.com/${REPOSITORY}/blob/main/.github/CONTRIBUTING.md`}

apps/mail/app/(full-width)/privacy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default function PrivacyPolicy() {
6161
</h2>
6262
<button
6363
onClick={() => handleCopyLink(sectionId)}
64-
className="text-gray-400 transition-all hover:text-gray-700 dark:text-white/60 dark:hover:text-white/80"
64+
className="text-gray-400 hover:text-gray-700 dark:text-white/60 dark:hover:text-white/80"
6565
aria-label={`Copy link to ${section.title} section`}
6666
>
6767
<Link2

apps/mail/app/(full-width)/terms.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ import { Button } from '@/components/ui/button';
66
import Footer from '@/components/home/footer';
77
import { createSectionId } from '@/lib/utils';
88

9-
109
import React from 'react';
1110

1211
const LAST_UPDATED = 'February 13, 2025';
1312

1413
export default function TermsOfService() {
1514
const { copiedValue: copiedSection, copyToClipboard } = useCopyToClipboard();
16-
1715

1816
const handleCopyLink = (sectionId: string) => {
1917
const url = `${window.location.origin}${window.location.pathname}#${sectionId}`;
@@ -25,7 +23,7 @@ export default function TermsOfService() {
2523
<Navigation />
2624
<div className="relative z-10 flex grow flex-col">
2725
{/* Back Button */}
28-
<div className="absolute right-4 top-6 md:left-8 md:top-8 md:right-auto">
26+
<div className="absolute right-4 top-6 md:left-8 md:right-auto md:top-8">
2927
<a href="/">
3028
<Button
3129
variant="ghost"
@@ -64,7 +62,7 @@ export default function TermsOfService() {
6462
</h2>
6563
<button
6664
onClick={() => handleCopyLink(sectionId)}
67-
className="text-gray-400 transition-all hover:text-gray-700 dark:text-white/60 dark:hover:text-white/80"
65+
className="text-gray-400 hover:text-gray-700 dark:text-white/60 dark:hover:text-white/80"
6866
aria-label={`Copy link to ${section.title} section`}
6967
>
7068
<Link2

apps/mail/app/(routes)/developer/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export default function DeveloperPage() {
9494

9595
<div className="grid grid-cols-1 gap-4 pb-4 sm:gap-6 md:grid-cols-2 lg:grid-cols-3">
9696
{developerResources.map((resource) => (
97-
<Card key={resource.title} className="transition-all hover:shadow-md">
97+
<Card key={resource.title} className="hover:shadow-md">
9898
<CardHeader className="sm:p-6">
9999
<div className="flex items-start gap-4 sm:items-center">
100100
<div className={`shrink-0 rounded-lg ${resource.bgColor} p-2.5`}>

apps/mail/app/(routes)/settings/connections/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export default function ConnectionsPage() {
164164
<Button
165165
variant="ghost"
166166
size="icon"
167-
className="text-muted-foreground hover:text-primary ml-4 shrink-0"
167+
className="text-muted-foreground hover:text-primary ml-4 shrink-0"
168168
disabled={data.connections.length === 1}
169169
>
170170
<Trash className="h-4 w-4" />
@@ -205,7 +205,7 @@ export default function ConnectionsPage() {
205205
<AddConnectionDialog>
206206
<Button
207207
variant="outline"
208-
className="group relative w-9 overflow-hidden transition-all duration-200 hover:w-full sm:hover:w-[32.5%]"
208+
className="group relative w-9 overflow-hidden duration-200 hover:w-full sm:hover:w-[32.5%]"
209209
>
210210
<Plus className="absolute left-2 h-4 w-4" />
211211
<span className="whitespace-nowrap pl-7 opacity-0 transition-opacity duration-200 group-hover:opacity-100">
@@ -217,7 +217,7 @@ export default function ConnectionsPage() {
217217
<Button
218218
onClick={() => setPricingDialog('true')}
219219
variant="outline"
220-
className="group relative w-9 overflow-hidden transition-all duration-200 hover:w-full sm:hover:w-[32.5%]"
220+
className="group relative w-9 overflow-hidden duration-200 hover:w-full sm:hover:w-[32.5%]"
221221
>
222222
<Plus className="absolute left-2 h-4 w-4" />
223223
<span className="whitespace-nowrap pl-7 opacity-0 transition-opacity duration-200 group-hover:opacity-100">

apps/mail/components/create/editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ export default function Editor({
316316
>
317317
{/* Make sure the command palette doesn't cause a refresh */}
318318
<EditorCommand
319-
className="border-muted bg-background z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border px-1 py-2 shadow-md transition-all"
319+
className="border-muted bg-background z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border px-1 py-2 shadow-md"
320320
onKeyDown={(e) => {
321321
// Prevent form submission on any key that might trigger it
322322
if (e.key === 'Enter' || e.key === ' ' || e.key === 'Spacebar') {

apps/mail/components/labels/label-dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export function LabelDialog({
131131
<button
132132
key={color.backgroundColor}
133133
type="button"
134-
className={`h-10 w-10 rounded-[4px] border-[0.5px] border-white/10 transition-all ${
134+
className={`h-10 w-10 rounded-[4px] border-[0.5px] border-white/10 ${
135135
formColor?.backgroundColor.toString() === color.backgroundColor &&
136136
formColor.textColor.toString() === color.textColor
137137
? 'scale-110 ring-2 ring-blue-500 ring-offset-1'

apps/mail/components/mail/mail-display.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,10 +1313,7 @@ const MailDisplay = ({ emailData, index, totalEmails, demo, threadAttachments }:
13131313
</>
13141314
)}
13151315
</div>
1316-
<div
1317-
className="flex cursor-pointer flex-col pb-2 transition-all duration-200"
1318-
onClick={toggleCollapse}
1319-
>
1316+
<div className="flex cursor-pointer flex-col pb-2 duration-200" onClick={toggleCollapse}>
13201317
<div className="mt-3 flex w-full items-start justify-between gap-4 px-4">
13211318
<div className="flex w-full justify-center gap-4">
13221319
<BimiAvatar
@@ -1635,16 +1632,11 @@ const MailDisplay = ({ emailData, index, totalEmails, demo, threadAttachments }:
16351632
</div>
16361633
</div>
16371634

1638-
<div
1639-
className={cn(
1640-
'h-0 overflow-hidden transition-all duration-200',
1641-
!isCollapsed && 'h-px',
1642-
)}
1643-
></div>
1635+
<div className={cn('h-0 overflow-hidden duration-200', !isCollapsed && 'h-px')}></div>
16441636

16451637
<div
16461638
className={cn(
1647-
'grid overflow-hidden transition-all duration-200',
1639+
'grid overflow-hidden duration-200',
16481640
isCollapsed ? 'grid-rows-[0fr]' : 'grid-rows-[1fr]',
16491641
)}
16501642
onClick={(e) => e.stopPropagation()}

apps/mail/components/mail/mail-list.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ const Thread = memo(
223223
data-thread-id={idToUse}
224224
key={idToUse}
225225
className={cn(
226-
'hover:bg-offsetLight dark:hover:bg-primary/5 group relative mx-1 flex cursor-pointer flex-col items-start rounded-lg py-2 text-left text-sm transition-all hover:opacity-100',
226+
'hover:bg-offsetLight dark:hover:bg-primary/5 group relative mx-1 flex cursor-pointer flex-col items-start rounded-lg py-2 text-left text-sm hover:opacity-100',
227227
(isMailSelected || isMailBulkSelected || isKeyboardFocused) &&
228228
'border-border bg-primary/5 opacity-100',
229229
isKeyboardFocused && 'ring-primary/50',
@@ -572,7 +572,7 @@ const Draft = memo(({ message }: { message: { id: string } }) => {
572572
<div
573573
key={message.id}
574574
className={cn(
575-
'group relative mx-[8px] flex cursor-pointer flex-col items-start overflow-clip rounded-[10px] border-transparent py-3 text-left text-sm transition-all',
575+
'group relative mx-[8px] flex cursor-pointer flex-col items-start overflow-clip rounded-[10px] border-transparent py-3 text-left text-sm',
576576
)}
577577
>
578578
<div
@@ -604,7 +604,7 @@ const Draft = memo(({ message }: { message: { id: string } }) => {
604604
<div
605605
key={message.id}
606606
className={cn(
607-
'hover:bg-offsetLight dark:hover:bg-primary/5 group relative mx-[8px] flex cursor-pointer flex-col items-start overflow-clip rounded-[10px] border-transparent py-3 text-left text-sm transition-all hover:opacity-100',
607+
'hover:bg-offsetLight dark:hover:bg-primary/5 group relative mx-[8px] flex cursor-pointer flex-col items-start overflow-clip rounded-[10px] border-transparent py-3 text-left text-sm hover:opacity-100',
608608
)}
609609
>
610610
<div

0 commit comments

Comments
 (0)