aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/companion/PhrasesModule.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-29 10:12:17 +0100
committerDanilo M. <danix@danix.xyz>2026-10-29 10:12:17 +0100
commit0a7db3b48cce5f064c20f280e345a8bf1feb5ecb (patch)
treeeaf9c4be1a832893acf327019ef71a352d9d6647 /desktop/modules/companion/PhrasesModule.qml
parent28beb8a9600b6e74cab454401cc94c664d90bfe5 (diff)
downloadquickshell-0a7db3b48cce5f064c20f280e345a8bf1feb5ecb.tar.gz
quickshell-0a7db3b48cce5f064c20f280e345a8bf1feb5ecb.zip
companion: remove from the tree, archived as tag archive/companion
The chibi 2B companion is retired for now. Its last state is kept in the signed tag archive/companion (the commit before this one), so it can be revisited with `git checkout archive/companion`; hypr-theme carries a tag of the same name for its compositor hooks (typing/delete events and the SUPER+\ bind). Removed with it, since nothing else used them: the Companion, phrases and artists settings pages, the five companion prefs in Prefs.qml and Prefs.ready, the wallpaper heart (Admired.qml's list), the assistant's replied() signal and cardTop, and the keybinds reminder's name for the code:49 bind. The design specs and plans under docs/ stay as history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/companion/PhrasesModule.qml')
-rw-r--r--desktop/modules/companion/PhrasesModule.qml64
1 files changed, 0 insertions, 64 deletions
diff --git a/desktop/modules/companion/PhrasesModule.qml b/desktop/modules/companion/PhrasesModule.qml
deleted file mode 100644
index 7e4895a..0000000
--- a/desktop/modules/companion/PhrasesModule.qml
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (C) 2026 Danilo M. <danix@danix.xyz>
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2 as
-// published by the Free Software Foundation.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-import QtQuick
-import "../.."
-import "../../companion/Lines.js" as Lines
-
-// The lines the companion says when focus moves to a program she
-// recognizes, by its lowercased window class. They live in Prefs and she
-// reads them live, so a save needs no restart. The page edits a draft here;
-// Save hands it to Prefs, Reset drops the saved set so Lines.js' defaults
-// show again.
-Module {
- id: pm
- name: "phrases"
- label: "Companion phrases"
- // nf-fa-comment, present in Inconsolata Nerd Font.
- icon: "\uf075"
- settings: true
- group: "Companion"
- keywords: ["companion", "phrase", "line", "say", "speak", "app", "program",
- "window", "class", "firefox", "2b"]
- searchItems: pm.shown.map((a, i) => ({ text: a.cls + ": " + a.lines.join(" / "), key: "app:" + i }))
-
- // null while there are no edits: the page then shows the saved set, or
- // Lines.js' defaults when nothing is saved.
- property var draft: null
- // Reset was pressed: Save drops the saved set rather than saving a copy
- // of the defaults, so later default changes still arrive.
- property bool resetting: false
- readonly property var shown: pm.draft ?? Lines.appList(Prefs.companionApps)
- // Every app needs a class and at least one non-empty phrase; Save waits.
- readonly property bool valid: pm.shown.every(a => String(a.cls).trim() !== ""
- && (a.lines || []).some(l => String(l).trim() !== ""))
- dirty: pm.draft !== null
-
- function edit(list) { pm.draft = list; pm.resetting = false; }
- function reset() { pm.draft = Lines.appList(null); pm.resetting = true; }
- function save() {
- if (pm.resetting) Prefs.resetCompanionApps();
- else Prefs.setCompanionApps(Lines.toMap(pm.draft));
- pm.discard();
- }
- function discard() { pm.draft = null; pm.resetting = false; }
-
- page: Component {
- Page {
- title: "Companion phrases"
- actions: Component {
- SaveBar { dirty: pm.dirty; valid: pm.valid; note: "every app needs a class and a phrase"
- onSave: pm.save(); onDiscard: pm.discard() }
- }
- PhrasesPage { width: parent.width; owner: pm }
- }
- }
-}