diff --git a/frontend/src/lib/components/project/Sidebar.svelte b/frontend/src/lib/components/project/Sidebar.svelte
index 04507ef..f5683bb 100644
--- a/frontend/src/lib/components/project/Sidebar.svelte
+++ b/frontend/src/lib/components/project/Sidebar.svelte
@@ -53,7 +53,7 @@
{project.title}
{#if views}
- {#each $views as view (view.id)}
+ {#each [...$views].sort(View.compare) as view (view.id)}
- {
diff --git a/frontend/src/lib/types/View.ts b/frontend/src/lib/types/View.ts
index 3d7ce8f..9fdeb0b 100644
--- a/frontend/src/lib/types/View.ts
+++ b/frontend/src/lib/types/View.ts
@@ -51,6 +51,10 @@ export default class View {
this._filters = filters;
}
+ static compare(a: View, b: View): number {
+ return a.title.localeCompare(b.title);
+ }
+
get id(): number {
return this._id;
}
@@ -166,6 +170,8 @@ export default class View {
this._title = title;
+ views.reload(this);
+
return true;
}