Skip to content

Instantly share code, notes, and snippets.

@vsvipul
Last active February 28, 2020 08:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vsvipul/a22818db200c98910f2b1bc1cdf5179f to your computer and use it in GitHub Desktop.
Save vsvipul/a22818db200c98910f2b1bc1cdf5179f to your computer and use it in GitHub Desktop.

GSoC 2019 Work Product: Zulip Desktop

Vipul Sharma | GitHub | Email | LinkedIn | View Project

I. Introduction

I want to thank the Zulip Community for providing me with such a great experience this summer. I would also like to thank my mentors @abhigyank and @akashnimare for their continuous guidance before and throughout the summer. Also, would like to thank @priyank-p for his help with the typescript migration. Over the GSoC period, I worked on the development of Zulip's desktop app (contribution graph). I worked on several high priority issues and fixing those. I also worked on the typescript migration of the app and also on migrating the app from webview to BrowserView.

II. Brief Highlights

1. Typescript Migration

TypeScript is an open-source programming language created by Microsoft. It can be considered a superset of JavaScript, that extends JS by adding support for types. Typescript has grown rapidly in recent years and migrating our entire codebase to TypeScript was one of my GSoC objectives, which was fully completed and merged after the first phase of GSoC.

2. Migrating to BrowserView

To understand more about BrowserView, first one needs to know a little about electron and webview. To embed remote apps into a BrowserWindow, we use webviews, which is based on chromium, which makes it prone to bugs which are difficult for people at electron to fix and they need to be fixed in Chromium itself. BrowserView is similar to webview, except that it's contents are rendered in an entirely different process. Also, webview lives in the DOM heirarchy of the BrowserWindow, while BrowserView lives in the OS window heirarchy. This makes BrowserView faster and controlable and a more preferable option over webview.

This was one of my major contributions to the project which took a lot of time and testing. I began work on this after my first evaluation and the PR for this is still open and pending review. This will hopefully get merged in the coming weeks.

3. Detecting System Presence

There were a lot of requests from users to Zulip to let the app provide system-level presence (i.e., whether they're at their computer or not), not just app-level presence (i.e. whether they've interacted with the app or not.) This was also completed successfully and both webapp and desktop apps PRs are merged which implement this using the powerMonitor API of electron.

4. Linting

xo was used earlier for linting the JS files only (and not CSS and HTML files). I made PRs to add linting to HTML and CSS files using htmlhint and stylelint respectively. Also, xo was changed to use xo-typescript plugin because of the typescript migration. All of these changes were successfully completed and merged.

5. Other Minor Bug-fixes and Improvements

Apart from the above mentioned highlights, these are some of the smaller contributions i made to zulip-desktop.

  • Add an option to toggle Error Reporting.
  • Add option to copy zulip url to menu and sidebar.
  • Create new request-util.
  • Allow insecure requests on user approval.
  • Fixes to sidebar org cycling.
  • Fixes to focus switching when changing tabs.
  • Disable server-related menu items on non-server pages.
  • Limit the number of lines in log files.
  • Allow zoom options from numpad.
  • Fix open and download hover in night mode.
  • Fix broken electron check condition in webapp.

III. Contributions

The following PRs include the work for the above-mentioned highlights and also several other improvements and bug fixes.

Merged PRs

#643 - add request options

#644 - pdf-viewer: disable pdf-viewer window

#656 - sidebar and menu: add option to copy zulip url

#658 - build: add msi to build targets

#685 - Allow insecure requests on user approval.

#692 - sidebar: Fixes to org cycling

#698 - webview: fix focus after soft reload

#699 - lint: Implement CSS linting with stylelint

#715 - menu: Reorder file menu and add option to Add Organization.

#717 - shortcut: Allow zoom options from numpad.

#721 - nsis: Allow install without admin previliges.

#726 - lint: Implement HTML Linting with htmlhint and fix indent.

#729 - logs: Limit the number of lines in log files.

#731 - lint: Update css lint config to match zulip config.

#732 - settings: Add option to toggle Error Reporting.

#734 - focus: Fix focus after clicking back button.

#735 - menu: Remove minimize and close from File menu.

#747 - docs: Improve development guide.

#748 - system-presence: Add ability to detect system presence.

#772 - syntax: Minor bug fixes.

#780 - menu: Disable menu items on non-server pages.

#782 - Use TypeScript type checker for zulip-desktop codebase.

#12003 - desktop-presence: Add system presence detection using electron-bridge.

#11891 - image-action: Fix open and download hover highlight in night mode

#11880 - portico: fix broken electron check condition

Open PRs

#667 - pdf-view: add pdfjs implementation for opening pdfs

#793 - BrowserView: Remove webview and initialize BrowserView.

All PRs - zulip-desktop, zulip

All opened issues - zulip-desktop, zulip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment