diff --git a/apps/comments/appinfo/app.php b/apps/comments/appinfo/app.php
index 6d6775dd1527b37f265add5d86c814f68e9b2017..491b4f7648083ce2101cf58becee685d30c8e2b8 100644
--- a/apps/comments/appinfo/app.php
+++ b/apps/comments/appinfo/app.php
@@ -21,5 +21,4 @@
  *
  */
 
-$application = new \OCA\Comments\AppInfo\Application();
-$application->register();
+\OC::$server->query(\OCA\Comments\AppInfo\Application::class);
diff --git a/apps/comments/composer/composer/autoload_classmap.php b/apps/comments/composer/composer/autoload_classmap.php
index 4f2cfaebde55eb2a06fa02b566a7943d687f73ae..ef14522c9c96c2cdcca2e3165e6c6fc59b2ae40c 100644
--- a/apps/comments/composer/composer/autoload_classmap.php
+++ b/apps/comments/composer/composer/autoload_classmap.php
@@ -16,6 +16,7 @@ return array(
     'OCA\\Comments\\EventHandler' => $baseDir . '/../lib/EventHandler.php',
     'OCA\\Comments\\JSSettingsHelper' => $baseDir . '/../lib/JSSettingsHelper.php',
     'OCA\\Comments\\Listener\\LoadAdditionalScripts' => $baseDir . '/../lib/Listener/LoadAdditionalScripts.php',
+    'OCA\\Comments\\Listener\\LoadSidebarScripts' => $baseDir . '/../lib/Listener/LoadSidebarScripts.php',
     'OCA\\Comments\\Notification\\Listener' => $baseDir . '/../lib/Notification/Listener.php',
     'OCA\\Comments\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php',
     'OCA\\Comments\\Search\\Provider' => $baseDir . '/../lib/Search/Provider.php',
diff --git a/apps/comments/composer/composer/autoload_static.php b/apps/comments/composer/composer/autoload_static.php
index 685a2d3296b9f83ada6fa821f5a5a4bc4b14e17e..68733b4c03863db184e01768f2bb46b4bc261e36 100644
--- a/apps/comments/composer/composer/autoload_static.php
+++ b/apps/comments/composer/composer/autoload_static.php
@@ -31,6 +31,7 @@ class ComposerStaticInitComments
         'OCA\\Comments\\EventHandler' => __DIR__ . '/..' . '/../lib/EventHandler.php',
         'OCA\\Comments\\JSSettingsHelper' => __DIR__ . '/..' . '/../lib/JSSettingsHelper.php',
         'OCA\\Comments\\Listener\\LoadAdditionalScripts' => __DIR__ . '/..' . '/../lib/Listener/LoadAdditionalScripts.php',
+        'OCA\\Comments\\Listener\\LoadSidebarScripts' => __DIR__ . '/..' . '/../lib/Listener/LoadSidebarScripts.php',
         'OCA\\Comments\\Notification\\Listener' => __DIR__ . '/..' . '/../lib/Notification/Listener.php',
         'OCA\\Comments\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php',
         'OCA\\Comments\\Search\\Provider' => __DIR__ . '/..' . '/../lib/Search/Provider.php',
diff --git a/apps/comments/lib/AppInfo/Application.php b/apps/comments/lib/AppInfo/Application.php
index 793d1e9f7bec091c29b3a75c0a53a76a67427f67..e2f79c963810b0642fb169177e54be4b4d84d938 100644
--- a/apps/comments/lib/AppInfo/Application.php
+++ b/apps/comments/lib/AppInfo/Application.php
@@ -1,8 +1,9 @@
 <?php
 /**
- *
+ * @copyright Copyright (c) 2016, Arthur Schiwon <blizzz@arthur-schiwon.de>
  *
  * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ * @author John Molakvoæ <skjnldsv@protonmail.com>
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -27,33 +28,39 @@ use OCA\Comments\Controller\Notifications;
 use OCA\Comments\EventHandler;
 use OCA\Comments\JSSettingsHelper;
 use OCA\Comments\Listener\LoadAdditionalScripts;
+use OCA\Comments\Listener\LoadSidebarScripts;
 use OCA\Comments\Notification\Notifier;
 use OCA\Comments\Search\Provider;
 use OCA\Files\Event\LoadAdditionalScriptsEvent;
+use OCA\Files\Event\LoadSidebar;
 use OCP\AppFramework\App;
 use OCP\Comments\CommentsEntityEvent;
 use OCP\EventDispatcher\IEventDispatcher;
 use OCP\Util;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
 class Application extends App {
 
+	const APP_ID = 'comments';
+
 	public function __construct (array $urlParams = array()) {
-		parent::__construct('comments', $urlParams);
+		parent::__construct(self::APP_ID, $urlParams);
 		$container = $this->getContainer();
 
 		$container->registerAlias('NotificationsController', Notifications::class);
 
 		$jsSettingsHelper = new JSSettingsHelper($container->getServer());
 		Util::connectHook('\OCP\Config', 'js', $jsSettingsHelper, 'extend');
+
+		$this->register();
 	}
 
-	public function register() {
+	private function register() {
 		$server = $this->getContainer()->getServer();
 
 		/** @var IEventDispatcher $newDispatcher */
 		$dispatcher = $server->query(IEventDispatcher::class);
-		$this->registerSidebarScripts($dispatcher);
+
+		$this->registerEventsScripts($dispatcher);
 		$this->registerDavEntity($dispatcher);
 		$this->registerNotifier();
 		$this->registerCommentsEventHandler();
@@ -61,8 +68,9 @@ class Application extends App {
 		$server->getSearch()->registerProvider(Provider::class, ['apps' => ['files']]);
 	}
 
-	protected function registerSidebarScripts(IEventDispatcher $dispatcher) {
+	protected function registerEventsScripts(IEventDispatcher $dispatcher) {
 		$dispatcher->addServiceListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScripts::class);
+		$dispatcher->addServiceListener(LoadSidebar::class, LoadSidebarScripts::class);
 	}
 
 	protected function registerDavEntity(IEventDispatcher $dispatcher) {
diff --git a/apps/comments/lib/Listener/LoadAdditionalScripts.php b/apps/comments/lib/Listener/LoadAdditionalScripts.php
index b1e9447beabacf337990f0016bafaa2928c1b006..a9c5c18a7c170b9737430301b8fbc1d236f74d41 100644
--- a/apps/comments/lib/Listener/LoadAdditionalScripts.php
+++ b/apps/comments/lib/Listener/LoadAdditionalScripts.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
  * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
  *
  * @author Roeland Jago Douma <roeland@famdouma.nl>
+ * @author John Molakvoæ <skjnldsv@protonmail.com>
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -24,6 +25,7 @@ declare(strict_types=1);
 
 namespace OCA\Comments\Listener;
 
+use OCA\Comments\AppInfo\Application;
 use OCA\Files\Event\LoadAdditionalScriptsEvent;
 use OCP\EventDispatcher\Event;
 use OCP\EventDispatcher\IEventListener;
@@ -35,7 +37,9 @@ class LoadAdditionalScripts implements IEventListener {
 			return;
 		}
 
-		Util::addScript('comments', 'comments');
+		// TODO: make sure to only include the sidebar script when 
+		// we properly split it between files list and sidebar
+		Util::addScript(Application::APP_ID, 'comments');
 	}
 
 }
diff --git a/apps/comments/lib/Listener/LoadSidebarScripts.php b/apps/comments/lib/Listener/LoadSidebarScripts.php
new file mode 100644
index 0000000000000000000000000000000000000000..b0468b2dd2eccb086897293424d2a6d8094cc417
--- /dev/null
+++ b/apps/comments/lib/Listener/LoadSidebarScripts.php
@@ -0,0 +1,45 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @author Roeland Jago Douma <roeland@famdouma.nl>
+ * @author John Molakvoæ <skjnldsv@protonmail.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Comments\Listener;
+
+use OCA\Comments\AppInfo\Application;
+use OCA\Files\Event\LoadSidebar;
+use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\IEventListener;
+use OCP\Util;
+
+class LoadSidebarScripts implements IEventListener {
+	public function handle(Event $event): void {
+		if (!($event instanceof LoadSidebar)) {
+			return;
+		}
+
+		// TODO: make sure to only include the sidebar script when 
+		// we properly split it between files list and sidebar
+		Util::addScript(Application::APP_ID, 'comments');
+	}
+
+}