3.0 Beta 6

This commit is contained in:
2026-04-14 17:51:02 +02:00
parent 931ac91526
commit 0dc1e15e59
17 changed files with 88 additions and 28 deletions

8
package-lock.json generated
View File

@@ -16,7 +16,7 @@
"@angular/platform-browser": "^21.2.0", "@angular/platform-browser": "^21.2.0",
"@angular/router": "^21.2.0", "@angular/router": "^21.2.0",
"@angular/service-worker": "^21.2.0", "@angular/service-worker": "^21.2.0",
"@chatenium/chatenium-sdk": "^1.1.8", "@chatenium/chatenium-sdk": "^1.1.10",
"@fortawesome/angular-fontawesome": "^4.0.0", "@fortawesome/angular-fontawesome": "^4.0.0",
"@fortawesome/free-brands-svg-icons": "^7.1.0", "@fortawesome/free-brands-svg-icons": "^7.1.0",
"@fortawesome/free-solid-svg-icons": "^7.1.0", "@fortawesome/free-solid-svg-icons": "^7.1.0",
@@ -1011,9 +1011,9 @@
} }
}, },
"node_modules/@chatenium/chatenium-sdk": { "node_modules/@chatenium/chatenium-sdk": {
"version": "1.1.8", "version": "1.1.10",
"resolved": "https://registry.npmjs.org/@chatenium/chatenium-sdk/-/chatenium-sdk-1.1.8.tgz", "resolved": "https://registry.npmjs.org/@chatenium/chatenium-sdk/-/chatenium-sdk-1.1.10.tgz",
"integrity": "sha512-UuPCr/NqZhLrT/lt8I1AM+UNFAdI00adtvvlu3BQgqCYPASoUpTJJ4HdMzJ+E0cb0pUS6DmN0Kv+w3vFQfRYwg==", "integrity": "sha512-FRVKyOzkKQ5wWFL/m3G731VXhvqo3IHpKFcseWfpX5TxBq6Kh9GxpjN8/JQgQ5X+KDES1Nrm4FqOHkVw5CVHyA==",
"dependencies": { "dependencies": {
"@faker-js/faker": "^10.4.0", "@faker-js/faker": "^10.4.0",
"axios": "^1.14.0", "axios": "^1.14.0",

View File

@@ -19,7 +19,7 @@
"@angular/platform-browser": "^21.2.0", "@angular/platform-browser": "^21.2.0",
"@angular/router": "^21.2.0", "@angular/router": "^21.2.0",
"@angular/service-worker": "^21.2.0", "@angular/service-worker": "^21.2.0",
"@chatenium/chatenium-sdk": "^1.1.8", "@chatenium/chatenium-sdk": "^1.1.10",
"@fortawesome/angular-fontawesome": "^4.0.0", "@fortawesome/angular-fontawesome": "^4.0.0",
"@fortawesome/free-brands-svg-icons": "^7.1.0", "@fortawesome/free-brands-svg-icons": "^7.1.0",
"@fortawesome/free-solid-svg-icons": "^7.1.0", "@fortawesome/free-solid-svg-icons": "^7.1.0",

View File

@@ -1,5 +1,5 @@
{ {
"version": "3.0 Beta 5 (April 13, 2026)", "version": "3.0 Beta 6 (April 14, 2026)",
"ok": "Ok", "ok": "Ok",
"back": "Back", "back": "Back",
"aChatProgram": "A messaging platform that you can trust.", "aChatProgram": "A messaging platform that you can trust.",
@@ -8,6 +8,7 @@
"independent": "Independent", "independent": "Independent",
"scrollDownForMore": "Scroll down for more", "scrollDownForMore": "Scroll down for more",
"whatIsChtn": "Chatenium is a chat platform aiming to provide a secure, well integrated fast chatting experience across any devices. You can create a new account for free and start chatting and broadcasting messages.", "whatIsChtn": "Chatenium is a chat platform aiming to provide a secure, well integrated fast chatting experience across any devices. You can create a new account for free and start chatting and broadcasting messages.",
"updating": "Updating...",
"home": { "home": {
"chtn": "Chatenium ", "chtn": "Chatenium ",
"chtnIs": "Chatenium is ", "chtnIs": "Chatenium is ",
@@ -104,9 +105,8 @@
"changeLogDialog": { "changeLogDialog": {
"label": "Chatenium has been updated", "label": "Chatenium has been updated",
"changeLog": { "changeLog": {
"1": "Started implementing Chatenium Pictures", "1": "UI issue fixes in the message box",
"2": "Made small changes to the UI", "2": "Added caching to improve performance"
"3": "Minor bug fixes in message box"
} }
}, },
"chatnav": { "chatnav": {

View File

@@ -57,7 +57,7 @@
<main id="content"> <main id="content">
<div id="content_tint"> <div id="content_tint">
@if (router.url.startsWith("/chat/dm") && router.url.startsWith("/chat/picture")) { @if (router.url.startsWith("/chat/dm") || router.url.startsWith("/chat/picture")) {
<!-- To ensure data is loaded --> <!-- To ensure data is loaded -->
@defer (when serviceManager.chatsStatus() != LoadStatus.loading) { @defer (when serviceManager.chatsStatus() != LoadStatus.loading) {
<router-outlet/> <router-outlet/>

View File

@@ -1,7 +1,12 @@
<button disabled tuiButton appearance="secondary" iconStart="@tui.mail-plus"> <button disabled tuiButton appearance="secondary" iconStart="@tui.mail-plus">
{{"chat.chatnav.dmList.newChat"|translate}} {{"chat.chatnav.dmList.newChat"|translate}}
</button> </button>
@if (serviceManager.chatsStatus() == LoadStatus.updating) {
<div id="loader">
<tui-loader />
{{"updating"|translate}}
</div>
}
@for (chat of serviceManager.chats(); track chat.chatid) { @for (chat of serviceManager.chats(); track chat.chatid) {
<button [class.enlarge]="breakpoint() == 'mobile'" tuiButton [appearance]="router.url == '/chat/dm/' + chat.chatid ? 'primary' : 'flat'" [routerLink]="'/chat/dm/' + chat.chatid"> <button [class.enlarge]="breakpoint() == 'mobile'" tuiButton [appearance]="router.url == '/chat/dm/' + chat.chatid ? 'primary' : 'flat'" [routerLink]="'/chat/dm/' + chat.chatid">
<oimg [src]="chat.pfp" height="35px" width="35px" [radius]="10"></oimg> <oimg [src]="chat.pfp" height="35px" width="35px" [radius]="10"></oimg>

View File

@@ -3,6 +3,14 @@
flex-direction: column; flex-direction: column;
gap: 5px; gap: 5px;
#loader {
width: 100%;
display: flex;
justify-content: start;
padding: 5px;
gap: 5px;
}
button { button {
width: 100%; width: 100%;
display: flex; display: flex;

View File

@@ -2,7 +2,7 @@ import {Component, inject, input, OnInit, signal} from '@angular/core';
import {ChatService} from '@chatenium/chatenium-sdk/services/chatService'; import {ChatService} from '@chatenium/chatenium-sdk/services/chatService';
import {IndexedDB} from '../../storage/indexed-db'; import {IndexedDB} from '../../storage/indexed-db';
import {Chat} from '@chatenium/chatenium-sdk/domain/chatService.schema'; import {Chat} from '@chatenium/chatenium-sdk/domain/chatService.schema';
import {TUI_BREAKPOINT, TuiButton} from '@taiga-ui/core'; import {TUI_BREAKPOINT, TuiButton, TuiLoader} from '@taiga-ui/core';
import {Oimg} from '../elements/oimg/oimg'; import {Oimg} from '../elements/oimg/oimg';
import {Router, RouterLink} from '@angular/router'; import {Router, RouterLink} from '@angular/router';
import {TranslatePipe} from '@ngx-translate/core'; import {TranslatePipe} from '@ngx-translate/core';
@@ -14,7 +14,8 @@ import {LoadStatus, ServiceManager} from '../../service-manager';
TuiButton, TuiButton,
Oimg, Oimg,
RouterLink, RouterLink,
TranslatePipe TranslatePipe,
TuiLoader
], ],
templateUrl: './dm-list.html', templateUrl: './dm-list.html',
styleUrl: './dm-list.scss', styleUrl: './dm-list.scss',
@@ -30,6 +31,12 @@ export class DmList implements OnInit {
async ngOnInit() { async ngOnInit() {
this.serviceManager.chatService = new ChatService(this.userid(), this.token(), this.indexedDb.getApi(), () => {}) this.serviceManager.chatService = new ChatService(this.userid(), this.token(), this.indexedDb.getApi(), () => {})
try {
this.serviceManager.chats.set(await this.serviceManager.chatService.getQuick())
this.serviceManager.chatsStatus.set(LoadStatus.updating)
} catch (e) {
console.warn(`Cache load failed: ${e}. Skipping cache load...`)
}
try { try {
this.serviceManager.chats.set(await this.serviceManager.chatService.get()) this.serviceManager.chats.set(await this.serviceManager.chatService.get())
this.serviceManager.chatsStatus.set(LoadStatus.loaded) this.serviceManager.chatsStatus.set(LoadStatus.loaded)
@@ -38,4 +45,6 @@ export class DmList implements OnInit {
this.serviceManager.chatsStatus.set(LoadStatus.error) this.serviceManager.chatsStatus.set(LoadStatus.error)
} }
} }
protected readonly LoadStatus = LoadStatus;
} }

View File

@@ -156,6 +156,7 @@ export class Dm implements OnInit {
this.route.params.subscribe(async params => { this.route.params.subscribe(async params => {
const chatid = params['chatid']; const chatid = params['chatid'];
this.chatid = chatid; this.chatid = chatid;
console.log(`Loading chat ${chatid}...`)
const session = this.serviceManager.currentSession(); const session = this.serviceManager.currentSession();
const chatData = this.serviceManager.chats().find(c => c.chatid === chatid); const chatData = this.serviceManager.chats().find(c => c.chatid === chatid);
@@ -183,8 +184,14 @@ export class Dm implements OnInit {
this.serviceManager.dmServices()[chatid] = newStore; this.serviceManager.dmServices()[chatid] = newStore;
const currentStore = this.serviceManager.dmServices()[chatid]; const currentStore = this.serviceManager.dmServices()[chatid];
const history = await currentStore.service.get(); try {
currentStore.messages.set(history); const messagesCache = await currentStore.service.getQuick();
currentStore.messages.set(messagesCache);
} catch (e) {
console.warn(`Cache load failed: ${e}. Skipping cache load...`)
}
const messages = await currentStore.service.get();
currentStore.messages.set(messages);
this.scrollToBottom("instant") this.scrollToBottom("instant")
await currentStore.service.joinWebSocketRoom(); await currentStore.service.joinWebSocketRoom();

View File

@@ -50,7 +50,7 @@
</ng-template> </ng-template>
<main> <main>
<div id="message-box-extension" tuiAppearance="floating" [class.shown]="viewModel().editingMessage()"> <div id="message-box-extension" tuiAppearance="floating" [class.shown]="viewModel().editingMessage()" [class.fullWidth]="breakpoint() != 'desktopLarge'">
<div id="content"> <div id="content">
@if (viewModel().editingMessage()) { @if (viewModel().editingMessage()) {
<tui-icon icon="@tui.pencil"></tui-icon> <tui-icon icon="@tui.pencil"></tui-icon>
@@ -59,7 +59,7 @@
<tui-icon icon="@tui.paperclip"></tui-icon> <tui-icon icon="@tui.paperclip"></tui-icon>
<span>{{"chat.elements.messageBox.attachments"|translate}}</span> <span>{{"chat.elements.messageBox.attachments"|translate}}</span>
} @else { } @else {
{{viewModel().editingMessage()!.message}} <span style="width: 300px" tuiScrollable tuiFade>{{viewModel().editingMessage()!.message}}</span>
} }
} }
</div> </div>

View File

@@ -67,6 +67,10 @@
justify-content: center; justify-content: center;
height: 0; height: 0;
&.fullWidth {
width: 100%;
}
#content { #content {
padding-left: 10px; padding-left: 10px;
display: flex; display: flex;

View File

@@ -5,7 +5,7 @@ import {
TuiButton, TuiButton,
TuiDialog, TuiDialog,
TuiGroup, TuiGroup,
TuiIcon, TuiIcon, TuiScrollable,
TuiScrollbarDirective, TuiScrollbarDirective,
TuiTextfield TuiTextfield
} from '@taiga-ui/core'; } from '@taiga-ui/core';
@@ -17,7 +17,7 @@ import {v4 as uuidv4} from 'uuid';
import {Masonry} from '../masonry/masonry'; import {Masonry} from '../masonry/masonry';
import {Oimg} from '../oimg/oimg'; import {Oimg} from '../oimg/oimg';
import {FileData} from '@chatenium/chatenium-sdk/domain/fileUploadService.schema'; import {FileData} from '@chatenium/chatenium-sdk/domain/fileUploadService.schema';
import {TuiTextarea, TuiTextareaComponent} from '@taiga-ui/kit'; import {TuiFade, TuiTextarea, TuiTextareaComponent} from '@taiga-ui/kit';
@Component({ @Component({
selector: 'message-box', selector: 'message-box',
@@ -33,7 +33,9 @@ import {TuiTextarea, TuiTextareaComponent} from '@taiga-ui/kit';
Oimg, Oimg,
Masonry, Masonry,
TuiTextfield, TuiTextfield,
TuiTextarea TuiTextarea,
TuiScrollable,
TuiFade
], ],
templateUrl: './message-box.html', templateUrl: './message-box.html',
styleUrl: './message-box.scss', styleUrl: './message-box.scss',

View File

@@ -1,7 +1,12 @@
<button disabled tuiButton appearance="secondary" iconStart="@tui.plus"> <button disabled tuiButton appearance="secondary" iconStart="@tui.plus">
{{ "chat.chatnav.networkList.newNetwork"|translate }} {{ "chat.chatnav.networkList.newNetwork"|translate }}
</button> </button>
@if (serviceManager.networksStatus() == LoadStatus.updating) {
<div id="loader">
<tui-loader />
{{"updating"|translate}}
</div>
}
@for (network of serviceManager.networks(); track network.networkId) { @for (network of serviceManager.networks(); track network.networkId) {
<button [class.enlarge]="breakpoint() == 'mobile'" tuiButton <button [class.enlarge]="breakpoint() == 'mobile'" tuiButton
[appearance]="router.url.startsWith('/chat/network/' + network.networkId) ? 'primary' : 'flat'" [appearance]="router.url.startsWith('/chat/network/' + network.networkId) ? 'primary' : 'flat'"

View File

@@ -2,7 +2,7 @@ import {Component, inject, input, OnInit} from '@angular/core';
import {IndexedDB} from '../../storage/indexed-db'; import {IndexedDB} from '../../storage/indexed-db';
import {Router, RouterLink} from '@angular/router'; import {Router, RouterLink} from '@angular/router';
import {LoadStatus, ServiceManager} from '../../service-manager'; import {LoadStatus, ServiceManager} from '../../service-manager';
import {TUI_BREAKPOINT, TuiButton} from '@taiga-ui/core'; import {TUI_BREAKPOINT, TuiButton, TuiLoader} from '@taiga-ui/core';
import {ChatService} from '@chatenium/chatenium-sdk/services/chatService'; import {ChatService} from '@chatenium/chatenium-sdk/services/chatService';
import {NetworkService} from '@chatenium/chatenium-sdk/services/networkService'; import {NetworkService} from '@chatenium/chatenium-sdk/services/networkService';
import {Oimg} from '../elements/oimg/oimg'; import {Oimg} from '../elements/oimg/oimg';
@@ -14,7 +14,8 @@ import {TranslatePipe} from '@ngx-translate/core';
Oimg, Oimg,
TranslatePipe, TranslatePipe,
TuiButton, TuiButton,
RouterLink RouterLink,
TuiLoader
], ],
templateUrl: './network-list.html', templateUrl: './network-list.html',
styleUrl: './network-list.scss', styleUrl: './network-list.scss',
@@ -30,6 +31,12 @@ export class NetworkList implements OnInit {
async ngOnInit() { async ngOnInit() {
this.serviceManager.networkService = new NetworkService(this.userid(), this.token(), "", this.indexedDb.getApi(), () => {}) this.serviceManager.networkService = new NetworkService(this.userid(), this.token(), "", this.indexedDb.getApi(), () => {})
try {
this.serviceManager.networks.set(await this.serviceManager.networkService.getQuick())
this.serviceManager.networksStatus.set(LoadStatus.updating)
} catch (e) {
console.warn(`Cache load failed: ${e}. Skipping cache load...`)
}
try { try {
this.serviceManager.networks.set(await this.serviceManager.networkService.get()) this.serviceManager.networks.set(await this.serviceManager.networkService.get())
this.serviceManager.networksStatus.set(LoadStatus.loaded) this.serviceManager.networksStatus.set(LoadStatus.loaded)
@@ -38,4 +45,6 @@ export class NetworkList implements OnInit {
this.serviceManager.networksStatus.set(LoadStatus.error) this.serviceManager.networksStatus.set(LoadStatus.error)
} }
} }
protected readonly LoadStatus = LoadStatus;
} }

View File

@@ -222,9 +222,14 @@ export class Text {
this.serviceManager.networkServices()[networkId].textChannels()[channelId] = newStore; this.serviceManager.networkServices()[networkId].textChannels()[channelId] = newStore;
const currentStore = this.serviceManager.networkServices()[networkId].textChannels()[channelId] const currentStore = this.serviceManager.networkServices()[networkId].textChannels()[channelId]
const history = await currentStore.service.get(); try {
currentStore.messages.set(history); const messagesCache = await currentStore.service.getQuick();
this.scrollToBottom("instant") currentStore.messages.set(messagesCache);
} catch (e) {
console.warn(`Cache load failed: ${e}. Skipping cache load...`)
}
const messages = await currentStore.service.get();
currentStore.messages.set(messages);
await currentStore.service.joinWebSocketRoom(); await currentStore.service.joinWebSocketRoom();
} }

View File

@@ -30,6 +30,12 @@ export class PictureList implements OnInit {
async ngOnInit() { async ngOnInit() {
this.serviceManager.chatService = new ChatService(this.userid(), this.token(), this.indexedDb.getApi(), () => {}) this.serviceManager.chatService = new ChatService(this.userid(), this.token(), this.indexedDb.getApi(), () => {})
try {
this.serviceManager.chats.set(await this.serviceManager.chatService.getQuick())
this.serviceManager.chatsStatus.set(LoadStatus.updating)
} catch (e) {
console.warn(`Cache load failed: ${e}. Skipping cache load...`)
}
try { try {
this.serviceManager.chats.set(await this.serviceManager.chatService.get()) this.serviceManager.chats.set(await this.serviceManager.chatService.get())
this.serviceManager.chatsStatus.set(LoadStatus.loaded) this.serviceManager.chatsStatus.set(LoadStatus.loaded)

View File

@@ -1,5 +1,5 @@
export const environment = { export const environment = {
version: "3.0-beta5", version: "3.0-beta6",
api_url: "http://localhost:3000", api_url: "http://localhost:3000",
cdn_url: "http://localhost:4000", cdn_url: "http://localhost:4000",
ws_url: "ws://localhost:3000", ws_url: "ws://localhost:3000",

View File

@@ -1,5 +1,5 @@
export const environment = { export const environment = {
version: "3.0-beta5", version: "3.0-beta6",
api_url: "https://api.chatenium.hu", api_url: "https://api.chatenium.hu",
cdn_url: "https://cdn.chatenium.hu", cdn_url: "https://cdn.chatenium.hu",
ws_url: "wss://api.chatenium.hu", ws_url: "wss://api.chatenium.hu",