Skip to content

Commit

Permalink
merge: 合并上游分支
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloWRC committed Oct 13, 2024
2 parents 6495d91 + af0cf67 commit 766282a
Show file tree
Hide file tree
Showing 43 changed files with 806 additions and 242 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/close_stale_issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/stale@v9
with:
any-of-labels: '需要更多信息,待沟通'
any-of-labels: 需要更多信息, 待沟通
days-before-issue-stale: 14
days-before-issue-close: 7
days-before-pr-stale: 14
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/issues_similarity_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Issues Similarity Analysis

on:
issues:
types: [opened, edited]

jobs:
similarity-analysis:
runs-on: ubuntu-latest
steps:
- name: analysis
uses: actions-cool/issues-similarity-analysis@v1
with:
filter-threshold: 0.5
comment-title: |
### 相似 Issues
comment-body: '${index}. ${similarity} #${number}'
title-excludes: "(在这里输入你的标题),bug"
since-days: 365
show-footer: false
show-mentioned: true
10 changes: 10 additions & 0 deletions ClassIsland.Core/Abstractions/Controls/ComponentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ public abstract class ComponentBase : UserControl
/// </summary>
[NotNull]
internal object? SettingsInternal { get; set; }

/// <summary>
/// 当这个组件是由另一个组件迁移而来时触发。
/// </summary>
/// <param name="sourceId">源组件 GUID</param>
/// <param name="settings">源组件的设置</param>
public virtual void OnMigrated(Guid sourceId, object? settings)
{

}
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ClassIsland.Core/Attributes/ComponentInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class ComponentInfo : Attribute
/// </summary>
public static ComponentInfo Empty { get; } = new(System.Guid.Empty.ToString(), "???");


internal List<string> MigrateSources { get; } = new();

/// <inheritdoc />
public ComponentInfo(string guid, string name, PackIconKind icon, string description="") : this(guid, name, description)
Expand Down
14 changes: 14 additions & 0 deletions ClassIsland.Core/Attributes/MigrateFromAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace ClassIsland.Core.Attributes;

/// <summary>
/// 代表此元素可以由先前某个 ID 的元素迁移而来。
/// </summary>
/// <param name="id">源元素 ID</param>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class MigrateFromAttribute(string id) : Attribute
{
/// <summary>
/// 源元素 ID
/// </summary>
public string Id { get; } = id;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ private static ComponentInfo Register(IServiceCollection services, Type componen
{
throw new ArgumentException($"此组件id {info.Guid} 已经被占用。");
}

services.AddTransient(component);
info.ComponentType = component;
foreach (var migrationSource in component.GetCustomAttributes(false).Where(x => x is MigrateFromAttribute).Cast<MigrateFromAttribute>())
{
ComponentRegistryService.MigrationPairs[new Guid(migrationSource.Id)] = info.Guid;
}
if (settings != null)
{
services.AddTransient(settings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class LessonControlAttachedSettings : ObservableRecipient, IAttachedSetti
private int _extraInfoType = 0;
private bool _isCountdownEnabled = true;
private int _countdownSeconds = 60;
private int _extraInfo4ShowSecondsSeconds = 300;
private int _extraInfo4ShowSecondsSeconds = 0;
private double _scheduleSpacing = 1;
private bool _showCurrentLessonOnlyOnClass = false;

Expand Down
5 changes: 5 additions & 0 deletions ClassIsland.Core/Models/Components/ComponentSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ public Ruleset.Ruleset HidingRules
}
}

[JsonIgnore]
internal bool IsMigrated { get; set; } = false;

[JsonIgnore] internal Guid MigrationSource { get; set; } = Guid.Empty;

/// <summary>
/// 这个组件关联的组件注册信息。
/// </summary>
Expand Down
3 changes: 2 additions & 1 deletion ClassIsland.Core/NativeMethods.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ RAWINPUTHEADER
WM_SETTINGCHANGE
HWND_BROADCAST
SMTO_ABORTIFHUNG
WM_WINDOWPOSCHANGED
WM_WINDOWPOSCHANGED
WINDOWPOS
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.ObjectModel;
using System.Reflection.Metadata;
using ClassIsland.Core.Attributes;
using ClassIsland.Core.Models.Components;

Expand All @@ -15,4 +16,6 @@ public class ComponentRegistryService
public static ObservableCollection<ComponentInfo> Registered { get; } = new();

public static ObservableCollection<ComponentSettings> RegisteredSettings { get; } = new();

public static Dictionary<Guid, Guid> MigrationPairs { get; } = new();
}
6 changes: 6 additions & 0 deletions ClassIsland.Core/Walterlv/Windows/AsyncBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class AsyncBox : FrameworkElement

private UIElement _loadingView;

public UIElement LoadingView => _loadingView;

private readonly ContentPresenter _contentPresenter;

private bool _isChildReadyToLoad;
Expand Down Expand Up @@ -129,6 +131,10 @@ private async void OnLoaded(object sender, RoutedEventArgs e)
}

var dispatcher = await GetAsyncDispatcherAsync();
if (VisualTreeHelper.GetParent(_contentPresenter) != null || VisualTreeHelper.GetParent(_hostVisual) != null)
{
return;
}
_loadingView = await dispatcher.InvokeAsync(() =>
{
var loadingView = CreateLoadingView();
Expand Down
2 changes: 1 addition & 1 deletion ClassIsland.Shared/ClassIsland.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</ItemGroup>

<ItemGroup Condition="$(TargetFramework)=='net472'">
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion ClassIsland/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ private async void App_OnStartup(object sender, StartupEventArgs e)
// 主界面组件
services.AddComponent<TextComponent, TextComponentSettingsControl>();
services.AddComponent<SeparatorComponent>();
services.AddComponent<LegacyScheduleComponent>();
services.AddComponent<ScheduleComponent, ScheduleComponentSettingsControl>();
services.AddComponent<DateComponent>();
services.AddComponent<ClockComponent, ClockComponentSettingsControl>();
Expand Down
49 changes: 42 additions & 7 deletions ClassIsland/Assets/Documents/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,41 @@ ClassIsland 目前推出了【精简模式】,精简模式的 ClassIsland 裁

应用设置窗口目前经过了重构,并且加入了导航动画。此外,在重构设置界面之后,应用的启动速度也得到了一定的提升。

***


# 1.5.0.3

> [!important]
> 目前已知通过 RawInput 检测光标位置在部分设备兼容性不好,现已默认禁用此模式。如果在您的设备上课表无法在鼠标移入/触屏点击时正常隐藏,请尝试在[【应用设置】->【窗口】](classisland://app/settings/window)禁用此功能。
## 新增功能和优化

- 【主界面】默认禁用通过 RawInput 检测光标位置
- 【主界面】自定义背景颜色 ([#404](https://github.com/ClassIsland/ClassIsland/issues/404)) (by @LiuYan-xwx)
- 【主界面】优化置顶检测逻辑
- 【档案编辑】允许编辑已启用的时间表
- 【组件】组件迁移
- 【组件/课表】附加设置添加显示精确倒计时剩余时长字段,修改附加设置显示精确倒计时剩余时长的默认值为 0
- 【应用设置】优化设置页面加载动画
- 【应用设置】_在设置加载界面显示回声洞_(实验性功能,默认禁用) ([#406](https://github.com/ClassIsland/ClassIsland/issues/406))
- 【应用设置】_设置页面缓存_(实验性功能,默认禁用)
- 【应用设置/插件】在插件下载/插件源刷新失败时显示真正的错误原因
- 【应用设置/插件】优化插件概览文档加载流程
- 【应用设置/关于】修正关于页面链接
- 【日志】改进文件日志模块稳定性 ([#418](https://github.com/ClassIsland/ClassIsland/issues/418))

## 移除的功能

- 【组件】移除“课程表(旧)”组件,如果您还在使用此组件,会自动迁移到新的课程表组件上

### Bug 修复

- 【精确时间服务】修复概率性无法自动调整时间偏移的问题 ([#397](https://github.com/ClassIsland/ClassIsland/issues/397))
- 【应用设置】修复在设置页面导航时出现 TaskCanceledException 的问题
- 【主界面】修复在置底时显示置顶提醒抢夺焦点的问题 ([#417](https://github.com/ClassIsland/ClassIsland/issues/417))
- 【主界面】修复获取鼠标位置时可能造成 PointFromScreen 方法因 Visual 没有连接到 PresentationSource 导致异常的问题
- 【UI】修复在一些特定情况下出现 `在指定子级连接到新的父 Visual 之前必须断开与当前父 Visual 的连接。` 错误的问题 ([#413](https://github.com/ClassIsland/ClassIsland/issues/413))

***

Expand All @@ -89,15 +124,15 @@ ClassIsland 目前推出了【精简模式】,精简模式的 ClassIsland 裁

## Bug 修复

- 【组件】修复部分组件无法局部覆盖 MainWindowBodyFontSize 的问题 ([#343](https://github.com/ClassIsland/ClassIsland/issues/3))
- 【组件】修复部分组件无法局部覆盖 MainWindowBodyFontSize 的问题 ([#343](https://github.com/ClassIsland/ClassIsland/issues/343))
- 【组件/课表】修复时间点附加信息【XX/持续时间】中时间格式不统一的问题
- 【主界面】修复当窗口宽度为 0 时回弹动画产生负值宽度导致崩溃的问题 ([#386](https://github.com/ClassIsland/ClassIsland/issues/3))
- 【主界面】修复概率丢失置顶属性的问题 ([#358](https://github.com/ClassIsland/ClassIsland/issues/3))
- 【档案编辑器】修复在课表编辑界面选中含有正在删除科目的课程时,使 SubjectId 为 null 导致主循环异常的问题 ([#376](https://github.com/ClassIsland/ClassIsland/issues/3))
- 【档案编辑器】修复设置课表的同时设置科目,导致软件崩溃的问题 ([#375](https://github.com/ClassIsland/ClassIsland/issues/3))
- 【档案】修复在时间表顶部变更一个“课间休息”为“上课”时,整个课程表会向前错位的问题 ([#387](https://github.com/ClassIsland/ClassIsland/issues/3))
- 【主界面】修复当窗口宽度为 0 时回弹动画产生负值宽度导致崩溃的问题 ([#386](https://github.com/ClassIsland/ClassIsland/issues/386))
- 【主界面】修复概率丢失置顶属性的问题 ([#358](https://github.com/ClassIsland/ClassIsland/issues/358))
- 【档案编辑器】修复在课表编辑界面选中含有正在删除科目的课程时,使 SubjectId 为 null 导致主循环异常的问题 ([#376](https://github.com/ClassIsland/ClassIsland/issues/376))
- 【档案编辑器】修复设置课表的同时设置科目,导致软件崩溃的问题 ([#375](https://github.com/ClassIsland/ClassIsland/issues/375))
- 【档案】修复在时间表顶部变更一个“课间休息”为“上课”时,整个课程表会向前错位的问题 ([#387](https://github.com/ClassIsland/ClassIsland/issues/387))
- 【组件/课表】修复在删除临时层课表的源课表后应用崩溃的问题
- 【提醒】修复换课时如果下节课是户外课程换成室内课程倒计时显示时间不正常的问题 ([#385](https://github.com/ClassIsland/ClassIsland/issues/3))
- 【提醒】修复换课时如果下节课是户外课程换成室内课程倒计时显示时间不正常的问题 ([#385](https://github.com/ClassIsland/ClassIsland/issues/385))

***

Expand Down
16 changes: 15 additions & 1 deletion ClassIsland/Assets/Tellings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,18 @@ Oops! Something went wrong. It looks like you've hit an issue in our server API.
对于安装CI后希沃白板打不开了,你有什么看法吗?
ClassIsland——烟台二中课改班特别定制版!
课间拯救计划
进攻D点!艾布拉姆斯......胜败乃兵家常事,然而下一次,我们会赢回来的
进攻D点!艾布拉姆斯......胜败乃兵家常事,然而下一次,我们会赢回来的
插件怎么做啊!!!
恭喜徐州树人初级中学成功引入 classisland(虽然只是一个班)
自从用了 ClassIsland,妈妈再也不用担心我被拖堂啦!
孙吧第一舰队已占领此吧
ClassIsland的大旗已经插到了天津市第二十五中学灵隐道校区的高中部
致广州二十一员村——我做了一场梦,梦里的我是野花变成的玫瑰,飞驰在后花园之上。这场梦是那么的真实,那么的美。让我流连忘返,乐不思蜀。然后,我醒了。现实的我,还是那个我。梦中的我,涂上了淡黄色的油墨。
我们是谁?——学生!——我们在哪?——学校!——我们要什么?——放假!——多少天?——无限!
来BS MC看看!
不会用?多看两眼教程!
这是回~ ~~声~~~洞~~~
“我一定会到达我想去的地方 旅途结束后也许还会有新渴望”
ClassIsland 真是太好用了!
西江月・证明 即得易见平凡,仿照上例显然。留作习题答案略,读者自证不难。 反之亦然同理,推论自然成立。略去过程Q.E.D.,由上可知证毕。
⌈当有一天你不再纠结于答案 当我们又重逢于天涯或沧海⌋
1 change: 1 addition & 0 deletions ClassIsland/ClassIsland.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Models\Logging\" />
<Folder Include="Models\Native\" />
<Folder Include="Models\TimeRules\" />
<Folder Include="Enums\" />
<Folder Include="Models\Ipc\" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@
</ComboBoxItem>
</ComboBox>
</WrapPanel>
<!-- 显示精确倒计时时长 -->
<TextBox
MinWidth="100"
Margin="0 0 0 6"
materialDesign:TextFieldAssist.PrefixText="剩余"
materialDesign:HintAssist.Hint="显示精确倒计时时长"
materialDesign:TextFieldAssist.SuffixText="秒时"
Foreground="{DynamicResource MaterialDesignBody}"
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
Text="{Binding Settings.ExtraInfo4ShowSecondsSeconds, Mode=TwoWay, Converter={StaticResource IntToStringConverter}}" />
<WrapPanel>
<!-- 时间点结束倒计时 -->
<CheckBox IsChecked="{Binding Settings.IsCountdownEnabled}"
Expand Down
93 changes: 0 additions & 93 deletions ClassIsland/Controls/Components/LegacyScheduleComponent.xaml

This file was deleted.

Loading

0 comments on commit 766282a

Please sign in to comment.