Skip to content

dev to main (0.8.1)#179

Merged
vansisto merged 2 commits into
mainfrom
development
Aug 8, 2025
Merged

dev to main (0.8.1)#179
vansisto merged 2 commits into
mainfrom
development

Conversation

@vansisto

@vansisto vansisto commented Aug 8, 2025

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Removed Features

    • Eliminated all WhatsApp integration, including sending files via WhatsApp, QR code authentication, and WhatsApp contact dialogs.
    • Removed related UI elements such as send buttons, dialogs, and WhatsApp-specific columns and controls.
    • Deleted all WhatsApp-related settings, localization strings, and documentation references.
  • Bug Fixes

    • Corrected step numbering in the "Run locally" instructions.
  • Chores

    • Removed obsolete dependencies and internal code related to WhatsApp.
    • Cleaned up tests and services associated with WhatsApp features.

@vansisto vansisto added this to the WhatsApp client milestone Aug 8, 2025
@vansisto vansisto self-assigned this Aug 8, 2025
@vansisto vansisto added the enhancement New feature or request label Aug 8, 2025
@coderabbitai

coderabbitai Bot commented Aug 8, 2025

Copy link
Copy Markdown

Walkthrough

This change removes all WhatsApp integration from the application. It deletes backend handlers, frontend services, UI components, dialogs, tests, and localization strings related to WhatsApp functionality. Corresponding dependencies are removed, and the application menu is updated. All code, tests, and documentation referencing WhatsApp features are eliminated.

Changes

Cohort / File(s) Change Summary
Documentation & Metadata
README.md, package.json
Removed WhatsApp integration documentation. Incremented version to 0.8.1. Removed dependencies: angularx-qrcode, whatsapp-web.js.
Electron Main & IPC Handlers
src/core/electron-main.js, src/core/handlers/ipc/whatsapp-handler.js, src/core/preload.js
Removed WhatsApp IPC handler import, invocation, and all related IPC methods from preload. Deleted the WhatsApp IPC handler module.
Electron App Menu
src/core/handlers/app/main-instance-handler.js, src/__tests__/core/handlers/app/main-instance-handler.spec.js
Added application menu setup using Electron's Menu API. Updated corresponding test mocks.
WhatsApp Angular Services
src/app/services/whats-app.service.ts, src/app/services/send-files.service.ts, src/app/services/dialog.service.ts
Deleted WhatsApp and file sending services. Removed WhatsApp dialog state and methods from dialog service.
WhatsApp Angular Service Tests
src/app/services/whats-app.service.spec.ts, src/app/services/send-files.service.spec.ts, src/app/services/dialog.service.spec.ts
Deleted WhatsApp and file sending service tests. Removed WhatsApp-related dialog service tests.
WhatsApp Models
src/app/models/ccontact.ts, src/app/models/ccontact.spec.ts
Deleted contact model and its test.
WhatsApp Dialog Components
src/app/components/dialogs/whats-app-contact-list-dialog/*, src/app/components/dialogs/whats-app-qrdialog/*, src/app/components/dialogs/whats-app-file-too-large/*
Deleted all WhatsApp dialog components, their templates, and tests.
App Component
src/app/app.component.ts, src/app/app.component.html, src/app/app.component.spec.ts
Removed WhatsApp dialog imports, declarations, and mock components from app component and its tests.
Control Component
src/app/components/control/control.component.ts, src/app/components/control/control.component.html, src/app/components/control/control.component.spec.ts
Removed WhatsApp service, methods, UI, and related tests from control component.
Files Table Component
src/app/components/files-table/files-table.component.ts, src/app/components/files-table/files-table.component.html, src/app/components/files-table/files-table.component.spec.ts
Removed WhatsApp integration, send button, popover, and related tests from files table component.
Localization
src/assets/i18n/en.json, src/assets/i18n/ua.json
Removed all WhatsApp and messenger-related localization strings.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant App UI
  participant Main Process

  Note over App UI,Main Process: WhatsApp integration removed<br>— no WhatsApp-related flows —
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Poem

A rabbit hopped, its code so neat,
It swept WhatsApp from every seat.
No more QR codes, no more send,
Simpler menus now extend.
Dialogs gone, the tests are too,
The app feels lighter, fresh, and new!
🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch development

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vansisto vansisto linked an issue Aug 8, 2025 that may be closed by this pull request

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (4)
package.json (1)

28-31: Typo in build “files” entry likely excludes assets from packaging.
"src/assetes//*" should be "src/assets//*" (or remove if dist already includes assets).

     "files": [
       "dist/**/*",
       "src/core/**/*",
-      "src/assetes/**/*"
+      "src/assets/**/*"
     ],
src/app/components/files-table/files-table.component.ts (1)

27-27: Initialize allFiles to an empty array to avoid undefined access.
Prevents runtime errors if addFiles/addFile runs before the first allFiles$ emission.

-  allFiles!: CFile[];
+  allFiles: CFile[] = [];
src/app/components/control/control.component.ts (2)

1-12: Subscriptions in ngOnInit are not torn down (memory leak).

Use takeUntilDestroyed to auto-unsubscribe on component destroy.

Apply this diff:

 import {Component, OnInit} from '@angular/core';
+import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
@@
   ngOnInit() {
-    this.filesService.selectedFiles$.subscribe(files => {
-      this.selectedFiles = files;
-    });
+    this.filesService.selectedFiles$
+      .pipe(takeUntilDestroyed())
+      .subscribe(files => {
+        this.selectedFiles = files;
+      });
 
-    this.filesService.allFiles$.subscribe(files => {
-      this.allFiles = files;
-    });
+    this.filesService.allFiles$
+      .pipe(takeUntilDestroyed())
+      .subscribe(files => {
+        this.allFiles = files;
+      });
   }

Also applies to: 36-44


27-28: Initialize arrays to avoid undefined access in template and helpers.

Prevents possible runtime errors when calling .some() before the first emission.

-  allFiles!: CFile[];
-  selectedFiles!: CFile[];
+  allFiles: CFile[] = [];
+  selectedFiles: CFile[] = [];
🧹 Nitpick comments (9)
package.json (1)

117-117: Move jest to devDependencies.
Jest is only needed for tests; keeping it in dependencies bloats production install.

   "dependencies": {
@@
-    "jest": "^29.7.0",
@@
   },
   "devDependencies": {
@@
+    "jest": "^29.7.0",

Also applies to: 139-139

src/app/app.component.ts (1)

13-13: Avoid redundant imports: prefer NgIf or CommonModule, not both.
If you only need NgIf, drop CommonModule to keep the bundle lean.

-import {CommonModule, NgIf} from '@angular/common';
+import {NgIf} from '@angular/common';

Also remove CommonModule from the component imports array:

     ProgressSpinner,
     NgIf,
-    CommonModule,
src/app/components/files-table/files-table.component.ts (1)

89-92: Defensive check when reading allFiles.
In rare timing edge cases, use a fallback to ensure .some() is safe.

-  private addFile(inputFile: InputFile) {
-    const exists = this.allFiles.some(f => f.path === inputFile.path);
+  private addFile(inputFile: InputFile) {
+    const exists = (this.allFiles ?? []).some(f => f.path === inputFile.path);
src/app/components/files-table/files-table.component.spec.ts (1)

9-11: Trim unused UI modules from the testbed.
TooltipModule and PopoverModule appear unused after UI changes; removing them speeds up test compilation.

-import { TooltipModule } from 'primeng/tooltip';
-import { PopoverModule } from 'primeng/popover';
@@
-        TooltipModule,
-        PopoverModule
+

Also applies to: 77-79

src/app/components/control/control.component.ts (3)

63-69: Handle unknown type in switch and avoid silent no-ops.

Add a default branch to fail fast or log, and avoid adding undefined.

   showEncryptDialog(type: string): void {
     switch (type) {
       case 'ALL': this.fileEncryptionService.addFilesToPending(this.allFiles); break;
       case 'SELECTED': this.fileEncryptionService.addFilesToPending(this.selectedFiles); break;
+      default:
+        console.warn('showEncryptDialog: unsupported type', type);
+        return;
     }
     this.encryptDialogService.showEncryptDialog();
   }

71-77: Mirror the defensive default branch for decrypt path.

Keep behavior consistent and explicit on invalid input.

   showDecryptDialog(type: string): void {
     switch (type) {
       case 'ALL': this.fileEncryptionService.addFilesToPending(this.allFiles); break;
       case 'SELECTED': this.fileEncryptionService.addFilesToPending(this.selectedFiles); break;
+      default:
+        console.warn('showDecryptDialog: unsupported type', type);
+        return;
     }
     this.encryptDialogService.showDecryptDialog();
   }

26-26: Avoid any for Electron bridge; add a typed global.

Improves maintainability and DX.

Add a global type declaration (outside this file), e.g. in src/types/global.d.ts:

export {};

declare global {
  interface Window {
    electron?: {
      openFileDialog: () => void;
      // add other exposed APIs as needed
    };
  }
}

Then in the component:

electron = window.electron;
src/app/services/dialog.service.ts (1)

10-11: Mark public observables as readonly.

Prevents accidental reassignment and clarifies intent.

-  encryptDialogVisible$ = this.encryptDialogVisibleSubject.asObservable();
-  decryptDialogVisible$ = this.decryptDialogVisibleSubject.asObservable();
+  readonly encryptDialogVisible$ = this.encryptDialogVisibleSubject.asObservable();
+  readonly decryptDialogVisible$ = this.decryptDialogVisibleSubject.asObservable();
src/__tests__/core/handlers/app/main-instance-handler.spec.js (1)

22-22: Add assertions to verify menu wiring (build and set) in tests

You mock the return value, but there’s no assertion that the menu is actually built and applied. Add a focused test to ensure the wiring doesn’t regress.

Example test to add:

it('should build and set the application menu', () => {
  const builtMenu = { id: 'test-menu' };
  Menu.buildFromTemplate.mockReturnValue(builtMenu);

  initializeMainWindow();

  expect(Menu.buildFromTemplate).toHaveBeenCalledTimes(1);
  expect(Menu.setApplicationMenu).toHaveBeenCalledWith(builtMenu);
});
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b72cda and 9dfc8a1.

⛔ Files ignored due to path filters (4)
  • package-lock.json is excluded by !**/package-lock.json
  • src/assets/icons/signal.svg is excluded by !**/*.svg
  • src/assets/icons/threema.svg is excluded by !**/*.svg
  • src/assets/icons/whatsapp.svg is excluded by !**/*.svg
📒 Files selected for processing (36)
  • README.md (1 hunks)
  • package.json (1 hunks)
  • src/__tests__/core/handlers/app/main-instance-handler.spec.js (2 hunks)
  • src/__tests__/core/handlers/ipc/whatsapp-handler.spec.js (0 hunks)
  • src/app/app.component.html (0 hunks)
  • src/app/app.component.spec.ts (0 hunks)
  • src/app/app.component.ts (1 hunks)
  • src/app/components/control/control.component.html (0 hunks)
  • src/app/components/control/control.component.spec.ts (0 hunks)
  • src/app/components/control/control.component.ts (1 hunks)
  • src/app/components/dialogs/whats-app-contact-list-dialog/whats-app-contact-list-dialog.component.html (0 hunks)
  • src/app/components/dialogs/whats-app-contact-list-dialog/whats-app-contact-list-dialog.component.spec.ts (0 hunks)
  • src/app/components/dialogs/whats-app-contact-list-dialog/whats-app-contact-list-dialog.component.ts (0 hunks)
  • src/app/components/dialogs/whats-app-file-too-large/whats-app-file-too-large.component.html (0 hunks)
  • src/app/components/dialogs/whats-app-file-too-large/whats-app-file-too-large.component.spec.ts (0 hunks)
  • src/app/components/dialogs/whats-app-file-too-large/whats-app-file-too-large.component.ts (0 hunks)
  • src/app/components/dialogs/whats-app-qrdialog/whats-app-qrdialog.component.html (0 hunks)
  • src/app/components/dialogs/whats-app-qrdialog/whats-app-qrdialog.component.spec.ts (0 hunks)
  • src/app/components/dialogs/whats-app-qrdialog/whats-app-qrdialog.component.ts (0 hunks)
  • src/app/components/files-table/files-table.component.html (0 hunks)
  • src/app/components/files-table/files-table.component.spec.ts (1 hunks)
  • src/app/components/files-table/files-table.component.ts (1 hunks)
  • src/app/models/ccontact.spec.ts (0 hunks)
  • src/app/models/ccontact.ts (0 hunks)
  • src/app/services/dialog.service.spec.ts (0 hunks)
  • src/app/services/dialog.service.ts (1 hunks)
  • src/app/services/send-files.service.spec.ts (0 hunks)
  • src/app/services/send-files.service.ts (0 hunks)
  • src/app/services/whats-app.service.spec.ts (0 hunks)
  • src/app/services/whats-app.service.ts (0 hunks)
  • src/assets/i18n/en.json (0 hunks)
  • src/assets/i18n/ua.json (0 hunks)
  • src/core/electron-main.js (0 hunks)
  • src/core/handlers/app/main-instance-handler.js (2 hunks)
  • src/core/handlers/ipc/whatsapp-handler.js (0 hunks)
  • src/core/preload.js (0 hunks)
💤 Files with no reviewable changes (27)
  • src/app/services/send-files.service.spec.ts
  • src/app/app.component.html
  • src/app/app.component.spec.ts
  • src/app/components/control/control.component.html
  • src/app/components/dialogs/whats-app-file-too-large/whats-app-file-too-large.component.html
  • src/app/models/ccontact.spec.ts
  • src/app/services/dialog.service.spec.ts
  • src/app/components/dialogs/whats-app-contact-list-dialog/whats-app-contact-list-dialog.component.html
  • src/tests/core/handlers/ipc/whatsapp-handler.spec.js
  • src/app/components/dialogs/whats-app-file-too-large/whats-app-file-too-large.component.ts
  • src/app/components/dialogs/whats-app-file-too-large/whats-app-file-too-large.component.spec.ts
  • src/core/preload.js
  • src/core/electron-main.js
  • src/app/services/whats-app.service.spec.ts
  • src/app/components/dialogs/whats-app-qrdialog/whats-app-qrdialog.component.html
  • src/app/components/dialogs/whats-app-qrdialog/whats-app-qrdialog.component.spec.ts
  • src/app/components/files-table/files-table.component.html
  • src/app/services/send-files.service.ts
  • src/app/components/dialogs/whats-app-contact-list-dialog/whats-app-contact-list-dialog.component.ts
  • src/assets/i18n/ua.json
  • src/app/components/control/control.component.spec.ts
  • src/app/components/dialogs/whats-app-qrdialog/whats-app-qrdialog.component.ts
  • src/assets/i18n/en.json
  • src/app/services/whats-app.service.ts
  • src/app/components/dialogs/whats-app-contact-list-dialog/whats-app-contact-list-dialog.component.spec.ts
  • src/core/handlers/ipc/whatsapp-handler.js
  • src/app/models/ccontact.ts
🔇 Additional comments (10)
package.json (1)

6-6: Approve version bump; no leftover WhatsApp deps/refs found

Verified recursively that neither the source files nor package-lock.json reference whatsapp-web.js, angularx-qrcode, or WhatsApp.

  • package.json: version set to "0.8.1"
  • No residual references in codebase or lockfile
README.md (1)

46-49: LGTM: corrected step numbering.
Start step numbering now consistent after build step.

src/app/components/files-table/files-table.component.ts (1)

7-7: LGTM: import updated for template structural directives.
Importing NgIf directly is appropriate with standalone components.

src/app/components/files-table/files-table.component.spec.ts (1)

180-180: LGTM: updated expected column count to 8.
Matches removal of the WhatsApp “send” column.

src/app/components/control/control.component.ts (1)

8-8: NgIf import is correct for standalone usage.

Good addition to support structural directives in the template.

src/app/services/dialog.service.ts (1)

1-2: LGTM on service simplification.

Clean removal of WhatsApp state; encrypt/decrypt dialog streams remain intact.

src/__tests__/core/handlers/app/main-instance-handler.spec.js (2)

2-6: Electron Menu mock addition looks good

Mock shape matches usage in production. This is sufficient for isolating menu creation in tests.


10-10: Importing Menu alongside BrowserWindow is correct

Matches the updated production module usage and enables explicit assertions on menu behavior.

src/core/handlers/app/main-instance-handler.js (2)

1-1: Menu import is correct

Needed for building and setting the application menu; aligns with test updates.


63-63: Verify UX: autoHideMenuBar with an application menu

With autoHideMenuBar: true, the new menu will be hidden by default on Windows/Linux (shown on Alt). Confirm this matches the intended UX now that a standard menu exists.

Comment on lines +21 to +61
const menu = Menu.buildFromTemplate([
{
label: 'File',
submenu: [
{ role: 'quit' }
]
},
{
label: 'Edit',
submenu: [
{ role: 'undo' },
{ role: 'redo' },
{ type: 'separator' },
{ role: 'cut' },
{ role: 'copy' },
{ role: 'paste' },
{ role: 'selectall' }
]
},
{
label: 'View',
submenu: [
{ role: 'reload' },
{ role: 'forceReload' },
{ role: 'toggleDevTools' },
{ type: 'separator' },
{ role: 'resetZoom' },
{ role: 'zoomIn' },
{ role: 'zoomOut' },
{ type: 'separator' },
{ role: 'togglefullscreen' }
]
},
{
label: 'Window',
submenu: [
{ role: 'minimize' },
{ role: 'close' }
]
}
]);

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

Bug: role 'selectall' should be 'selectAll'

Electron role names are case-sensitive. Using 'selectall' will not invoke the standard role.

Apply this fix:

-        { role: 'selectall' }
+        { role: 'selectAll' }

Optional improvements:

  • Consider platform-specific templates (e.g., include { role: 'appMenu' } and { role: 'windowMenu' } on macOS, and use { role: isMac ? 'close' : 'quit' } under File).
  • Extract the template to a helper (e.g., buildAppMenuTemplate()) to keep initializeMainWindow lean.
📝 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
const menu = Menu.buildFromTemplate([
{
label: 'File',
submenu: [
{ role: 'quit' }
]
},
{
label: 'Edit',
submenu: [
{ role: 'undo' },
{ role: 'redo' },
{ type: 'separator' },
{ role: 'cut' },
{ role: 'copy' },
{ role: 'paste' },
{ role: 'selectall' }
]
},
{
label: 'View',
submenu: [
{ role: 'reload' },
{ role: 'forceReload' },
{ role: 'toggleDevTools' },
{ type: 'separator' },
{ role: 'resetZoom' },
{ role: 'zoomIn' },
{ role: 'zoomOut' },
{ type: 'separator' },
{ role: 'togglefullscreen' }
]
},
{
label: 'Window',
submenu: [
{ role: 'minimize' },
{ role: 'close' }
]
}
]);
const menu = Menu.buildFromTemplate([
{
label: 'File',
submenu: [
{ role: 'quit' }
]
},
{
label: 'Edit',
submenu: [
{ role: 'undo' },
{ role: 'redo' },
{ type: 'separator' },
{ role: 'cut' },
{ role: 'copy' },
{ role: 'paste' },
{ role: 'selectAll' }
]
},
{
label: 'View',
submenu: [
{ role: 'reload' },
{ role: 'forceReload' },
{ role: 'toggleDevTools' },
{ type: 'separator' },
{ role: 'resetZoom' },
{ role: 'zoomIn' },
{ role: 'zoomOut' },
{ type: 'separator' },
{ role: 'togglefullscreen' }
]
},
{
label: 'Window',
submenu: [
{ role: 'minimize' },
{ role: 'close' }
]
}
]);
🤖 Prompt for AI Agents
In src/core/handlers/app/main-instance-handler.js between lines 21 and 61, the
menu template uses the role 'selectall' which is incorrect due to case
sensitivity in Electron; it should be 'selectAll'. Update the role to
'selectAll' to ensure the standard role is invoked properly. Optionally,
refactor the menu template into a helper function and consider platform-specific
menu adjustments for better maintainability and user experience.

@vansisto vansisto merged commit 6a55f3b into main Aug 8, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove sending via messangers

1 participant