do not show namespaces in marquee

This commit is contained in:
marlon-erler
2026-09-23 00:39:51 +02:00
parent 9607a9f80c
commit f0087cf1cf
6 changed files with 45 additions and 37 deletions
+28 -31
View File
@@ -5596,6 +5596,19 @@
); );
} }
// src/View/Components/deletableListItem.tsx
function DeletableListItem(coreViewModel2, text, primaryButton, ondelete) {
return /* @__PURE__ */ createElement("div", { class: "tile flex-row justify-apart align-center padding-0" }, /* @__PURE__ */ createElement("span", { class: "padding-h ellipsis" }, text), /* @__PURE__ */ createElement("div", { class: "flex-row justify-end" }, primaryButton, /* @__PURE__ */ createElement(
"button",
{
class: "danger",
"aria-label": coreViewModel2.translations.general.deleteItemButtonAudioLabel,
"on:click": ondelete
},
/* @__PURE__ */ createElement("span", { class: "icon" }, "delete")
)));
}
// src/View/Modals/searchModal.tsx // src/View/Modals/searchModal.tsx
function SearchModal(coreViewModel2, searchViewModel, headline, isOpen) { function SearchModal(coreViewModel2, searchViewModel, headline, isOpen) {
function close() { function close() {
@@ -5670,24 +5683,21 @@
function applySuggestion() { function applySuggestion() {
searchViewModel.search(suggestion); searchViewModel.search(suggestion);
} }
return /* @__PURE__ */ createElement("div", { class: "flex-row surface align-center" }, /* @__PURE__ */ createElement("span", { class: "width-100 flex-1 padding-h" }, suggestion), /* @__PURE__ */ createElement( return DeletableListItem(
"button", coreViewModel2,
{ suggestion,
class: "danger", /* @__PURE__ */ createElement(
"aria-label": coreViewModel2.translations.general.deleteButton, "button",
"on:click": deleteSuggestion {
}, class: "primary",
/* @__PURE__ */ createElement("span", { class: "icon" }, "delete") "aria-label": coreViewModel2.translations.general.applyButton,
), /* @__PURE__ */ createElement( "on:click": applySuggestion,
"button", "toggle:disabled": isApplied
{ },
class: "primary", /* @__PURE__ */ createElement("span", { class: "icon" }, "check")
"aria-label": coreViewModel2.translations.general.applyButton, ),
"on:click": applySuggestion, deleteSuggestion
"toggle:disabled": isApplied );
},
/* @__PURE__ */ createElement("span", { class: "icon" }, "check")
));
} }
// src/View/Components/colorPicker.tsx // src/View/Components/colorPicker.tsx
@@ -5982,19 +5992,6 @@
); );
} }
// src/View/Components/deletableListItem.tsx
function DeletableListItem(coreViewModel2, text, primaryButton, ondelete) {
return /* @__PURE__ */ createElement("div", { class: "tile flex-row justify-apart align-center padding-0" }, /* @__PURE__ */ createElement("span", { class: "padding-h ellipsis" }, text), /* @__PURE__ */ createElement("div", { class: "flex-row justify-end" }, primaryButton, /* @__PURE__ */ createElement(
"button",
{
class: "danger",
"aria-label": coreViewModel2.translations.general.deleteItemButtonAudioLabel,
"on:click": ondelete
},
/* @__PURE__ */ createElement("span", { class: "icon" }, "delete")
)));
}
// src/View/ChatPages/settingsPage.tsx // src/View/ChatPages/settingsPage.tsx
function SettingsPage(coreViewModel2, settingsPageViewModel) { function SettingsPage(coreViewModel2, settingsPageViewModel) {
settingsPageViewModel.loadData(); settingsPageViewModel.loadData();
Binary file not shown.
Binary file not shown.
+10
View File
@@ -102,4 +102,14 @@ export default class ChatListViewModel {
this.loadChats(); this.loadChats();
} }
// utility
stripNamespace = (fullChannel: string): string => {
for (const vm of this.chatViewModels.value) {
const fullReference = vm.chatModel.info.namespace + vm.chatModel.info.primaryChannel;
if (fullReference == fullChannel) return vm.chatModel.info.primaryChannel;
}
return fullChannel;
}
} }
Binary file not shown.
@@ -13,12 +13,11 @@ export default class NotificationViewModel {
// main // main
showNotification = (message: ChatMessage): void => { showNotification = (message: ChatMessage): void => {
const notification: Notification =
NotificationViewModel.createNotification(message);
if (this.seenMessageIds.has(message.id)) return; if (this.seenMessageIds.has(message.id)) return;
if (this.chatListViewModel.selectedChat.value == undefined) return; if (this.chatListViewModel.selectedChat.value == undefined) return;
const notification: Notification =
this.createNotification(message);
const currentChat = const currentChat =
this.chatListViewModel.selectedChat.value.chatModel this.chatListViewModel.selectedChat.value.chatModel
.unwrappedPrimaryChannel; .unwrappedPrimaryChannel;
@@ -83,13 +82,15 @@ export default class NotificationViewModel {
}; };
// init // init
constructor(public readonly chatListViewModel: ChatListViewModel) {} constructor(public chatListViewModel: ChatListViewModel) {}
// util // util
static createNotification(message: ChatMessage): Notification { createNotification(message: ChatMessage): Notification {
const fullChannel = ChatModel.splitChannel(message.channel)[0];
const chat = this.chatListViewModel.stripNamespace(fullChannel);
return { return {
messageId: message.id, messageId: message.id,
chat: ChatModel.splitChannel(message.channel)[0], chat,
sender: message.sender, sender: message.sender,
body: message.body, body: message.body,
}; };