Wetterdienst: Hover Bugfix
This commit is contained in:
@@ -107,6 +107,20 @@ public sealed class SchoolDayWeatherSummaryTests
|
||||
Assert.False(SchoolDayWeatherSummary.WarningTouchesDate(warning, Day.AddDays(3)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WeekCellItem_WetterOderWarnung_AktiviertGemeinsameHoverFlaeche()
|
||||
{
|
||||
var cell = WeekCellItem.WeekdayHeader(DayOfWeek.Monday, Day, false);
|
||||
Assert.False(cell.HasWeatherInformation);
|
||||
|
||||
cell.SetWeather(SchoolDayWeatherSummary.From(Snapshot(Hour(10)), Day), []);
|
||||
Assert.True(cell.HasWeatherInformation);
|
||||
|
||||
cell.SetWeather(null, [new WeatherWarning { Headline = "Amtliche Warnung" }]);
|
||||
Assert.True(cell.HasWeatherInformation);
|
||||
Assert.Contains("Amtliche Warnung", cell.WeatherTooltip);
|
||||
}
|
||||
|
||||
private static WeatherSnapshot Snapshot(params WeatherForecastHour[] hours) => new()
|
||||
{
|
||||
RetrievedAt = DateTime.UtcNow,
|
||||
|
||||
@@ -783,8 +783,16 @@ public partial class WeekCellItem : ObservableObject
|
||||
[ObservableProperty] private string _weatherTooltip = "";
|
||||
[ObservableProperty] private bool _hasWeatherWarning;
|
||||
public bool HasWeather => WeatherSymbol.Length > 0;
|
||||
public bool HasWeatherInformation => HasWeather || HasWeatherWarning;
|
||||
|
||||
partial void OnWeatherSymbolChanged(string value) => OnPropertyChanged(nameof(HasWeather));
|
||||
partial void OnWeatherSymbolChanged(string value)
|
||||
{
|
||||
OnPropertyChanged(nameof(HasWeather));
|
||||
OnPropertyChanged(nameof(HasWeatherInformation));
|
||||
}
|
||||
|
||||
partial void OnHasWeatherWarningChanged(bool value) =>
|
||||
OnPropertyChanged(nameof(HasWeatherInformation));
|
||||
|
||||
public void SetWeather(SchoolDayWeatherSummary? summary, IReadOnlyList<WeatherWarning> warnings)
|
||||
{
|
||||
|
||||
@@ -195,11 +195,19 @@
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="4">
|
||||
<TextBlock Text="{Binding Text}" FontWeight="SemiBold" FontSize="12" Opacity="0.75"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding WeatherSymbol}" FontSize="16" VerticalAlignment="Center"
|
||||
IsVisible="{Binding HasWeather}" ToolTip.Tip="{Binding WeatherTooltip}"/>
|
||||
<TextBlock Text="⚠" FontSize="12" Foreground="#D85A30" FontWeight="Bold"
|
||||
VerticalAlignment="Center" IsVisible="{Binding HasWeatherWarning}"
|
||||
ToolTip.Tip="{Binding WeatherTooltip}"/>
|
||||
<!-- TextBlock-Trefferflächen sind bei Emoji-Fallback-Schriften teils nur wenige
|
||||
Pixel groß. Der transparente Border bietet eine verlässliche Hover-Fläche. -->
|
||||
<Border Background="Transparent" CornerRadius="4" Padding="4,2"
|
||||
IsVisible="{Binding HasWeatherInformation}"
|
||||
ToolTip.Tip="{Binding WeatherTooltip}" ToolTip.ShowDelay="200">
|
||||
<StackPanel Orientation="Horizontal" Spacing="3">
|
||||
<TextBlock Text="{Binding WeatherSymbol}" FontSize="16" VerticalAlignment="Center"
|
||||
IsVisible="{Binding HasWeather}" IsHitTestVisible="False"/>
|
||||
<TextBlock Text="⚠" FontSize="12" Foreground="#D85A30" FontWeight="Bold"
|
||||
VerticalAlignment="Center" IsVisible="{Binding HasWeatherWarning}"
|
||||
IsHitTestVisible="False"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsPeriodLabel}"
|
||||
|
||||
@@ -763,6 +763,9 @@ weiterhin keine automatisierte Testsuite (kein PHP-Testframework im Projekt).
|
||||
eine gut sichtbare Zusammenfassung oberhalb des Rasters; mehrtägige Warnungen werden jedem
|
||||
überlappten Schultag zugeordnet. Vergangene Tage und Wochen außerhalb der verfügbaren
|
||||
Prognose bleiben ohne Symbol, statt einen veralteten oder erfundenen Zustand anzuzeigen.
|
||||
**Nachtrag Hover-Bugfix:** Wetter- und Warnsymbol liegen gemeinsam in einer transparenten,
|
||||
gepolsterten Trefferfläche. Der Tooltip hängt nicht mehr direkt am je nach Plattform sehr
|
||||
kleinen Emoji-`TextBlock` und wird dadurch im Wochenraster zuverlässig ausgelöst.
|
||||
|
||||
**Nachtrag zu 4.3 (Nutzer-Feedback nach Erstumsetzung):**
|
||||
- **Ferien/Feiertage-Pflege verschoben:** Die Bundesland-Auswahl und das Schulferien-CRUD standen
|
||||
|
||||
Reference in New Issue
Block a user