diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aa88a585..d25b2269f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ ### Added +* [Resources/Notifications] Persist private user alerts when net resource consumption crosses 50%, 75%, 90%, 95% or 99% of the personal limit, atomically with accounting. Report only the highest threshold crossed per update and rearm after credits or released storage lower consumption. Keep notification consultation and dismissal accessible at quota without consuming resources; no email or live push is sent. + * [Yavsc.Api] Preserve `application/problem+json` for resource-usage relief errors instead of overriding it with a JSON-only Produces attribute; document success/error media types in OpenAPI and verify error payloads. Restore the haircut and grouped-haircut commands removed from the test seed while retaining its three catalog prestations, with repeated-reset coverage. * [Yavsc.Api/Tests] Reset the anchored shared SQLite in-memory database by dropping and recreating its tables before seeding, avoiding duplicate user emails across tests. Restore foreign-key enforcement after cleanup and cover repeated resets with a regression test; leave PostgreSQL cleanup unchanged. diff --git a/doc/architecture/postit.md b/doc/architecture/postit.md index b32832559..7dba2ba78 100644 --- a/doc/architecture/postit.md +++ b/doc/architecture/postit.md @@ -160,6 +160,19 @@ Le contrôle admet les coûts connus puis constate les coûts restants : il bloque les opérations suivantes, sans interrompre strictement celles déjà en cours. +Au franchissement de 50 %, 75 %, 90 %, 95 % ou 99 % de la limite personnelle, +le serveur enregistre une notification privée `user/{UserId}`, visible dans +les notifications de l'accueil lors de leur prochain chargement. Le calcul +porte sur le total pondéré net des crédits, pas sur chaque compteur séparé. +Une mise à jour franchissant plusieurs paliers ne produit que l'avertissement +du plus haut palier atteint ; rester au-dessus ne répète pas l'alerte. +Après une baisse sous un palier (crédit ou suppression de stockage suivi), +un nouveau franchissement produit une nouvelle notification, même si la +précédente a été fermée. Les notifications et le comptage sont enregistrés +ensemble ; aucune migration de schéma n'est nécessaire. +La lecture et la fermeture des notifications restent accessibles au quota +atteint et ne consomment pas de points. Aucun email ni push immédiat n'est envoyé. + La page **À propos** ouvre les CGU dédiées de PostIt et de Yavsc sur `Home/CGU` auprès de l'autorité configurée, y compris sans session. Cette page publique présente les coefficients réellement configurés, diff --git a/src/PostIt/PostIt/ViewModels/Chat/ChatViewModel.cs b/src/PostIt/PostIt/ViewModels/Chat/ChatViewModel.cs index c9ee665d4..68a9fd7cc 100644 --- a/src/PostIt/PostIt/ViewModels/Chat/ChatViewModel.cs +++ b/src/PostIt/PostIt/ViewModels/Chat/ChatViewModel.cs @@ -76,8 +76,11 @@ namespace PostIt.ViewModels.Chat public partial string? SelectedUser { get; set; } [ObservableProperty] + [NotifyPropertyChangedFor(nameof(IsConnectedAndInARoom))] public partial string CurrentRoom { get; set; } = "General"; + public bool IsConnectedAndInARoom => IsConnected && !string.IsNullOrEmpty(CurrentRoom); + [ObservableProperty] public partial string NickName { get; set; } = ""; @@ -87,6 +90,7 @@ namespace PostIt.ViewModels.Chat [ObservableProperty] [NotifyCanExecuteChangedFor(nameof(SendMessageCommand))] [NotifyCanExecuteChangedFor(nameof(OpenCallCommand), nameof(ShowCallCommand))] + [NotifyPropertyChangedFor(nameof(IsConnectedAndInARoom))] public partial bool IsConnected { get; set; } = false; [ObservableProperty] diff --git a/src/PostIt/PostIt/Views/Blogs/BlogsPage.axaml b/src/PostIt/PostIt/Views/Blogs/BlogsPage.axaml index f0eba8ca2..bca8f1f72 100644 --- a/src/PostIt/PostIt/Views/Blogs/BlogsPage.axaml +++ b/src/PostIt/PostIt/Views/Blogs/BlogsPage.axaml @@ -2,20 +2,15 @@ x:Class="PostIt.Views.Blogs.BlogsPage" xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:models="using:Yavsc.Blogspot" xmlns:postitControls="using:PostIt.Controls" xmlns:reader="clr-namespace:Markdown.Avalonia;assembly=Markdown.Avalonia" xmlns:services="using:PostIt.Services" xmlns:vm="using:PostIt.ViewModels" x:Name="BlogsPageRoot" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" x:DataType="vm:BlogsViewModel" AutomaticallyApplySafeAreaPadding="True" - Header="Billets de blog" - mc:Ignorable="d"> + Header="Billets de blog"> diff --git a/src/PostIt/PostIt/Views/Blogs/BlogsPage.axaml.cs b/src/PostIt/PostIt/Views/Blogs/BlogsPage.axaml.cs index 26eb7177c..ea220d1b1 100644 --- a/src/PostIt/PostIt/Views/Blogs/BlogsPage.axaml.cs +++ b/src/PostIt/PostIt/Views/Blogs/BlogsPage.axaml.cs @@ -88,7 +88,6 @@ public partial class BlogsPage : ContentPage PostsSplitter.HorizontalAlignment = isWide ? HorizontalAlignment.Center : HorizontalAlignment.Stretch; PostsSplitter.VerticalAlignment = isWide ? VerticalAlignment.Stretch : VerticalAlignment.Center; PostsSplitter.Margin = isWide ? new Thickness(0, 12) : new Thickness(12, 0); - NavigationPage.SetBarHeightOverride(this, isWide ? 36 : null); } private static void SetArea(Control control, int row, int column, int rowSpan = 1, int columnSpan = 1) diff --git a/src/PostIt/PostIt/Views/Chat/ChatPage.axaml b/src/PostIt/PostIt/Views/Chat/ChatPage.axaml index b4a08028c..678b54852 100644 --- a/src/PostIt/PostIt/Views/Chat/ChatPage.axaml +++ b/src/PostIt/PostIt/Views/Chat/ChatPage.axaml @@ -30,7 +30,7 @@ Text="{Binding CurrentRoom}" PlaceholderText="Nom du salon" />