We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Slim sidebar always showing scrollbars
On Wagtail 2.15.1, with Firefox 93, scrollbars are always showing on the slim sidebar, causing the logo to be clipped:

![image](https://user-images.githubusercontent.com/1093808/144216312-86e761d0-5813-410b-956f-e88da39cabab.png)
Slim sidebar always showing scrollbars
On Wagtail 2.15.1, with Firefox 93, scrollbars are always showing on the slim sidebar, causing the logo to be clipped:

![image](https://user-images.githubusercontent.com/1093808/144216312-86e761d0-5813-410b-956f-e88da39cabab.png)

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `wagtail/admin/ui/sidebar.py`
Content:
```
1 from typing import List
2 
3 from django import forms
4 from django.urls import reverse
5 from django.utils.functional import cached_property
6 
7 from wagtail.admin.staticfiles import versioned_static
8 from wagtail.core.telepath import Adapter, adapter
9 
10 
11 class BaseSidebarAdapter(Adapter):
12     @cached_property
13     def media(self):
14         return forms.Media(js=[
15             versioned_static('wagtailadmin/js/sidebar.js'),
16         ])
17 
18 
19 # Main menu
20 
21 class MenuItem:
22     def __init__(self, name: str, label: str, icon_name: str = '', classnames: str = ''):
23         self.name = name
24         self.label = label
25         self.icon_name = icon_name
26         self.classnames = classnames
27 
28     def js_args(self):
29         return [
30             {
31                 'name': self.name,
32                 'label': self.label,
33                 'icon_name': self.icon_name,
34                 'classnames': self.classnames,
35             }
36         ]
37 
38 
39 @adapter('wagtail.sidebar.LinkMenuItem', base=BaseSidebarAdapter)
40 class LinkMenuItem(MenuItem):
41     def __init__(self, name: str, label: str, url: str, icon_name: str = '', classnames: str = ''):
42         super().__init__(name, label, icon_name=icon_name, classnames=classnames)
43         self.url = url
44 
45     def js_args(self):
46         args = super().js_args()
47         args[0]['url'] = self.url
48         return args
49 
50     def __eq__(self, other):
51         return (
52             self.__class__ == other.__class__
53             and self.name == other.name
54             and self.label == other.label
55             and self.url == other.url
56             and self.icon_name == other.icon_name
57             and self.classnames == other.classnames
58         )
59 
60 
61 @adapter('wagtail.sidebar.SubMenuItem', base=BaseSidebarAdapter)
62 class SubMenuItem(MenuItem):
63     def __init__(self, name: str, label: str, menu_items: List[MenuItem], icon_name: str = '', classnames: str = '', footer_text: str = ''):
64         super().__init__(name, label, icon_name=icon_name, classnames=classnames)
65         self.menu_items = menu_items
66         self.footer_text = footer_text
67 
68     def js_args(self):
69         args = super().js_args()
70         args[0]['footer_text'] = self.footer_text
71         args.append(self.menu_items)
72         return args
73 
74     def __eq__(self, other):
75         return (
76             self.__class__ == other.__class__
77             and self.name == other.name
78             and self.label == other.label
79             and self.menu_items == other.menu_items
80             and self.icon_name == other.icon_name
81             and self.classnames == other.classnames
82             and self.footer_text == other.footer_text
83         )
84 
85 
86 @adapter('wagtail.sidebar.PageExplorerMenuItem', base=BaseSidebarAdapter)
87 class PageExplorerMenuItem(LinkMenuItem):
88     def __init__(self, name: str, label: str, url: str, start_page_id: int, icon_name: str = '', classnames: str = ''):
89         super().__init__(name, label, url, icon_name=icon_name, classnames=classnames)
90         self.start_page_id = start_page_id
91 
92     def js_args(self):
93         args = super().js_args()
94         args.append(self.start_page_id)
95         return args
96 
97     def __eq__(self, other):
98         return (
99             self.__class__ == other.__class__
100             and self.name == other.name
101             and self.label == other.label
102             and self.url == other.url
103             and self.start_page_id == other.start_page_id
104             and self.icon_name == other.icon_name
105             and self.classnames == other.classnames
106         )
107 
108 
109 # Modules
110 
111 @adapter('wagtail.sidebar.WagtailBrandingModule', base=BaseSidebarAdapter)
112 class WagtailBrandingModule:
113     def js_args(self):
114         return [
115             reverse('wagtailadmin_home'),
116             {
117                 'mobileLogo': versioned_static('wagtailadmin/images/wagtail-logo.svg'),
118                 'desktopLogoBody': versioned_static('wagtailadmin/images/logo-body.svg'),
119                 'desktopLogoTail': versioned_static('wagtailadmin/images/logo-tail.svg'),
120                 'desktopLogoEyeOpen': versioned_static('wagtailadmin/images/logo-eyeopen.svg'),
121                 'desktopLogoEyeClosed': versioned_static('wagtailadmin/images/logo-eyeclosed.svg'),
122             }
123         ]
124 
125 
126 @adapter('wagtail.sidebar.CustomBrandingModule', base=BaseSidebarAdapter)
127 class CustomBrandingModule:
128     def __init__(self, html, collapsible=False):
129         self.html = html
130         self.collapsible = collapsible
131 
132     def js_args(self):
133         return [
134             self.html,
135             self.collapsible,
136         ]
137 
138 
139 @adapter('wagtail.sidebar.SearchModule', base=BaseSidebarAdapter)
140 class SearchModule:
141     def __init__(self, search_area):
142         self.search_area = search_area
143 
144     def js_args(self):
145         return [
146             self.search_area.url
147         ]
148 
149 
150 @adapter('wagtail.sidebar.MainMenuModule', base=BaseSidebarAdapter)
151 class MainMenuModule:
152     def __init__(self, menu_items: List[MenuItem], account_menu_items: List[MenuItem], user):
153         self.menu_items = menu_items
154         self.account_menu_items = account_menu_items
155         self.user = user
156 
157     def js_args(self):
158         from wagtail.admin.templatetags.wagtailadmin_tags import avatar_url
159 
160         try:
161             first_name = self.user.first_name
162         except AttributeError:
163             first_name = None
164 
165         return [
166             self.menu_items,
167             self.account_menu_items,
168             {
169                 'name': first_name or self.user.get_username(),
170                 'avatarUrl': avatar_url(self.user, size=50),
171             }
172         ]
173
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/wagtail/admin/ui/sidebar.py b/wagtail/admin/ui/sidebar.py
--- a/wagtail/admin/ui/sidebar.py
+++ b/wagtail/admin/ui/sidebar.py
@@ -123,19 +123,6 @@
         ]
 
 
-@adapter('wagtail.sidebar.CustomBrandingModule', base=BaseSidebarAdapter)
-class CustomBrandingModule:
-    def __init__(self, html, collapsible=False):
-        self.html = html
-        self.collapsible = collapsible
-
-    def js_args(self):
-        return [
-            self.html,
-            self.collapsible,
-        ]
-
-
 @adapter('wagtail.sidebar.SearchModule', base=BaseSidebarAdapter)
 class SearchModule:
     def __init__(self, search_area):

{"golden_diff": "diff --git a/wagtail/admin/ui/sidebar.py b/wagtail/admin/ui/sidebar.py\n--- a/wagtail/admin/ui/sidebar.py\n+++ b/wagtail/admin/ui/sidebar.py\n@@ -123,19 +123,6 @@\n         ]\n \n \n-@adapter('wagtail.sidebar.CustomBrandingModule', base=BaseSidebarAdapter)\n-class CustomBrandingModule:\n-    def __init__(self, html, collapsible=False):\n-        self.html = html\n-        self.collapsible = collapsible\n-\n-    def js_args(self):\n-        return [\n-            self.html,\n-            self.collapsible,\n-        ]\n-\n-\n @adapter('wagtail.sidebar.SearchModule', base=BaseSidebarAdapter)\n class SearchModule:\n     def __init__(self, search_area):\n", "issue": "Slim sidebar always showing scrollbars\nOn Wagtail 2.15.1, with Firefox 93, scrollbars are always showing on the slim sidebar, causing the logo to be clipped:\r\n\r\n![image](https://user-images.githubusercontent.com/1093808/144216312-86e761d0-5813-410b-956f-e88da39cabab.png)\nSlim sidebar always showing scrollbars\nOn Wagtail 2.15.1, with Firefox 93, scrollbars are always showing on the slim sidebar, causing the logo to be clipped:\r\n\r\n![image](https://user-images.githubusercontent.com/1093808/144216312-86e761d0-5813-410b-956f-e88da39cabab.png)\n", "before_files": [{"content": "from typing import List\n\nfrom django import forms\nfrom django.urls import reverse\nfrom django.utils.functional import cached_property\n\nfrom wagtail.admin.staticfiles import versioned_static\nfrom wagtail.core.telepath import Adapter, adapter\n\n\nclass BaseSidebarAdapter(Adapter):\n    @cached_property\n    def media(self):\n        return forms.Media(js=[\n            versioned_static('wagtailadmin/js/sidebar.js'),\n        ])\n\n\n# Main menu\n\nclass MenuItem:\n    def __init__(self, name: str, label: str, icon_name: str = '', classnames: str = ''):\n        self.name = name\n        self.label = label\n        self.icon_name = icon_name\n        self.classnames = classnames\n\n    def js_args(self):\n        return [\n            {\n                'name': self.name,\n                'label': self.label,\n                'icon_name': self.icon_name,\n                'classnames': self.classnames,\n            }\n        ]\n\n\n@adapter('wagtail.sidebar.LinkMenuItem', base=BaseSidebarAdapter)\nclass LinkMenuItem(MenuItem):\n    def __init__(self, name: str, label: str, url: str, icon_name: str = '', classnames: str = ''):\n        super().__init__(name, label, icon_name=icon_name, classnames=classnames)\n        self.url = url\n\n    def js_args(self):\n        args = super().js_args()\n        args[0]['url'] = self.url\n        return args\n\n    def __eq__(self, other):\n        return (\n            self.__class__ == other.__class__\n            and self.name == other.name\n            and self.label == other.label\n            and self.url == other.url\n            and self.icon_name == other.icon_name\n            and self.classnames == other.classnames\n        )\n\n\n@adapter('wagtail.sidebar.SubMenuItem', base=BaseSidebarAdapter)\nclass SubMenuItem(MenuItem):\n    def __init__(self, name: str, label: str, menu_items: List[MenuItem], icon_name: str = '', classnames: str = '', footer_text: str = ''):\n        super().__init__(name, label, icon_name=icon_name, classnames=classnames)\n        self.menu_items = menu_items\n        self.footer_text = footer_text\n\n    def js_args(self):\n        args = super().js_args()\n        args[0]['footer_text'] = self.footer_text\n        args.append(self.menu_items)\n        return args\n\n    def __eq__(self, other):\n        return (\n            self.__class__ == other.__class__\n            and self.name == other.name\n            and self.label == other.label\n            and self.menu_items == other.menu_items\n            and self.icon_name == other.icon_name\n            and self.classnames == other.classnames\n            and self.footer_text == other.footer_text\n        )\n\n\n@adapter('wagtail.sidebar.PageExplorerMenuItem', base=BaseSidebarAdapter)\nclass PageExplorerMenuItem(LinkMenuItem):\n    def __init__(self, name: str, label: str, url: str, start_page_id: int, icon_name: str = '', classnames: str = ''):\n        super().__init__(name, label, url, icon_name=icon_name, classnames=classnames)\n        self.start_page_id = start_page_id\n\n    def js_args(self):\n        args = super().js_args()\n        args.append(self.start_page_id)\n        return args\n\n    def __eq__(self, other):\n        return (\n            self.__class__ == other.__class__\n            and self.name == other.name\n            and self.label == other.label\n            and self.url == other.url\n            and self.start_page_id == other.start_page_id\n            and self.icon_name == other.icon_name\n            and self.classnames == other.classnames\n        )\n\n\n# Modules\n\n@adapter('wagtail.sidebar.WagtailBrandingModule', base=BaseSidebarAdapter)\nclass WagtailBrandingModule:\n    def js_args(self):\n        return [\n            reverse('wagtailadmin_home'),\n            {\n                'mobileLogo': versioned_static('wagtailadmin/images/wagtail-logo.svg'),\n                'desktopLogoBody': versioned_static('wagtailadmin/images/logo-body.svg'),\n                'desktopLogoTail': versioned_static('wagtailadmin/images/logo-tail.svg'),\n                'desktopLogoEyeOpen': versioned_static('wagtailadmin/images/logo-eyeopen.svg'),\n                'desktopLogoEyeClosed': versioned_static('wagtailadmin/images/logo-eyeclosed.svg'),\n            }\n        ]\n\n\n@adapter('wagtail.sidebar.CustomBrandingModule', base=BaseSidebarAdapter)\nclass CustomBrandingModule:\n    def __init__(self, html, collapsible=False):\n        self.html = html\n        self.collapsible = collapsible\n\n    def js_args(self):\n        return [\n            self.html,\n            self.collapsible,\n        ]\n\n\n@adapter('wagtail.sidebar.SearchModule', base=BaseSidebarAdapter)\nclass SearchModule:\n    def __init__(self, search_area):\n        self.search_area = search_area\n\n    def js_args(self):\n        return [\n            self.search_area.url\n        ]\n\n\n@adapter('wagtail.sidebar.MainMenuModule', base=BaseSidebarAdapter)\nclass MainMenuModule:\n    def __init__(self, menu_items: List[MenuItem], account_menu_items: List[MenuItem], user):\n        self.menu_items = menu_items\n        self.account_menu_items = account_menu_items\n        self.user = user\n\n    def js_args(self):\n        from wagtail.admin.templatetags.wagtailadmin_tags import avatar_url\n\n        try:\n            first_name = self.user.first_name\n        except AttributeError:\n            first_name = None\n\n        return [\n            self.menu_items,\n            self.account_menu_items,\n            {\n                'name': first_name or self.user.get_username(),\n                'avatarUrl': avatar_url(self.user, size=50),\n            }\n        ]\n", "path": "wagtail/admin/ui/sidebar.py"}], "after_files": [{"content": "from typing import List\n\nfrom django import forms\nfrom django.urls import reverse\nfrom django.utils.functional import cached_property\n\nfrom wagtail.admin.staticfiles import versioned_static\nfrom wagtail.core.telepath import Adapter, adapter\n\n\nclass BaseSidebarAdapter(Adapter):\n    @cached_property\n    def media(self):\n        return forms.Media(js=[\n            versioned_static('wagtailadmin/js/sidebar.js'),\n        ])\n\n\n# Main menu\n\nclass MenuItem:\n    def __init__(self, name: str, label: str, icon_name: str = '', classnames: str = ''):\n        self.name = name\n        self.label = label\n        self.icon_name = icon_name\n        self.classnames = classnames\n\n    def js_args(self):\n        return [\n            {\n                'name': self.name,\n                'label': self.label,\n                'icon_name': self.icon_name,\n                'classnames': self.classnames,\n            }\n        ]\n\n\n@adapter('wagtail.sidebar.LinkMenuItem', base=BaseSidebarAdapter)\nclass LinkMenuItem(MenuItem):\n    def __init__(self, name: str, label: str, url: str, icon_name: str = '', classnames: str = ''):\n        super().__init__(name, label, icon_name=icon_name, classnames=classnames)\n        self.url = url\n\n    def js_args(self):\n        args = super().js_args()\n        args[0]['url'] = self.url\n        return args\n\n    def __eq__(self, other):\n        return (\n            self.__class__ == other.__class__\n            and self.name == other.name\n            and self.label == other.label\n            and self.url == other.url\n            and self.icon_name == other.icon_name\n            and self.classnames == other.classnames\n        )\n\n\n@adapter('wagtail.sidebar.SubMenuItem', base=BaseSidebarAdapter)\nclass SubMenuItem(MenuItem):\n    def __init__(self, name: str, label: str, menu_items: List[MenuItem], icon_name: str = '', classnames: str = '', footer_text: str = ''):\n        super().__init__(name, label, icon_name=icon_name, classnames=classnames)\n        self.menu_items = menu_items\n        self.footer_text = footer_text\n\n    def js_args(self):\n        args = super().js_args()\n        args[0]['footer_text'] = self.footer_text\n        args.append(self.menu_items)\n        return args\n\n    def __eq__(self, other):\n        return (\n            self.__class__ == other.__class__\n            and self.name == other.name\n            and self.label == other.label\n            and self.menu_items == other.menu_items\n            and self.icon_name == other.icon_name\n            and self.classnames == other.classnames\n            and self.footer_text == other.footer_text\n        )\n\n\n@adapter('wagtail.sidebar.PageExplorerMenuItem', base=BaseSidebarAdapter)\nclass PageExplorerMenuItem(LinkMenuItem):\n    def __init__(self, name: str, label: str, url: str, start_page_id: int, icon_name: str = '', classnames: str = ''):\n        super().__init__(name, label, url, icon_name=icon_name, classnames=classnames)\n        self.start_page_id = start_page_id\n\n    def js_args(self):\n        args = super().js_args()\n        args.append(self.start_page_id)\n        return args\n\n    def __eq__(self, other):\n        return (\n            self.__class__ == other.__class__\n            and self.name == other.name\n            and self.label == other.label\n            and self.url == other.url\n            and self.start_page_id == other.start_page_id\n            and self.icon_name == other.icon_name\n            and self.classnames == other.classnames\n        )\n\n\n# Modules\n\n@adapter('wagtail.sidebar.WagtailBrandingModule', base=BaseSidebarAdapter)\nclass WagtailBrandingModule:\n    def js_args(self):\n        return [\n            reverse('wagtailadmin_home'),\n            {\n                'mobileLogo': versioned_static('wagtailadmin/images/wagtail-logo.svg'),\n                'desktopLogoBody': versioned_static('wagtailadmin/images/logo-body.svg'),\n                'desktopLogoTail': versioned_static('wagtailadmin/images/logo-tail.svg'),\n                'desktopLogoEyeOpen': versioned_static('wagtailadmin/images/logo-eyeopen.svg'),\n                'desktopLogoEyeClosed': versioned_static('wagtailadmin/images/logo-eyeclosed.svg'),\n            }\n        ]\n\n\n@adapter('wagtail.sidebar.SearchModule', base=BaseSidebarAdapter)\nclass SearchModule:\n    def __init__(self, search_area):\n        self.search_area = search_area\n\n    def js_args(self):\n        return [\n            self.search_area.url\n        ]\n\n\n@adapter('wagtail.sidebar.MainMenuModule', base=BaseSidebarAdapter)\nclass MainMenuModule:\n    def __init__(self, menu_items: List[MenuItem], account_menu_items: List[MenuItem], user):\n        self.menu_items = menu_items\n        self.account_menu_items = account_menu_items\n        self.user = user\n\n    def js_args(self):\n        from wagtail.admin.templatetags.wagtailadmin_tags import avatar_url\n\n        try:\n            first_name = self.user.first_name\n        except AttributeError:\n            first_name = None\n\n        return [\n            self.menu_items,\n            self.account_menu_items,\n            {\n                'name': first_name or self.user.get_username(),\n                'avatarUrl': avatar_url(self.user, size=50),\n            }\n        ]\n", "path": "wagtail/admin/ui/sidebar.py"}]}