add serchOrCreate for chats

This commit is contained in:
marlon-erler
2026-09-30 13:55:04 +02:00
parent f5a4a2d8ae
commit 71b7983a1a
6 changed files with 43 additions and 36 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ export function TaskPage(
on:enter={taskPageViewModel.createBoard}
placeholder={
coreViewModel.translations.general
.filterOrCreateLabel
.filterOrCreateLabel(coreViewModel.translations.chatPage.task.typeBoard)
}
></input>
</div>
+1 -1
View File
@@ -4,7 +4,7 @@ import ChatViewModel from "../../ViewModel/Chat/chatViewModel";
export function ChatEntry(chatViewModel: ChatViewModel) {
const view = (
<button
class="tile colored-tile chat-entry animate-highlight"
class="tile colored-tile chat-entry animate-highlight slide-up"
set:color={chatViewModel.settingsPageViewModel.color}
style="height: 8rem"
on:click={chatViewModel.open}
+8 -4
View File
@@ -29,15 +29,19 @@
flex-direction: column;
justify-content: start;
gap: var(--gap-between-tiles);
width: 100%;
min-width: 100%;
}
#home-page #chat-grid {
margin-top: var(--content-padding);
#home-page #overview-section {
gap: var(--gap-between-tiles);
}
#home-page #chat-section > button {
margin-bottom: var(--gap-between-tiles);
}
#home-page #chat-grid {
display: grid;
gap: var(--gap-between-tiles);
+9 -18
View File
@@ -9,6 +9,7 @@ import FileTransferViewModel from "../ViewModel/Global/fileTransferViewModel";
import CoreViewModel from "../ViewModel/Global/coreViewModel";
import ConnectionViewModel from "../ViewModel/Global/connectionViewModel";
import ChatListViewModel from "../ViewModel/Chat/chatListViewModel";
import {NewItemEntry} from "./Components/newItemEntry";
export function HomePage(
coreViewModel: CoreViewModel,
@@ -125,33 +126,23 @@ export function HomePage(
<div id="chat-section">
<div class="flex-row width-input">
<input
placeholder={
coreViewModel.translations.homePage.addChatPlaceholder
}
aria-label={
coreViewModel.translations.homePage.addChatAudioLabel
}
bind:value={chatListViewModel.newChatPrimaryChannel}
placeholder={
coreViewModel.translations.general
.filterOrCreateLabel(coreViewModel.translations.homePage.typeChat)
}
bind:value={chatListViewModel.chatQuery}
on:enter={chatListViewModel.createChat}
></input>
<button
class="primary"
aria-label={
coreViewModel.translations.homePage.addChatButton
}
on:click={chatListViewModel.createChat}
toggle:disabled={chatListViewModel.cannotCreateChat}
>
<span class="icon">add</span>
</button>
</div>
<hr></hr>
{NewItemEntry(coreViewModel, chatListViewModel.chatQuery, chatListViewModel.createChat)}
<div
id="chat-grid"
children:append={[
chatListViewModel.chatViewModels,
chatListViewModel.chatMatches,
ChatViewModelToChatEntry,
]}
></div>
+15 -6
View File
@@ -22,7 +22,7 @@ const englishTranslations = {
saveButton: "Save",
setButton: "Set",
filterOrCreateLabel: "Search or create",
filterOrCreateLabel: (type: string) => `Search or create ${type}`,
createLabel: (query: string) => `Create "${query}"`,
reloadAppButton: "Reload App",
@@ -72,7 +72,8 @@ const englishTranslations = {
///
addChatAudioLabel: "name of new chat",
typeChat: "chat",
addChatPlaceholder: "Add chat",
addChatButton: "Add chat",
},
@@ -292,6 +293,8 @@ const englishTranslations = {
noBoardSelected: "No board selected",
boardNotFound: "Board not found",
typeBoard: "board",
///
closeBoardButtonAudioLabel: "close board",
@@ -400,7 +403,7 @@ export const allTranslations: {
saveButton: "Speichern",
setButton: "OK",
filterOrCreateLabel: "Suchen oder erstellen",
filterOrCreateLabel: (type: string) => `${type} suchen oder erstellen`,
createLabel: (query: string) => `"${query}" erstellen`,
reloadAppButton: "Neu laden",
@@ -445,8 +448,9 @@ export const allTranslations: {
transferDataButton: "Daten übertragen",
updateButton: (version: string) => `Aktualisieren: ${version}`,
typeChat: "Chat",
addChatAudioLabel: "Name des neuen Chats",
addChatPlaceholder: "Chat hinzufügen",
addChatButton: "Chat hinzufügen",
},
@@ -654,6 +658,8 @@ export const allTranslations: {
task: {
noBoardSelected: "Kein Board ausgewählt",
boardNotFound: "Board nicht gefunden",
typeBoard: "Board",
closeBoardButtonAudioLabel: "board schließen",
toggleBoardButtonAudioLabel: "board-liste ein/ausblenden",
@@ -742,7 +748,7 @@ export const allTranslations: {
saveButton: "Guardar",
setButton: "OK",
filterOrCreateLabel: "Buscar o crear",
filterOrCreateLabel: (type: string) => `Buscar o crear ${type}`,
createLabel: (query: string) => `Crear "${query}"`,
reloadAppButton: "Recargar app",
@@ -787,8 +793,9 @@ export const allTranslations: {
transferDataButton: "Enviar o exportar archivos",
updateButton: (version: string) => `Actualizar a ${version}`,
typeChat: "chat",
addChatAudioLabel: "nombre del nuevo chat",
addChatPlaceholder: "Añadir chat",
addChatButton: "Añadir chat",
},
@@ -997,6 +1004,8 @@ export const allTranslations: {
task: {
noBoardSelected: "Ningún tablero seleccionado",
boardNotFound: "Tablero no encontrado",
typeBoard: "board",
closeBoardButtonAudioLabel: "cerrar tablero",
toggleBoardButtonAudioLabel: