summaryrefslogtreecommitdiff
path: root/src/modules/sidebar
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-10 19:56:40 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-10 19:56:40 +1000
commit6f62023574cb74036204ba57044ce8aa21a59b52 (patch)
tree345d19ac8f64fd18a770445564fa410e70362683 /src/modules/sidebar
parentnews: more sane default categories (diff)
downloadcaelestia-shell-6f62023574cb74036204ba57044ce8aa21a59b52.tar.gz
caelestia-shell-6f62023574cb74036204ba57044ce8aa21a59b52.tar.bz2
caelestia-shell-6f62023574cb74036204ba57044ce8aa21a59b52.zip
sidebar: better headlines
No tooltip, instead show title when expand Sort articles by source priority Also allow excluding domains and exclude google news by default (its just an aggregator so it causes lots of duplicates)
Diffstat (limited to 'src/modules/sidebar')
-rw-r--r--src/modules/sidebar/modules/headlines.tsx12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/modules/sidebar/modules/headlines.tsx b/src/modules/sidebar/modules/headlines.tsx
index 9515b28..462e2ee 100644
--- a/src/modules/sidebar/modules/headlines.tsx
+++ b/src/modules/sidebar/modules/headlines.tsx
@@ -2,7 +2,6 @@ import type { Monitor } from "@/services/monitors";
import News, { type IArticle } from "@/services/news";
import Palette, { type IPalette } from "@/services/palette";
import { capitalize } from "@/utils/strings";
-import { setupCustomTooltip } from "@/utils/widgets";
import { bind, execAsync, Variable } from "astal";
import { Gtk } from "astal/gtk3";
import { sidebar } from "config";
@@ -56,7 +55,7 @@ const Article = ({ title, description, creator, pubDate, source_name, link }: IA
<button className="wrapper" cursor="pointer" onClicked={() => expanded.set(!expanded.get())}>
<box hexpand className="header">
<box vertical>
- <label truncate xalign={0} label={title} setup={self => setupCustomTooltip(self, title)} />
+ <label truncate xalign={0} label={title} />
<label
truncate
xalign={0}
@@ -73,6 +72,7 @@ const Article = ({ title, description, creator, pubDate, source_name, link }: IA
>
<button onClicked={() => execAsync(`app2unit -O -- ${link}`)}>
<box vertical className="article-body">
+ <label wrap className="title" xalign={0} label={title} />
<label wrap xalign={0} label={`Published on ${new Date(pubDate).toLocaleString()}`} />
<label
wrap
@@ -119,9 +119,11 @@ const Category = ({ title, articles }: { title: string; articles: IArticle[] })
transitionDuration={200}
>
<box vertical className="body">
- {articles.map(a => (
- <Article {...a} />
- ))}
+ {articles
+ .sort((a, b) => a.source_priority - b.source_priority)
+ .map(a => (
+ <Article {...a} />
+ ))}
</box>
</revealer>
</box>