From 1e7718865cf9001cf7045fbc6a22383a5f447c60 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Wed, 5 Apr 2023 12:34:52 +0200 Subject: [PATCH 1/3] fix: use better abbreviations for page names --- ui/menu/src/components/PageIcon.svelte | 3 ++- ui/menu/src/util/functions.ts | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ui/menu/src/components/PageIcon.svelte b/ui/menu/src/components/PageIcon.svelte index 3282623..7cf159f 100644 --- a/ui/menu/src/components/PageIcon.svelte +++ b/ui/menu/src/components/PageIcon.svelte @@ -3,6 +3,7 @@ import Icon from "./Icon.svelte"; import type { Website } from "talon-client"; import { talonConfig } from "../util/talonData"; + import { getAbbreviation } from "../util/functions"; export let website: Website; export let size = 40; @@ -15,7 +16,7 @@ ? `${talonConfig.internal}/icons/${website.subdomain}` : null} color={website.color} - alt={website.name.substring(0, 2)} + alt={getAbbreviation(website.name)} {size} {scale} /> diff --git a/ui/menu/src/util/functions.ts b/ui/menu/src/util/functions.ts index 4cc867e..3ab6f85 100644 --- a/ui/menu/src/util/functions.ts +++ b/ui/menu/src/util/functions.ts @@ -81,3 +81,23 @@ export function trimCommit(commit: string | undefined): string | undefined { export function isMobile(): boolean { return window.innerWidth < 768; } + +/** + * Get a 2-letter abbreviation of the website name. + * + * If the name consists of multiple words + * (separated by spaces, underscores or CamelCase), output + * the first letters of these words. + * + * Otherwise output the first letters of the name. + */ +export function getAbbreviation(name: string): string { + const split_sep = name + .replace(/([a-z])([A-Z])/g, "$1_$2") + .split(/[ ,.;_-]/) + .filter((x) => x.length > 0); + if (split_sep.length >= 2) { + return split_sep[0].charAt(0) + split_sep[1].charAt(0); + } + return name.substring(0, 2); +} From b38eabb27b84e932078990532d9455cdfdcd8283 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Wed, 5 Apr 2023 12:37:58 +0200 Subject: [PATCH 2/3] chore(release): bump version -> 0.4.1 --- Cargo.toml | 2 +- cliff.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3a0581f..bd8b1b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "talon" -version = "0.4.0" +version = "0.4.1" edition = "2021" authors = ["ThetaDev "] license = "MIT" diff --git a/cliff.toml b/cliff.toml index 1052d83..81432d7 100644 --- a/cliff.toml +++ b/cliff.toml @@ -48,7 +48,7 @@ commit_parsers = [ { message = "^refactor", group = "Refactor"}, { message = "^style", group = "Styling"}, { message = "^test", group = "Testing"}, - { message = "^chore\\(release\\): (prepare for|bump)", skip = true}, + { message = "^chore\\(release\\):", skip = true}, { message = "(^chore)|(^ci)", group = "Miscellaneous Tasks"}, { body = ".*security", group = "Security"}, ] From e8bb51d388f990b6c59e61c106a28199f41fc092 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Wed, 5 Apr 2023 12:38:20 +0200 Subject: [PATCH 3/3] chore(release): prepare for v0.4.1 --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e98e6f7..8a10bf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes to this project will be documented in this file. +## [0.4.1] - 2023-04-05 + +### Bug Fixes + +- Stop propagation of key events on menu search +- Use sh +- Remove version prefix from "latest" tag +- Detect CI commit SHA +- Use better abbreviations for page names + +### Features + +- Add upload script + ## [0.4.0] - 2023-04-02 ### Features