refactor: Spaces UX improvements

pull/744/head
krille-chan 2 years ago
parent ce3b1e22e8
commit d64b532afe
No known key found for this signature in database

@ -1335,8 +1335,6 @@
}, },
"homeserver": "الخادم", "homeserver": "الخادم",
"@homeserver": {}, "@homeserver": {},
"enterASpacepName": "أدخل اسم الفضاء",
"@enterASpacepName": {},
"enterAnEmailAddress": "أدخل عنوان بريد إلكتروني", "enterAnEmailAddress": "أدخل عنوان بريد إلكتروني",
"@enterAnEmailAddress": { "@enterAnEmailAddress": {
"type": "text", "type": "text",
@ -2382,8 +2380,6 @@
"@setChatDescription": {}, "@setChatDescription": {},
"directChat": "محادثة مباشرة", "directChat": "محادثة مباشرة",
"@directChat": {}, "@directChat": {},
"requests": "الطلبات",
"@requests": {},
"inviteGroupChat": "📨 دعوة الدردشة الجماعية", "inviteGroupChat": "📨 دعوة الدردشة الجماعية",
"@inviteGroupChat": {}, "@inviteGroupChat": {},
"invitePrivateChat": "📨 دعوة دردشة خاصة", "invitePrivateChat": "📨 دعوة دردشة خاصة",

@ -152,8 +152,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"device": "", "device": "",
"@device": { "@device": {
"type": "text", "type": "text",
@ -366,8 +364,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"requests": "",
"@requests": {},
"askSSSSSign": "", "askSSSSSign": "",
"@askSSSSSign": { "@askSSSSSign": {
"type": "text", "type": "text",

@ -129,8 +129,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"device": "", "device": "",
"@device": { "@device": {
"type": "text", "type": "text",
@ -353,8 +351,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"requests": "",
"@requests": {},
"askSSSSSign": "", "askSSSSSign": "",
"@askSSSSSign": { "@askSSSSSign": {
"type": "text", "type": "text",

@ -1633,8 +1633,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Introduïu un nom despai",
"@enterASpacepName": {},
"addAccount": "Afegeix un compte", "addAccount": "Afegeix un compte",
"@addAccount": {}, "@addAccount": {},
"noEncryptionForPublicRooms": "Només podreu activar el xifratge quan la sala ja no sigui accessible públicament.", "noEncryptionForPublicRooms": "Només podreu activar el xifratge quan la sala ja no sigui accessible públicament.",
@ -1948,8 +1946,6 @@
}, },
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",

@ -716,8 +716,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Zadejte název prostoru",
"@enterASpacepName": {},
"enterYourHomeserver": "Zadejte svůj domovský server", "enterYourHomeserver": "Zadejte svůj domovský server",
"@enterYourHomeserver": { "@enterYourHomeserver": {
"type": "text", "type": "text",
@ -2356,8 +2354,6 @@
"count": {} "count": {}
} }
}, },
"requests": "Žádosti",
"@requests": {},
"reportErrorDescription": "", "reportErrorDescription": "",
"@reportErrorDescription": {}, "@reportErrorDescription": {},
"banUserDescription": "", "banUserDescription": "",

@ -711,8 +711,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Namen für den Space eingeben",
"@enterASpacepName": {},
"enterYourHomeserver": "Gib Deinen Homeserver ein", "enterYourHomeserver": "Gib Deinen Homeserver ein",
"@enterYourHomeserver": { "@enterYourHomeserver": {
"type": "text", "type": "text",
@ -2382,8 +2380,6 @@
"@addChatDescription": {}, "@addChatDescription": {},
"setChatDescription": "Chatbeschreibung festlegen", "setChatDescription": "Chatbeschreibung festlegen",
"@setChatDescription": {}, "@setChatDescription": {},
"requests": "Anfragen",
"@requests": {},
"inviteGroupChat": "📨 Einladungen zum Gruppenchat", "inviteGroupChat": "📨 Einladungen zum Gruppenchat",
"@inviteGroupChat": {}, "@inviteGroupChat": {},
"invitePrivateChat": "📨 Einladungen zum privaten Chat", "invitePrivateChat": "📨 Einladungen zum privaten Chat",

@ -129,8 +129,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"device": "", "device": "",
"@device": { "@device": {
"type": "text", "type": "text",
@ -353,8 +351,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"requests": "",
"@requests": {},
"askSSSSSign": "", "askSSSSSign": "",
"@askSSSSSign": { "@askSSSSSign": {
"type": "text", "type": "text",

@ -805,8 +805,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Enter a space name",
"@enterASpacepName": {},
"homeserver": "Homeserver", "homeserver": "Homeserver",
"@homeserver": {}, "@homeserver": {},
"enterYourHomeserver": "Enter your homeserver", "enterYourHomeserver": "Enter your homeserver",
@ -2339,7 +2337,6 @@
"setTheme": "Set theme:", "setTheme": "Set theme:",
"setColorTheme": "Set color theme:", "setColorTheme": "Set color theme:",
"invite": "Invite", "invite": "Invite",
"requests": "Requests",
"inviteGroupChat": "📨 Invite group chat", "inviteGroupChat": "📨 Invite group chat",
"invitePrivateChat": "📨 Invite private chat", "invitePrivateChat": "📨 Invite private chat",
"invalidInput": "Invalid input!", "invalidInput": "Invalid input!",
@ -2388,5 +2385,7 @@
"passwordIsWrong": "Your entered password is wrong", "passwordIsWrong": "Your entered password is wrong",
"publicLink": "Public link", "publicLink": "Public link",
"joinSpace": "Join space", "joinSpace": "Join space",
"publicSpaces": "Public spaces" "publicSpaces": "Public spaces",
"addChatOrSubSpace": "Add chat or sub space",
"subspace": "Subspace"
} }

@ -705,8 +705,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Enigi nomon de aro",
"@enterASpacepName": {},
"enterYourHomeserver": "Enigu vian hejmservilon", "enterYourHomeserver": "Enigu vian hejmservilon",
"@enterYourHomeserver": { "@enterYourHomeserver": {
"type": "text", "type": "text",
@ -1978,8 +1976,6 @@
}, },
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",

@ -1615,8 +1615,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Ingrese nombre de espacio",
"@enterASpacepName": {},
"ignore": "Ignorar", "ignore": "Ignorar",
"@ignore": { "@ignore": {
"type": "text", "type": "text",
@ -2124,8 +2122,6 @@
"@user": {}, "@user": {},
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",
"@removeDevicesDescription": {}, "@removeDevicesDescription": {},
"separateChatTypes": "Separar chats directos de grupos", "separateChatTypes": "Separar chats directos de grupos",

@ -716,8 +716,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Sisesta kogukonna nimi",
"@enterASpacepName": {},
"enterYourHomeserver": "Sisesta oma koduserveri aadress", "enterYourHomeserver": "Sisesta oma koduserveri aadress",
"@enterYourHomeserver": { "@enterYourHomeserver": {
"type": "text", "type": "text",
@ -2382,8 +2380,6 @@
"reason": {} "reason": {}
} }
}, },
"requests": "Päringud",
"@requests": {},
"inviteGroupChat": "📨 Kutsu vestlusrühma", "inviteGroupChat": "📨 Kutsu vestlusrühma",
"@inviteGroupChat": {}, "@inviteGroupChat": {},
"invitePrivateChat": "📨 Kutsu omavahelisele vestlusele", "invitePrivateChat": "📨 Kutsu omavahelisele vestlusele",

@ -1281,8 +1281,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Sartu gunerako izena",
"@enterASpacepName": {},
"homeserver": "Zerbitzaria", "homeserver": "Zerbitzaria",
"@homeserver": {}, "@homeserver": {},
"errorObtainingLocation": "Errorea kokapena lortzerakoan: {error}", "errorObtainingLocation": "Errorea kokapena lortzerakoan: {error}",
@ -2331,8 +2329,6 @@
"@sendTypingNotifications": {}, "@sendTypingNotifications": {},
"setColorTheme": "Ezarri kolore-gaia:", "setColorTheme": "Ezarri kolore-gaia:",
"@setColorTheme": {}, "@setColorTheme": {},
"requests": "Eskaerak",
"@requests": {},
"tryAgain": "Saiatu berriro", "tryAgain": "Saiatu berriro",
"@tryAgain": {}, "@tryAgain": {},
"messagesStyle": "Mezuak:", "messagesStyle": "Mezuak:",

@ -985,8 +985,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "یک نام برای فضا وارد کنید",
"@enterASpacepName": {},
"errorObtainingLocation": "خطا هنگام بدست آوردن مکان: {error}", "errorObtainingLocation": "خطا هنگام بدست آوردن مکان: {error}",
"@errorObtainingLocation": { "@errorObtainingLocation": {
"type": "text", "type": "text",
@ -2311,8 +2309,6 @@
"@setColorTheme": {}, "@setColorTheme": {},
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",
"@removeDevicesDescription": {}, "@removeDevicesDescription": {},
"tryAgain": "", "tryAgain": "",

@ -1083,8 +1083,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Nimeä tila",
"@enterASpacepName": {},
"inoffensive": "Loukkaamatonta", "inoffensive": "Loukkaamatonta",
"@inoffensive": { "@inoffensive": {
"type": "text", "type": "text",
@ -2308,8 +2306,6 @@
"@pleaseTryAgainLaterOrChooseDifferentServer": {}, "@pleaseTryAgainLaterOrChooseDifferentServer": {},
"setColorTheme": "Aseta väriteema:", "setColorTheme": "Aseta väriteema:",
"@setColorTheme": {}, "@setColorTheme": {},
"requests": "Pyynnöt",
"@requests": {},
"tryAgain": "Yritä uudelleen", "tryAgain": "Yritä uudelleen",
"@tryAgain": {}, "@tryAgain": {},
"messagesStyle": "Viestit:", "messagesStyle": "Viestit:",

@ -720,8 +720,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Entrer un nom d'espace",
"@enterASpacepName": {},
"enterYourHomeserver": "Renseignez votre serveur d'accueil", "enterYourHomeserver": "Renseignez votre serveur d'accueil",
"@enterYourHomeserver": { "@enterYourHomeserver": {
"type": "text", "type": "text",
@ -2318,8 +2316,6 @@
"@setColorTheme": {}, "@setColorTheme": {},
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",
"@removeDevicesDescription": {}, "@removeDevicesDescription": {},
"tryAgain": "", "tryAgain": "",

@ -1389,8 +1389,6 @@
"error": {} "error": {}
} }
}, },
"enterASpacepName": "Cuir isteach ainm spáis",
"@enterASpacepName": {},
"enterAnEmailAddress": "Cuir isteach seoladh ríomhphoist", "enterAnEmailAddress": "Cuir isteach seoladh ríomhphoist",
"@enterAnEmailAddress": { "@enterAnEmailAddress": {
"type": "text", "type": "text",
@ -2018,8 +2016,6 @@
}, },
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",

@ -716,8 +716,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Escribe o nome para o espazo",
"@enterASpacepName": {},
"enterYourHomeserver": "Escribe o teu servidor de inicio", "enterYourHomeserver": "Escribe o teu servidor de inicio",
"@enterYourHomeserver": { "@enterYourHomeserver": {
"type": "text", "type": "text",
@ -2382,8 +2380,6 @@
"@directChat": {}, "@directChat": {},
"setChatDescription": "Escribir descrición da conversa", "setChatDescription": "Escribir descrición da conversa",
"@setChatDescription": {}, "@setChatDescription": {},
"requests": "Solicitudes",
"@requests": {},
"inviteGroupChat": "📨 Convidar a conversa en grupo", "inviteGroupChat": "📨 Convidar a conversa en grupo",
"@inviteGroupChat": {}, "@inviteGroupChat": {},
"invitePrivateChat": "📨 Convidar a conversa privada", "invitePrivateChat": "📨 Convidar a conversa privada",

@ -545,8 +545,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "הזן שם חלל",
"@enterASpacepName": {},
"enterYourHomeserver": "הזן את שרת הבית שלך", "enterYourHomeserver": "הזן את שרת הבית שלך",
"@enterYourHomeserver": { "@enterYourHomeserver": {
"type": "text", "type": "text",
@ -1486,8 +1484,6 @@
}, },
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"waitingPartnerAcceptRequest": "", "waitingPartnerAcceptRequest": "",

@ -129,8 +129,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"device": "", "device": "",
"@device": { "@device": {
"type": "text", "type": "text",
@ -353,8 +351,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"requests": "",
"@requests": {},
"askSSSSSign": "", "askSSSSSign": "",
"@askSSSSSign": { "@askSSSSSign": {
"type": "text", "type": "text",

@ -706,8 +706,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Upiši ime prostora",
"@enterASpacepName": {},
"enterYourHomeserver": "Upiši svoj domaći poslužitelj", "enterYourHomeserver": "Upiši svoj domaći poslužitelj",
"@enterYourHomeserver": { "@enterYourHomeserver": {
"type": "text", "type": "text",
@ -2331,8 +2329,6 @@
"@sendTypingNotifications": {}, "@sendTypingNotifications": {},
"setColorTheme": "Postavi boju teme:", "setColorTheme": "Postavi boju teme:",
"@setColorTheme": {}, "@setColorTheme": {},
"requests": "Zahtjevi",
"@requests": {},
"tryAgain": "Pokušaj ponovo", "tryAgain": "Pokušaj ponovo",
"@tryAgain": {}, "@tryAgain": {},
"messagesStyle": "Poruke:", "messagesStyle": "Poruke:",

@ -1454,8 +1454,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Add meg a tér nevét",
"@enterASpacepName": {},
"extremeOffensive": "Extrém sértő", "extremeOffensive": "Extrém sértő",
"@extremeOffensive": { "@extremeOffensive": {
"type": "text", "type": "text",
@ -1949,8 +1947,6 @@
}, },
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",

@ -1691,8 +1691,6 @@
}, },
"homeserver": "Homeserver", "homeserver": "Homeserver",
"@homeserver": {}, "@homeserver": {},
"enterASpacepName": "Masukkan nama space",
"@enterASpacepName": {},
"enableEncryption": "Aktifkan enkripsi", "enableEncryption": "Aktifkan enkripsi",
"@enableEncryption": { "@enableEncryption": {
"type": "text", "type": "text",
@ -2381,8 +2379,6 @@
"@setColorTheme": {}, "@setColorTheme": {},
"invite": "Undang", "invite": "Undang",
"@invite": {}, "@invite": {},
"requests": "Permintaan",
"@requests": {},
"inviteGroupChat": "📨 Undang percakapan grup", "inviteGroupChat": "📨 Undang percakapan grup",
"@inviteGroupChat": {}, "@inviteGroupChat": {},
"invitePrivateChat": "📨 Undang percakapan privat", "invitePrivateChat": "📨 Undang percakapan privat",

@ -1192,8 +1192,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"youAreNoLongerParticipatingInThisChat": "", "youAreNoLongerParticipatingInThisChat": "",
"@youAreNoLongerParticipatingInThisChat": { "@youAreNoLongerParticipatingInThisChat": {
"type": "text", "type": "text",
@ -1316,8 +1314,6 @@
}, },
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"askSSSSSign": "", "askSSSSSign": "",
"@askSSSSSign": { "@askSSSSSign": {
"type": "text", "type": "text",

@ -1864,8 +1864,6 @@
"@chatHasBeenAddedToThisSpace": {}, "@chatHasBeenAddedToThisSpace": {},
"unsupportedAndroidVersion": "Versione di Android non supportata", "unsupportedAndroidVersion": "Versione di Android non supportata",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "Inserisci un nome per lo spazio",
"@enterASpacepName": {},
"widgetJitsi": "Jitsi Meet", "widgetJitsi": "Jitsi Meet",
"@widgetJitsi": {}, "@widgetJitsi": {},
"messageType": "Tipo del Messaggio", "messageType": "Tipo del Messaggio",
@ -1916,8 +1914,6 @@
}, },
"banUserDescription": "L'utente sarà bannato dalla chat e non sarà in grado di rientrare finché non verrà sbannato.", "banUserDescription": "L'utente sarà bannato dalla chat e non sarà in grado di rientrare finché non verrà sbannato.",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "Richieste",
"@requests": {},
"widgetEtherpad": "Nota di testo", "widgetEtherpad": "Nota di testo",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"removeDevicesDescription": "Sarai disconnesso da questo dispositivo e non potrai più ricevere messaggi.", "removeDevicesDescription": "Sarai disconnesso da questo dispositivo e non potrai più ricevere messaggi.",

@ -1856,8 +1856,6 @@
"@youRejectedTheInvitation": {}, "@youRejectedTheInvitation": {},
"screenSharingDetail": "FuffyChatで画面を共有しています", "screenSharingDetail": "FuffyChatで画面を共有しています",
"@screenSharingDetail": {}, "@screenSharingDetail": {},
"enterASpacepName": "スペース名を入力してください",
"@enterASpacepName": {},
"homeserver": "ホームサーバー", "homeserver": "ホームサーバー",
"@homeserver": {}, "@homeserver": {},
"scanQrCode": "QRコードをスキャン", "scanQrCode": "QRコードをスキャン",
@ -2244,8 +2242,6 @@
}, },
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",

@ -166,8 +166,6 @@
}, },
"homeserver": "홈서버", "homeserver": "홈서버",
"@homeserver": {}, "@homeserver": {},
"enterASpacepName": "스페이스 이름 입력",
"@enterASpacepName": {},
"enterAnEmailAddress": "이메일 주소 입력", "enterAnEmailAddress": "이메일 주소 입력",
"@enterAnEmailAddress": { "@enterAnEmailAddress": {
"type": "text", "type": "text",
@ -2107,8 +2105,6 @@
}, },
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",

@ -1196,8 +1196,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Įveskite erdvės vardą",
"@enterASpacepName": {},
"send": "Siųsti", "send": "Siųsti",
"@send": { "@send": {
"type": "text", "type": "text",
@ -2246,8 +2244,6 @@
"@setColorTheme": {}, "@setColorTheme": {},
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",
"@removeDevicesDescription": {}, "@removeDevicesDescription": {},
"tryAgain": "", "tryAgain": "",

@ -129,8 +129,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"device": "", "device": "",
"@device": { "@device": {
"type": "text", "type": "text",
@ -353,8 +351,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"requests": "",
"@requests": {},
"askSSSSSign": "", "askSSSSSign": "",
"@askSSSSSign": { "@askSSSSSign": {
"type": "text", "type": "text",

@ -1706,8 +1706,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"commandHint_html": "", "commandHint_html": "",
"@commandHint_html": { "@commandHint_html": {
"type": "text", "type": "text",
@ -1773,8 +1771,6 @@
}, },
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",

@ -719,8 +719,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Vul een spacenaam in",
"@enterASpacepName": {},
"enterYourHomeserver": "Vul je homeserver in", "enterYourHomeserver": "Vul je homeserver in",
"@enterYourHomeserver": { "@enterYourHomeserver": {
"type": "text", "type": "text",
@ -2381,8 +2379,6 @@
"@setColorTheme": {}, "@setColorTheme": {},
"invite": "Uitnodigen", "invite": "Uitnodigen",
"@invite": {}, "@invite": {},
"requests": "Verzoeken",
"@requests": {},
"inviteGroupChat": "📨 Groeps-chat uitnodiging", "inviteGroupChat": "📨 Groeps-chat uitnodiging",
"@inviteGroupChat": {}, "@inviteGroupChat": {},
"invitePrivateChat": "📨 Privé-chat uitnodiging", "invitePrivateChat": "📨 Privé-chat uitnodiging",

@ -1614,8 +1614,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Podaj nazwę przestrzeni",
"@enterASpacepName": {},
"homeserver": "Adres serwera", "homeserver": "Adres serwera",
"@homeserver": {}, "@homeserver": {},
"locationDisabledNotice": "Usługi lokalizacji są wyłączone. Proszę włącz je aby móc udostępnić swoją lokalizację.", "locationDisabledNotice": "Usługi lokalizacji są wyłączone. Proszę włącz je aby móc udostępnić swoją lokalizację.",
@ -2304,8 +2302,6 @@
"@reportErrorDescription": {}, "@reportErrorDescription": {},
"setColorTheme": "Ustal styl kolorów:", "setColorTheme": "Ustal styl kolorów:",
"@setColorTheme": {}, "@setColorTheme": {},
"requests": "Żądania",
"@requests": {},
"tryAgain": "Spróbuj ponownie", "tryAgain": "Spróbuj ponownie",
"@tryAgain": {}, "@tryAgain": {},
"messagesStyle": "Wiadomości:", "messagesStyle": "Wiadomości:",

@ -237,8 +237,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"device": "", "device": "",
"@device": { "@device": {
"type": "text", "type": "text",
@ -451,8 +449,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"requests": "",
"@requests": {},
"askSSSSSign": "", "askSSSSSign": "",
"@askSSSSSign": { "@askSSSSSign": {
"type": "text", "type": "text",

@ -715,8 +715,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Insira um nome pro espaço",
"@enterASpacepName": {},
"enterYourHomeserver": "Insira um servidor matriz", "enterYourHomeserver": "Insira um servidor matriz",
"@enterYourHomeserver": { "@enterYourHomeserver": {
"type": "text", "type": "text",
@ -2281,8 +2279,6 @@
"@setColorTheme": {}, "@setColorTheme": {},
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",
"@removeDevicesDescription": {}, "@removeDevicesDescription": {},
"tryAgain": "", "tryAgain": "",

@ -674,8 +674,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Insere o nome do espaço",
"@enterASpacepName": {},
"homeserver": "Servidor", "homeserver": "Servidor",
"@homeserver": {}, "@homeserver": {},
"enterYourHomeserver": "Insere o teu servidor", "enterYourHomeserver": "Insere o teu servidor",
@ -1703,8 +1701,6 @@
}, },
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"waitingPartnerAcceptRequest": "", "waitingPartnerAcceptRequest": "",

@ -1884,8 +1884,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Introduceți nume pentru spațiu",
"@enterASpacepName": {},
"homeserver": "Homeserver", "homeserver": "Homeserver",
"@homeserver": {}, "@homeserver": {},
"errorObtainingLocation": "Obținerea locației a eșuat: {error}", "errorObtainingLocation": "Obținerea locației a eșuat: {error}",
@ -2311,8 +2309,6 @@
"@setColorTheme": {}, "@setColorTheme": {},
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",
"@removeDevicesDescription": {}, "@removeDevicesDescription": {},
"tryAgain": "", "tryAgain": "",

@ -716,8 +716,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Введите название пространства",
"@enterASpacepName": {},
"enterYourHomeserver": "Введите адрес вашего сервера Matrix", "enterYourHomeserver": "Введите адрес вашего сервера Matrix",
"@enterYourHomeserver": { "@enterYourHomeserver": {
"type": "text", "type": "text",
@ -2382,8 +2380,6 @@
"@setColorTheme": {}, "@setColorTheme": {},
"invite": "Пригласить", "invite": "Пригласить",
"@invite": {}, "@invite": {},
"requests": "Запросы",
"@requests": {},
"invitePrivateChat": "📨 Пригласить в приватный чат", "invitePrivateChat": "📨 Пригласить в приватный чат",
"@invitePrivateChat": {}, "@invitePrivateChat": {},
"inviteGroupChat": "📨 Пригласить в групповой чат", "inviteGroupChat": "📨 Пригласить в групповой чат",

@ -1362,8 +1362,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"commandHint_html": "", "commandHint_html": "",
"@commandHint_html": { "@commandHint_html": {
"type": "text", "type": "text",
@ -1434,8 +1432,6 @@
}, },
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",

@ -670,8 +670,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"device": "", "device": "",
"@device": { "@device": {
"type": "text", "type": "text",
@ -857,8 +855,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"waitingPartnerAcceptRequest": "", "waitingPartnerAcceptRequest": "",

@ -1840,8 +1840,6 @@
"@chatHasBeenAddedToThisSpace": {}, "@chatHasBeenAddedToThisSpace": {},
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"widgetJitsi": "", "widgetJitsi": "",
"@widgetJitsi": {}, "@widgetJitsi": {},
"messageType": "", "messageType": "",
@ -1892,8 +1890,6 @@
}, },
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",

@ -1730,8 +1730,6 @@
"error": {} "error": {}
} }
}, },
"enterASpacepName": "Ange utrymmets namn",
"@enterASpacepName": {},
"editRoomAliases": "Redigera rum alias", "editRoomAliases": "Redigera rum alias",
"@editRoomAliases": { "@editRoomAliases": {
"type": "text", "type": "text",
@ -2301,8 +2299,6 @@
"@setColorTheme": {}, "@setColorTheme": {},
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",
"@removeDevicesDescription": {}, "@removeDevicesDescription": {},
"tryAgain": "", "tryAgain": "",

@ -147,8 +147,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"device": "", "device": "",
"@device": { "@device": {
"type": "text", "type": "text",
@ -361,8 +359,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"requests": "",
"@requests": {},
"askSSSSSign": "", "askSSSSSign": "",
"@askSSSSSign": { "@askSSSSSign": {
"type": "text", "type": "text",

@ -339,8 +339,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"device": "", "device": "",
"@device": { "@device": {
"type": "text", "type": "text",
@ -556,8 +554,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"waitingPartnerAcceptRequest": "", "waitingPartnerAcceptRequest": "",

@ -720,8 +720,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Bir alan adı girin",
"@enterASpacepName": {},
"enterYourHomeserver": "Ana sunucunuzu girin", "enterYourHomeserver": "Ana sunucunuzu girin",
"@enterYourHomeserver": { "@enterYourHomeserver": {
"type": "text", "type": "text",
@ -2382,8 +2380,6 @@
"@chatDescriptionHasBeenChanged": {}, "@chatDescriptionHasBeenChanged": {},
"directChat": "Doğrudan sohbet", "directChat": "Doğrudan sohbet",
"@directChat": {}, "@directChat": {},
"requests": "İstek",
"@requests": {},
"inviteGroupChat": "📨 Grup sohbetine davet et", "inviteGroupChat": "📨 Grup sohbetine davet et",
"@inviteGroupChat": {}, "@inviteGroupChat": {},
"invitePrivateChat": "📨 Gizli sohbete davet et", "invitePrivateChat": "📨 Gizli sohbete davet et",

@ -1317,8 +1317,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"enterASpacepName": "Введіть назву простору",
"@enterASpacepName": {},
"joinRoom": "Приєднатися до кімнати", "joinRoom": "Приєднатися до кімнати",
"@joinRoom": { "@joinRoom": {
"type": "text", "type": "text",
@ -2382,8 +2380,6 @@
"@redactMessageDescription": {}, "@redactMessageDescription": {},
"setChatDescription": "Налаштувати опис бесіди", "setChatDescription": "Налаштувати опис бесіди",
"@setChatDescription": {}, "@setChatDescription": {},
"requests": "Запити",
"@requests": {},
"inviteGroupChat": "📨 Запросити до групової бесіди", "inviteGroupChat": "📨 Запросити до групової бесіди",
"@inviteGroupChat": {}, "@inviteGroupChat": {},
"invitePrivateChat": "📨 Запросити до приватної бесіди", "invitePrivateChat": "📨 Запросити до приватної бесіди",

@ -552,8 +552,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"commandHint_html": "", "commandHint_html": "",
"@commandHint_html": { "@commandHint_html": {
"type": "text", "type": "text",
@ -719,8 +717,6 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"requests": "",
"@requests": {},
"askSSSSSign": "", "askSSSSSign": "",
"@askSSSSSign": { "@askSSSSSign": {
"type": "text", "type": "text",

@ -1881,8 +1881,6 @@
"error": {} "error": {}
} }
}, },
"enterASpacepName": "输入空间名称",
"@enterASpacepName": {},
"createNewSpace": "创建新空间", "createNewSpace": "创建新空间",
"@createNewSpace": { "@createNewSpace": {
"type": "text", "type": "text",
@ -2382,8 +2380,6 @@
"reason": {} "reason": {}
} }
}, },
"requests": "请求",
"@requests": {},
"inviteGroupChat": "📨 邀请至群聊", "inviteGroupChat": "📨 邀请至群聊",
"@inviteGroupChat": {}, "@inviteGroupChat": {},
"invitePrivateChat": "📨 邀请至私聊", "invitePrivateChat": "📨 邀请至私聊",

@ -1825,8 +1825,6 @@
}, },
"unsupportedAndroidVersion": "", "unsupportedAndroidVersion": "",
"@unsupportedAndroidVersion": {}, "@unsupportedAndroidVersion": {},
"enterASpacepName": "",
"@enterASpacepName": {},
"commandHint_html": "", "commandHint_html": "",
"@commandHint_html": { "@commandHint_html": {
"type": "text", "type": "text",
@ -1882,8 +1880,6 @@
}, },
"banUserDescription": "", "banUserDescription": "",
"@banUserDescription": {}, "@banUserDescription": {},
"requests": "",
"@requests": {},
"widgetEtherpad": "", "widgetEtherpad": "",
"@widgetEtherpad": {}, "@widgetEtherpad": {},
"removeDevicesDescription": "", "removeDevicesDescription": "",

@ -95,6 +95,13 @@ class ChatListController extends State<ChatList>
}); });
} }
void createNewSpace() async {
final spaceId = await context.push<String?>('/rooms/newspace');
if (spaceId != null) {
setActiveSpace(spaceId);
}
}
int get selectedIndex { int get selectedIndex {
switch (activeFilter) { switch (activeFilter) {
case ActiveFilter.allChats: case ActiveFilter.allChats:

@ -66,8 +66,7 @@ class ChatListViewBody extends StatelessWidget {
.where((s) => s.hasRoomUpdate) .where((s) => s.hasRoomUpdate)
.rateLimit(const Duration(seconds: 1)), .rateLimit(const Duration(seconds: 1)),
builder: (context, _) { builder: (context, _) {
if (controller.activeFilter == ActiveFilter.spaces && if (controller.activeFilter == ActiveFilter.spaces) {
!controller.isSearchMode) {
return SpaceView( return SpaceView(
controller, controller,
scrollController: controller.scrollController, scrollController: controller.scrollController,

@ -212,6 +212,7 @@ class ChatListView extends StatelessWidget {
activeFilter: controller.activeFilter, activeFilter: controller.activeFilter,
roomsIsEmpty: false, roomsIsEmpty: false,
scrolledToTop: controller.scrolledToTop, scrolledToTop: controller.scrolledToTop,
createNewSpace: controller.createNewSpace,
) )
: const SizedBox.shrink(), : const SizedBox.shrink(),
), ),

@ -264,7 +264,7 @@ class ClientChooserButton extends StatelessWidget {
context.go('/rooms/newgroup'); context.go('/rooms/newgroup');
break; break;
case SettingsAction.newSpace: case SettingsAction.newSpace:
context.go('/rooms/newspace'); controller.createNewSpace();
break; break;
case SettingsAction.invite: case SettingsAction.invite:
FluffyShare.shareInviteLink(context); FluffyShare.shareInviteLink(context);

@ -5,6 +5,7 @@ import 'package:collection/collection.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:future_loading_dialog/future_loading_dialog.dart'; import 'package:future_loading_dialog/future_loading_dialog.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:matrix/matrix.dart' as sdk;
import 'package:matrix/matrix.dart'; import 'package:matrix/matrix.dart';
import 'package:fluffychat/pages/chat_list/chat_list.dart'; import 'package:fluffychat/pages/chat_list/chat_list.dart';
@ -30,23 +31,57 @@ class SpaceView extends StatefulWidget {
} }
class _SpaceViewState extends State<SpaceView> { class _SpaceViewState extends State<SpaceView> {
static final Map<String, Future<GetSpaceHierarchyResponse>> _requests = {}; static final Map<String, GetSpaceHierarchyResponse> _lastResponse = {};
String? prevBatch; String? prevBatch;
Object? error;
bool loading = false;
@override
void initState() {
loadHierarchy();
super.initState();
}
void _refresh() { void _refresh() {
_lastResponse.remove(widget.controller.activeSpaceId);
loadHierarchy();
}
Future<GetSpaceHierarchyResponse> loadHierarchy([String? prevBatch]) async {
final activeSpaceId = widget.controller.activeSpaceId!;
setState(() { setState(() {
_requests.remove(widget.controller.activeSpaceId); error = null;
loading = true;
}); });
}
Future<GetSpaceHierarchyResponse> getFuture(String activeSpaceId) => try {
_requests[activeSpaceId] ??= Matrix.of(context).client.getSpaceHierarchy( final response = await Matrix.of(context).client.getSpaceHierarchy(
activeSpaceId, activeSpaceId,
maxDepth: 1, maxDepth: 1,
from: prevBatch, from: prevBatch,
); );
if (prevBatch != null) {
response.rooms.insertAll(0, _lastResponse[activeSpaceId]?.rooms ?? []);
}
setState(() {
_lastResponse[activeSpaceId] = response;
});
return _lastResponse[activeSpaceId]!;
} catch (e) {
setState(() {
error = e;
});
rethrow;
} finally {
setState(() {
loading = false;
});
}
}
void _onJoinSpaceChild(SpaceRoomsChunk spaceChild) async { void _onJoinSpaceChild(SpaceRoomsChunk spaceChild) async {
final client = Matrix.of(context).client; final client = Matrix.of(context).client;
final space = client.getRoomById(widget.controller.activeSpaceId!); final space = client.getRoomById(widget.controller.activeSpaceId!);
@ -140,6 +175,91 @@ class _SpaceViewState extends State<SpaceView> {
} }
} }
void _addChatOrSubSpace() async {
final roomType = await showConfirmationDialog(
context: context,
title: L10n.of(context)!.addChatOrSubSpace,
actions: [
AlertDialogAction(
key: AddRoomType.subspace,
label: L10n.of(context)!.createNewSpace,
),
AlertDialogAction(
key: AddRoomType.chat,
label: L10n.of(context)!.createGroup,
),
],
);
if (roomType == null) return;
final names = await showTextInputDialog(
context: context,
title: roomType == AddRoomType.subspace
? L10n.of(context)!.createNewSpace
: L10n.of(context)!.createGroup,
textFields: [
DialogTextField(
hintText: roomType == AddRoomType.subspace
? L10n.of(context)!.spaceName
: L10n.of(context)!.groupName,
minLines: 1,
maxLines: 1,
maxLength: 64,
validator: (text) {
if (text == null || text.isEmpty) {
return L10n.of(context)!.pleaseChoose;
}
return null;
},
),
DialogTextField(
hintText: L10n.of(context)!.chatDescription,
minLines: 4,
maxLines: 8,
maxLength: 255,
),
],
okLabel: L10n.of(context)!.create,
cancelLabel: L10n.of(context)!.cancel,
);
if (names == null) return;
final client = Matrix.of(context).client;
final result = await showFutureLoadingDialog(
context: context,
future: () async {
late final String roomId;
final activeSpace = client.getRoomById(
widget.controller.activeSpaceId!,
)!;
if (roomType == AddRoomType.subspace) {
roomId = await client.createSpace(
name: names.first,
topic: names.last.isEmpty ? null : names.last,
visibility: activeSpace.joinRules == JoinRules.public
? sdk.Visibility.public
: sdk.Visibility.private,
);
} else {
roomId = await client.createGroupChat(
groupName: names.first,
initialState: names.length > 1 && names.last.isNotEmpty
? [
sdk.StateEvent(
type: sdk.EventTypes.RoomTopic,
content: {'topic': names.last},
),
]
: null,
);
}
await activeSpace.setSpaceChild(roomId);
},
);
if (result.error != null) return;
_refresh();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final client = Matrix.of(context).client; final client = Matrix.of(context).client;
@ -195,93 +315,93 @@ class _SpaceViewState extends State<SpaceView> {
], ],
); );
} }
return FutureBuilder<GetSpaceHierarchyResponse>(
future: getFuture(activeSpaceId), final parentSpace = allSpaces.firstWhereOrNull(
builder: (context, snapshot) { (space) =>
final response = snapshot.data; space.spaceChildren.any((child) => child.roomId == activeSpaceId),
final error = snapshot.error; );
if (error != null) { return PopScope(
return Column( canPop: parentSpace == null,
crossAxisAlignment: CrossAxisAlignment.center, onPopInvoked: (pop) async {
mainAxisAlignment: MainAxisAlignment.center, if (pop) return;
children: [ if (parentSpace != null) {
Padding( widget.controller.setActiveSpace(parentSpace.id);
padding: const EdgeInsets.all(16.0), }
child: Text(error.toLocalizedString(context)), },
child: CustomScrollView(
controller: widget.scrollController,
slivers: [
ChatListHeader(controller: widget.controller),
SliverAppBar(
titleSpacing: 0,
title: ListTile(
leading: BackButton(
onPressed: () =>
widget.controller.setActiveSpace(parentSpace?.id),
), ),
IconButton( title: Text(
onPressed: _refresh, parentSpace == null
icon: const Icon(Icons.refresh_outlined), ? L10n.of(context)!.allSpaces
: parentSpace.getLocalizedDisplayname(
MatrixLocals(L10n.of(context)!),
),
), ),
], trailing: IconButton(
); icon: loading
} ? const CircularProgressIndicator.adaptive(strokeWidth: 2)
if (response == null) { : const Icon(Icons.refresh_outlined),
return CustomScrollView( onPressed: loading ? null : _refresh,
slivers: [
ChatListHeader(controller: widget.controller),
const SliverFillRemaining(
child: Center(
child: CircularProgressIndicator.adaptive(),
),
), ),
], ),
); ),
} Builder(
final parentSpace = allSpaces.firstWhereOrNull( builder: (context) {
(space) => final response = _lastResponse[activeSpaceId];
space.spaceChildren.any((child) => child.roomId == activeSpaceId), final error = this.error;
); if (error != null) {
final spaceChildren = response.rooms; return SliverFillRemaining(
final canLoadMore = response.nextBatch != null; child: Column(
return PopScope( crossAxisAlignment: CrossAxisAlignment.center,
canPop: parentSpace == null, mainAxisAlignment: MainAxisAlignment.center,
onPopInvoked: (pop) async { children: [
if (pop) return; Padding(
if (parentSpace != null) { padding: const EdgeInsets.all(16.0),
widget.controller.setActiveSpace(parentSpace.id); child: Text(error.toLocalizedString(context)),
} ),
}, IconButton(
child: CustomScrollView( onPressed: _refresh,
controller: widget.scrollController, icon: const Icon(Icons.refresh_outlined),
slivers: [ ),
ChatListHeader(controller: widget.controller), ],
SliverList( ),
);
}
if (response == null) {
return SliverFillRemaining(
child: Center(
child: Text(L10n.of(context)!.loadingPleaseWait),
),
);
}
final spaceChildren = response.rooms;
final canLoadMore = response.nextBatch != null;
return SliverList(
delegate: SliverChildBuilderDelegate( delegate: SliverChildBuilderDelegate(
(context, i) { (context, i) {
if (i == 0) {
return ListTile(
leading: BackButton(
onPressed: () =>
widget.controller.setActiveSpace(parentSpace?.id),
),
title: Text(
parentSpace == null
? L10n.of(context)!.allSpaces
: parentSpace.getLocalizedDisplayname(
MatrixLocals(L10n.of(context)!),
),
),
trailing: IconButton(
icon: snapshot.connectionState != ConnectionState.done
? const CircularProgressIndicator.adaptive()
: const Icon(Icons.refresh_outlined),
onPressed:
snapshot.connectionState != ConnectionState.done
? null
: _refresh,
),
);
}
i--;
if (canLoadMore && i == spaceChildren.length) { if (canLoadMore && i == spaceChildren.length) {
return ListTile( return Padding(
title: Text(L10n.of(context)!.loadMore), padding: const EdgeInsets.all(16.0),
trailing: const Icon(Icons.chevron_right_outlined), child: OutlinedButton.icon(
onTap: () { label: loading
prevBatch = response.nextBatch; ? const LinearProgressIndicator()
_refresh(); : Text(L10n.of(context)!.loadMore),
}, icon: const Icon(Icons.chevron_right_outlined),
onPressed: loading
? null
: () {
loadHierarchy(response.nextBatch);
},
),
); );
} }
final spaceChild = spaceChildren[i]; final spaceChild = spaceChildren[i];
@ -299,85 +419,114 @@ class _SpaceViewState extends State<SpaceView> {
? null ? null
: spaceChild.topic; : spaceChild.topic;
if (spaceChild.roomId == activeSpaceId) { if (spaceChild.roomId == activeSpaceId) {
return SearchTitle( return Column(
title: spaceChild.name ?? mainAxisSize: MainAxisSize.min,
spaceChild.canonicalAlias ??
'Space',
icon: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Avatar(
size: 24,
mxContent: spaceChild.avatarUrl,
name: spaceChild.name,
fontSize: 9,
),
),
color: Theme.of(context)
.colorScheme
.secondaryContainer
.withAlpha(128),
trailing: const Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0),
child: Icon(Icons.edit_outlined),
),
onTap: () => _onJoinSpaceChild(spaceChild),
);
}
return ListTile(
leading: Avatar(
mxContent: spaceChild.avatarUrl,
name: spaceChild.name,
),
title: Row(
children: [ children: [
Expanded( SearchTitle(
child: Text( title: spaceChild.name ??
spaceChild.name ?? spaceChild.canonicalAlias ??
spaceChild.canonicalAlias ?? 'Space',
L10n.of(context)!.chat, icon: Padding(
maxLines: 1, padding:
style: const EdgeInsets.symmetric(horizontal: 10.0),
const TextStyle(fontWeight: FontWeight.bold), child: Avatar(
size: 24,
mxContent: spaceChild.avatarUrl,
name: spaceChild.name,
fontSize: 9,
),
), ),
color: Theme.of(context)
.colorScheme
.secondaryContainer
.withAlpha(128),
trailing: const Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0),
child: Icon(Icons.edit_outlined),
),
onTap: () => _onJoinSpaceChild(spaceChild),
), ),
if (!isSpace) ...[ Material(
const Icon( child: ListTile(
Icons.people_outline, leading: const CircleAvatar(
size: 16, child: Icon(Icons.group_add_outlined),
),
title: Text(L10n.of(context)!.addChatOrSubSpace),
trailing:
const Icon(Icons.chevron_right_outlined),
onTap: _addChatOrSubSpace,
), ),
const SizedBox(width: 4), ),
Text( ],
spaceChild.numJoinedMembers.toString(), );
style: const TextStyle(fontSize: 14), }
final name = spaceChild.name ??
spaceChild.canonicalAlias ??
L10n.of(context)!.chat;
if (widget.controller.isSearchMode &&
!name.toLowerCase().contains(
widget.controller.searchController.text,
)) {
return const SizedBox.shrink();
}
return Material(
child: ListTile(
leading: Avatar(
mxContent: spaceChild.avatarUrl,
name: spaceChild.name,
),
title: Row(
children: [
Expanded(
child: Text(
name,
maxLines: 1,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
),
), ),
if (!isSpace) ...[
const Icon(
Icons.people_outline,
size: 16,
),
const SizedBox(width: 4),
Text(
spaceChild.numJoinedMembers.toString(),
style: const TextStyle(fontSize: 14),
),
],
], ],
],
),
onTap: () => _onJoinSpaceChild(spaceChild),
onLongPress: () =>
_onSpaceChildContextMenu(spaceChild, room),
subtitle: Text(
topic ??
(isSpace
? L10n.of(context)!.enterSpace
: L10n.of(context)!.enterRoom),
maxLines: 1,
style: TextStyle(
color: Theme.of(context).colorScheme.onBackground,
), ),
onTap: () => room?.isSpace == true
? widget.controller.setActiveSpace(room!.id)
: _onSpaceChildContextMenu(spaceChild, room),
onLongPress: () =>
_onSpaceChildContextMenu(spaceChild, room),
subtitle: Text(
topic ??
(isSpace
? L10n.of(context)!.enterSpace
: L10n.of(context)!.enterRoom),
maxLines: 1,
style: TextStyle(
color: Theme.of(context).colorScheme.onBackground,
),
),
trailing: isSpace
? const Icon(Icons.chevron_right_outlined)
: null,
), ),
trailing: isSpace
? const Icon(Icons.chevron_right_outlined)
: null,
); );
}, },
childCount: spaceChildren.length + 1 + (canLoadMore ? 1 : 0), childCount: spaceChildren.length + (canLoadMore ? 1 : 0),
), ),
), );
], },
), ),
); ],
}, ),
); );
} }
} }
@ -387,3 +536,5 @@ enum SpaceChildContextAction {
leave, leave,
removeFromSpace, removeFromSpace,
} }
enum AddRoomType { chat, subspace }

@ -10,15 +10,17 @@ class StartChatFloatingActionButton extends StatelessWidget {
final ActiveFilter activeFilter; final ActiveFilter activeFilter;
final ValueNotifier<bool> scrolledToTop; final ValueNotifier<bool> scrolledToTop;
final bool roomsIsEmpty; final bool roomsIsEmpty;
final void Function() createNewSpace;
const StartChatFloatingActionButton({ const StartChatFloatingActionButton({
super.key, super.key,
required this.activeFilter, required this.activeFilter,
required this.scrolledToTop, required this.scrolledToTop,
required this.roomsIsEmpty, required this.roomsIsEmpty,
required this.createNewSpace,
}); });
void _onPressed(BuildContext context) { void _onPressed(BuildContext context) async {
switch (activeFilter) { switch (activeFilter) {
case ActiveFilter.allChats: case ActiveFilter.allChats:
case ActiveFilter.messages: case ActiveFilter.messages:
@ -28,7 +30,7 @@ class StartChatFloatingActionButton extends StatelessWidget {
context.go('/rooms/newgroup'); context.go('/rooms/newgroup');
break; break;
case ActiveFilter.spaces: case ActiveFilter.spaces:
context.go('/rooms/newspace'); createNewSpace();
break; break;
} }
} }

@ -1,11 +1,15 @@
import 'dart:typed_data';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:future_loading_dialog/future_loading_dialog.dart'; import 'package:file_picker/file_picker.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:matrix/matrix.dart' as sdk; import 'package:matrix/matrix.dart' as sdk;
import 'package:matrix/matrix.dart'; import 'package:matrix/matrix.dart';
import 'package:fluffychat/pages/new_space/new_space_view.dart'; import 'package:fluffychat/pages/new_space/new_space_view.dart';
import 'package:fluffychat/utils/localized_exception_extension.dart';
import 'package:fluffychat/widgets/matrix.dart'; import 'package:fluffychat/widgets/matrix.dart';
class NewSpace extends StatefulWidget { class NewSpace extends StatefulWidget {
@ -16,30 +20,82 @@ class NewSpace extends StatefulWidget {
} }
class NewSpaceController extends State<NewSpace> { class NewSpaceController extends State<NewSpace> {
TextEditingController controller = TextEditingController(); TextEditingController nameController = TextEditingController();
TextEditingController topicController = TextEditingController();
bool publicGroup = false; bool publicGroup = false;
bool loading = false;
String? nameError;
String? topicError;
Uint8List? avatar;
Uri? avatarUrl;
void selectPhoto() async {
final photo = await FilePicker.platform.pickFiles(
type: FileType.image,
allowMultiple: false,
withData: true,
);
setState(() {
avatarUrl = null;
avatar = photo?.files.singleOrNull?.bytes;
});
}
void setPublicGroup(bool b) => setState(() => publicGroup = b); void setPublicGroup(bool b) => setState(() => publicGroup = b);
void submitAction([_]) async { void submitAction([_]) async {
final matrix = Matrix.of(context); final client = Matrix.of(context).client;
final roomID = await showFutureLoadingDialog( setState(() {
context: context, nameError = topicError = null;
future: () => matrix.client.createRoom( });
if (nameController.text.isEmpty) {
setState(() {
nameError = L10n.of(context)!.pleaseChoose;
});
return;
}
setState(() {
loading = true;
});
try {
final avatar = this.avatar;
avatarUrl ??= avatar == null ? null : await client.uploadContent(avatar);
final spaceId = await client.createRoom(
preset: publicGroup preset: publicGroup
? sdk.CreateRoomPreset.publicChat ? sdk.CreateRoomPreset.publicChat
: sdk.CreateRoomPreset.privateChat, : sdk.CreateRoomPreset.privateChat,
creationContent: {'type': RoomCreationTypes.mSpace}, creationContent: {'type': RoomCreationTypes.mSpace},
visibility: publicGroup ? sdk.Visibility.public : null, visibility: publicGroup ? sdk.Visibility.public : null,
roomAliasName: publicGroup && controller.text.isNotEmpty roomAliasName: publicGroup
? controller.text.trim().toLowerCase().replaceAll(' ', '_') ? nameController.text.trim().toLowerCase().replaceAll(' ', '_')
: null, : null,
name: controller.text.isNotEmpty ? controller.text : null, name: nameController.text.trim(),
), topic: topicController.text.isEmpty ? null : topicController.text,
); powerLevelContentOverride: {'events_default': 100},
if (roomID.error == null) { initialState: [
context.go('/rooms/${roomID.result!}'); if (avatar != null)
sdk.StateEvent(
type: sdk.EventTypes.RoomAvatar,
content: {'url': avatarUrl.toString()},
),
],
);
if (!mounted) return;
context.pop<String>(spaceId);
} catch (e) {
setState(() {
topicError = e.toLocalizedString(context);
});
} finally {
setState(() {
loading = false;
});
} }
// TODO: Go to spaces
} }
@override @override

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:fluffychat/widgets/avatar.dart';
import 'package:fluffychat/widgets/layouts/max_width_body.dart'; import 'package:fluffychat/widgets/layouts/max_width_body.dart';
import 'new_space.dart'; import 'new_space.dart';
@ -12,6 +13,7 @@ class NewSpaceView extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final avatar = controller.avatar;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text(L10n.of(context)!.createNewSpace), title: Text(L10n.of(context)!.createNewSpace),
@ -20,40 +22,103 @@ class NewSpaceView extends StatelessWidget {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
ListTile(
trailing: const Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0),
child: Icon(Icons.info_outlined),
),
subtitle: Text(L10n.of(context)!.newSpaceDescription),
),
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InkWell(
borderRadius: BorderRadius.circular(90),
onTap: controller.loading ? null : controller.selectPhoto,
child: CircleAvatar(
radius: Avatar.defaultSize / 2,
child: avatar == null
? const Icon(Icons.camera_alt_outlined)
: ClipRRect(
borderRadius: BorderRadius.circular(90),
child: Image.memory(
avatar,
width: Avatar.defaultSize,
height: Avatar.defaultSize,
fit: BoxFit.cover,
),
),
),
),
const SizedBox(width: 16),
Expanded(
child: TextField(
controller: controller.nameController,
autocorrect: false,
readOnly: controller.loading,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.people_outlined),
hintText: L10n.of(context)!.spaceName,
errorText: controller.nameError,
),
),
),
],
),
),
const SizedBox(height: 16),
Padding( Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: TextField( child: TextField(
controller: controller.controller, controller: controller.topicController,
autofocus: true, minLines: 4,
autocorrect: false, maxLines: 4,
textInputAction: TextInputAction.go, maxLength: 255,
onSubmitted: controller.submitAction, readOnly: controller.loading,
decoration: InputDecoration( decoration: InputDecoration(
labelText: L10n.of(context)!.spaceName, hintText: L10n.of(context)!.addChatDescription,
prefixIcon: const Icon(Icons.people_outlined), errorText: controller.topicError,
hintText: L10n.of(context)!.enterASpacepName,
), ),
), ),
), ),
const SizedBox(height: 16),
SwitchListTile.adaptive( SwitchListTile.adaptive(
title: Text(L10n.of(context)!.spaceIsPublic), title: Text(L10n.of(context)!.spaceIsPublic),
value: controller.publicGroup, value: controller.publicGroup,
onChanged: controller.setPublicGroup, onChanged: controller.setPublicGroup,
), ),
ListTile( Padding(
trailing: const Padding( padding: const EdgeInsets.all(16.0),
padding: EdgeInsets.symmetric(horizontal: 16.0), child: SizedBox(
child: Icon(Icons.info_outlined), width: double.infinity,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: Theme.of(context).colorScheme.onPrimary,
backgroundColor: Theme.of(context).colorScheme.primary,
),
onPressed:
controller.loading ? null : controller.submitAction,
child: controller.loading
? const LinearProgressIndicator()
: Row(
children: [
Expanded(
child: Text(
L10n.of(context)!.createNewSpace,
),
),
Icon(Icons.adaptive.arrow_forward_outlined),
],
),
),
), ),
subtitle: Text(L10n.of(context)!.newSpaceDescription),
), ),
], ],
), ),
), ),
floatingActionButton: FloatingActionButton(
onPressed: controller.submitAction,
child: const Icon(Icons.arrow_forward_outlined),
),
); );
} }
} }

Loading…
Cancel
Save