Skip to content

Commit f354694

Browse files
authored
GNOME 46 (#44)
* Bump to GNOME 46 * MainWindow: Update About dialog to use latest GNOME style * MainWindow: Update Domain dialog to new GNOME style * MainWindow: Update Log Out dialog to new GNOME style * WebView: Fix cookies, fix add-site page * Lint: excess newlines * MetaInfo: Added brand colors, update release info * Remove 'Plausible' from .desktop name * Workflows: update to latest GitHub actions * Workflows: Update lint action
1 parent b744412 commit f354694

File tree

10 files changed

+97
-145
lines changed

10 files changed

+97
-145
lines changed

.github/workflows/flatpak.yml

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,25 @@
11
name: Flatpak
2-
3-
on: [push, pull_request]
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
47

58
concurrency:
69
group: ${{ github.workflow }}-${{ github.ref }}
710
cancel-in-progress: true
811

912
jobs:
1013
flatpak:
14+
name: Flathub
1115
runs-on: ubuntu-latest
12-
1316
container:
14-
image: bilelmoussaoui/flatpak-github-actions:gnome-42
17+
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-46
1518
options: --privileged
16-
17-
strategy:
18-
matrix:
19-
arch: [x86_64, aarch64]
20-
# Don't fail the whole workflow if one architecture fails
21-
fail-fast: false
2219
steps:
23-
- uses: actions/checkout@v2
24-
25-
- name: Install deps
26-
run: |
27-
dnf -y install docker
28-
if: ${{ matrix.arch == 'aarch64' }}
29-
30-
- name: Set up QEMU
31-
id: qemu
32-
uses: docker/setup-qemu-action@v1
33-
with:
34-
platforms: arm64
35-
if: ${{ matrix.arch == 'aarch64' }}
36-
37-
- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
20+
- uses: actions/checkout@v4
21+
- uses: flathub-infra/flatpak-github-actions/flatpak-builder@master
3822
with:
39-
bundle: plausible-${{ matrix.arch }}.flatpak
23+
bundle: tally.flatpak
4024
manifest-path: com.cassidyjames.plausible.json
4125
cache-key: "flatpak-builder-${{ github.sha }}"
42-
arch: ${{ matrix.arch }}

.github/workflows/lint.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
name: CI
2-
3-
on: [push, pull_request]
1+
name: Lint
2+
on:
3+
pull_request:
44

55
jobs:
66
lint:
7+
name: Vala Lint
78
runs-on: ubuntu-latest
9+
810
container:
911
image: valalang/lint
12+
1013
steps:
11-
- uses: actions/checkout@v1
12-
- name: Lint
13-
run: io.elementary.vala-lint -d .
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Lint
18+
run: io.elementary.vala-lint -d .

com.cassidyjames.plausible.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"app-id" : "com.cassidyjames.plausible",
33
"runtime" : "org.gnome.Platform",
4-
"runtime-version" : "43",
4+
"runtime-version" : "46",
55
"sdk" : "org.gnome.Sdk",
66
"command" : "com.cassidyjames.plausible",
77
"finish-args" : [

data/launcher.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Desktop Entry]
2-
Name=Tally for Plausible
2+
Name=Tally
33
GenericName=Web Analytics
44
Comment=See the stats on your Plausible dashboard
55
Categories=Network;GTK;

data/metainfo.xml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!-- Copyright 2021–2023 Cassidy James Blaede <c@ssidyjam.es> -->
2+
<!-- Copyright 2021–2024 Cassidy James Blaede <c@ssidyjam.es> -->
33
<component type="desktop">
44
<id>com.cassidyjames.plausible</id>
5-
<name>Tally for Plausible</name>
6-
<summary>Simple and privacy-friendly alternative to Google Analytics</summary>
5+
<name>Tally</name>
6+
<summary>Dashboard for Plausible Analytics</summary>
77
<metadata_license>CC-BY-SA-4.0</metadata_license>
88
<project_license>GPL-3.0-or-later</project_license>
99
<description>
@@ -40,6 +40,15 @@
4040
<control>touch</control>
4141
</supports>
4242
<releases>
43+
<release version="3.1.0" date="2024-04-22">
44+
<description>
45+
<p>Updated for GNOME 46</p>
46+
<ul>
47+
<li>Fixed “Add Website” page</li>
48+
<li>Dialogs follow the new GNOME style</li>
49+
</ul>
50+
</description>
51+
</release>
4352
<release version="3.0.1" date="2023-01-19">
4453
<description>
4554
<p>New icon thanks to Micah Ilbery! Rather than use the Plausible icon, Tally now has its own identity.</p>
@@ -115,22 +124,22 @@
115124
</releases>
116125
<screenshots>
117126
<screenshot type="default">
118-
<image>https://raw.githubusercontent.com/cassidyjames/tally/main/data/screenshots/dashboard-dark.png</image>
127+
<image>https://raw.githubusercontent.com/cassidyjames/tally/3.0.1/data/screenshots/dashboard-dark.png</image>
119128
</screenshot>
120129
<screenshot>
121-
<image>https://raw.githubusercontent.com/cassidyjames/tally/main/data/screenshots/dashboard-light.png</image>
130+
<image>https://raw.githubusercontent.com/cassidyjames/tally/3.0.1/data/screenshots/dashboard-light.png</image>
122131
</screenshot>
123132
<screenshot>
124-
<image>https://raw.githubusercontent.com/cassidyjames/tally/main/data/screenshots/sites-dark.png</image>
133+
<image>https://raw.githubusercontent.com/cassidyjames/tally/3.0.1/data/screenshots/sites-dark.png</image>
125134
</screenshot>
126135
<screenshot>
127-
<image>https://raw.githubusercontent.com/cassidyjames/tally/main/data/screenshots/sites-light.png</image>
136+
<image>https://raw.githubusercontent.com/cassidyjames/tally/3.0.1/data/screenshots/sites-light.png</image>
128137
</screenshot>
129138
<screenshot>
130-
<image>https://raw.githubusercontent.com/cassidyjames/tally/main/data/screenshots/login-dark.png</image>
139+
<image>https://raw.githubusercontent.com/cassidyjames/tally/3.0.1/data/screenshots/login-dark.png</image>
131140
</screenshot>
132141
<screenshot>
133-
<image>https://raw.githubusercontent.com/cassidyjames/tally/main/data/screenshots/login-light.png</image>
142+
<image>https://raw.githubusercontent.com/cassidyjames/tally/3.0.1/data/screenshots/login-light.png</image>
134143
</screenshot>
135144
</screenshots>
136145
<content_rating type="oars-1.1">
@@ -143,10 +152,7 @@
143152
<url type="help">https://cassidyjames.com/support</url>
144153
<!--url type="contact">https://cassidyjames.com/support</url-->
145154
<branding>
146-
<color type="primary">#5850EC</color>
155+
<color type="primary" scheme_preference="light">#b5b3fe</color>
156+
<color type="primary" scheme_preference="dark">#393499</color>
147157
</branding>
148-
<custom>
149-
<value key="x-appcenter-color-primary">#5850EC</value>
150-
<value key="x-appcenter-color-primary-text">#fff</value>
151-
</custom>
152158
</component>

meson.build

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project(
22
'com.cassidyjames.plausible',
33
'vala', 'c',
4-
version: '3.0.1'
4+
version: '3.1.0'
55
)
66

77
gnome = import('gnome')
@@ -29,15 +29,14 @@ executable(
2929
meson.project_name(),
3030
'src' / 'App.vala',
3131
'src' / 'MainWindow.vala',
32-
'src' / 'WebContext.vala',
3332
'src' / 'Widgets' / 'WebView.vala',
3433
asresources,
3534
config_file,
3635
dependencies: [
3736
dependency('glib-2.0'),
3837
dependency('gtk4'),
3938
dependency('libadwaita-1'),
40-
dependency('webkit2gtk-5.0'),
39+
dependency('webkitgtk-6.0'),
4140
meson.get_compiler('vala').find_library('posix'),
4241
],
4342
install: true

src/App.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* SPDX-License-Identifier: GPL-3.0-or-later
3-
* SPDX-FileCopyrightText: 2020–2023 Cassidy James Blaede <c@ssidyjam.es>
3+
* SPDX-FileCopyrightText: 2020–2024 Cassidy James Blaede <c@ssidyjam.es>
44
*/
55

66
public class Plausible.App : Adw.Application {

src/MainWindow.vala

Lines changed: 22 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* SPDX-License-Identifier: GPL-3.0-or-later
3-
* SPDX-FileCopyrightText: 2020–2023 Cassidy James Blaede <c@ssidyjam.es>
3+
* SPDX-FileCopyrightText: 2020–2024 Cassidy James Blaede <c@ssidyjam.es>
44
*/
55

66
public class Plausible.MainWindow : Adw.ApplicationWindow {
@@ -17,6 +17,7 @@ public class Plausible.MainWindow : Adw.ApplicationWindow {
1717
public MainWindow (Gtk.Application application) {
1818
Object (
1919
application: application,
20+
height_request: 180,
2021
icon_name: APP_ID,
2122
resizable: true,
2223
title: App.NAME,
@@ -29,7 +30,7 @@ public class Plausible.MainWindow : Adw.ApplicationWindow {
2930
var sites_button = new Gtk.Button.with_label ("Sites") {
3031
valign = Gtk.Align.CENTER
3132
};
32-
sites_button.get_style_context ().add_class ("back-button");
33+
sites_button.add_css_class ("back-button");
3334

3435
sites_revealer = new Gtk.Revealer () {
3536
transition_duration = 200,
@@ -38,12 +39,12 @@ public class Plausible.MainWindow : Adw.ApplicationWindow {
3839
sites_revealer.child = sites_button;
3940

4041
var site_menu = new Menu ();
41-
site_menu.append (_("Account Settings"), "win.account_settings");
42-
site_menu.append (_("Log Out…"), "win.log_out");
42+
site_menu.append (_("Account _Settings"), "win.account_settings");
43+
site_menu.append (_("_Log Out…"), "win.log_out");
4344

4445
var app_menu = new Menu ();
45-
app_menu.append (_("Custom Domain…"), "win.custom_domain");
46-
app_menu.append (_("About %s").printf (App.NAME), "win.about");
46+
app_menu.append (_("_Custom Domain…"), "win.custom_domain");
47+
app_menu.append (_("_About %s").printf (App.NAME), "win.about");
4748

4849
var menu = new Menu ();
4950
menu.append_section (null, site_menu);
@@ -52,13 +53,12 @@ public class Plausible.MainWindow : Adw.ApplicationWindow {
5253
var menu_button = new Gtk.MenuButton () {
5354
icon_name = "open-menu-symbolic",
5455
menu_model = menu,
55-
tooltip_text = _("Menu"),
56+
tooltip_text = _("Main Menu"),
5657
};
5758

5859
var header = new Adw.HeaderBar ();
5960
header.pack_start (sites_revealer);
6061
header.pack_end (menu_button);
61-
// header.pack_end (account_revealer);
6262

6363
web_view = new Plausible.WebView ();
6464

@@ -82,7 +82,7 @@ public class Plausible.MainWindow : Adw.ApplicationWindow {
8282
transition_duration = 400,
8383
transition_type = Gtk.StackTransitionType.UNDER_UP
8484
};
85-
stack.get_style_context ().add_class ("loading");
85+
stack.add_css_class ("loading");
8686
stack.add_named (status_page, "loading");
8787
stack.add_named (web_view, "web");
8888

@@ -153,21 +153,6 @@ public class Plausible.MainWindow : Adw.ApplicationWindow {
153153
web_view.uri != "https://" + domain + "/sites"
154154
);
155155

156-
// TODO: Figure out how to disable the relevant actions when on
157-
// these URIs.
158-
//
159-
// account_revealer.reveal_child = (
160-
// web_view.uri != "https://" + domain + "/login" &&
161-
// web_view.uri != "https://" + domain + "/register" &&
162-
// web_view.uri != "https://" + domain + "/password/request-reset"
163-
// );
164-
//
165-
// if (web_view.uri == "https://" + domain + "/settings") {
166-
// account_stack.visible_child_name = "logout";
167-
// } else {
168-
// account_stack.visible_child_name = "account";
169-
// }
170-
171156
App.settings.set_string ("current-url", web_view.uri);
172157
}
173158
}
@@ -226,20 +211,19 @@ public class Plausible.MainWindow : Adw.ApplicationWindow {
226211
domain_grid.attach (domain_label, 0, 0);
227212
domain_grid.attach (domain_entry, 1, 0);
228213

229-
var domain_dialog = new Adw.MessageDialog (
230-
this,
214+
var domain_dialog = new Adw.AlertDialog (
231215
"Set a Custom Domain",
232-
"If you’re self-hosting Plausible or using an instance other than <b>%s</b>, set the domain name here.".printf (domain)
216+
"If you’re self-hosting Plausible or using an instance other than <b>%s</b>, set the domain name.".printf (domain)
233217
) {
234218
body_use_markup = true,
235219
default_response = "save",
236220
extra_child = domain_grid,
237221
};
238-
domain_dialog.add_response ("close", "Cancel");
239-
domain_dialog.add_response ("save", _("Set Domain"));
222+
domain_dialog.add_response ("close", "_Cancel");
223+
domain_dialog.add_response ("save", _("_Set Domain"));
240224
domain_dialog.set_response_appearance ("save", Adw.ResponseAppearance.SUGGESTED);
241225

242-
domain_dialog.present ();
226+
domain_dialog.present (this);
243227

244228
domain_dialog.response.connect ((response_id) => {
245229
if (response_id == "save") {
@@ -262,19 +246,18 @@ public class Plausible.MainWindow : Adw.ApplicationWindow {
262246
private void on_log_out_activate () {
263247
string domain = App.settings.get_string ("domain");
264248

265-
var log_out_dialog = new Adw.MessageDialog (
266-
this,
249+
var log_out_dialog = new Adw.AlertDialog (
267250
"Log out of Plausible?",
268251
"You will need to re-enter your email and password for <b>%s</b> to log back in.".printf (domain)
269252
) {
270253
body_use_markup = true,
271254
default_response = "log_out"
272255
};
273-
log_out_dialog.add_response ("close", "Stay Logged In");
274-
log_out_dialog.add_response ("log_out", _("Log Out"));
256+
log_out_dialog.add_response ("close", "_Stay Logged In");
257+
log_out_dialog.add_response ("log_out", _("_Log Out"));
275258
log_out_dialog.set_response_appearance ("log_out", Adw.ResponseAppearance.DESTRUCTIVE);
276259

277-
log_out_dialog.present ();
260+
log_out_dialog.present (this);
278261

279262
log_out_dialog.response.connect ((response_id) => {
280263
if (response_id == "log_out") {
@@ -284,7 +267,7 @@ public class Plausible.MainWindow : Adw.ApplicationWindow {
284267
// Instead, we clear cookies then load /sites, which will prompt for
285268
// login before showing the dashboard once again.
286269

287-
web_view.get_website_data_manager ().clear.begin (
270+
web_view.network_session.get_website_data_manager ().clear.begin (
288271
WebKit.WebsiteDataTypes.COOKIES, 0, null, () => {
289272
debug ("Cleared cookies; going home.");
290273
web_view.load_uri ("https://" + domain + "/sites");
@@ -295,8 +278,8 @@ public class Plausible.MainWindow : Adw.ApplicationWindow {
295278
}
296279

297280
private void on_about_activate () {
298-
var about_window = new Adw.AboutWindow () {
299-
transient_for = this,
281+
var about_window = new Adw.AboutDialog () {
282+
// transient_for = this,
300283

301284
application_icon = APP_ID,
302285
application_name = _("%s for Plausible").printf (App.NAME),
@@ -333,6 +316,6 @@ Email: hello@plausible.io
333316
"""
334317
);
335318

336-
about_window.present ();
319+
about_window.present (this);
337320
}
338321
}

src/WebContext.vala

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)