Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions src/BootstrapBlazor/Components/DragDrap/DragDropService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,52 @@
namespace BootstrapBlazor.Components;

/// <summary>
/// <para lang="zh">拖拽服务</para>
/// <para lang="en">Drag Drop Service</para>
/// <para lang="zh">DragDropService 拖拽服务</para>
/// <para lang="en">DragDropService component</para>
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The English translation appears to be a placeholder. It says "DragDropService component" but should say something like "Drag and Drop Service" or "Drag Drop Service" to properly describe the functionality in English, similar to the original comment.

Suggested change
/// <para lang="en">DragDropService component</para>
/// <para lang="en">Drag and Drop Service</para>

Copilot uses AI. Check for mistakes.
/// </summary>
Comment on lines 8 to 11
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Consider changing the English summary to call this a "service" rather than a "component" for consistency with the class role.

Since this is an internal service (DragDropService<T>) rather than a UI component, calling it a “component” in the English XML doc is a bit misleading. Using wording like “DragDropService service” or simply “drag and drop service” would more accurately describe its role.

Suggested change
/// <summary>
/// <para lang="zh">拖拽服务</para>
/// <para lang="en">Drag Drop Service</para>
/// <para lang="zh">DragDropService 拖拽服务</para>
/// <para lang="en">DragDropService component</para>
/// </summary>
/// <summary>
/// <para lang="zh">DragDropService 拖拽服务</para>
/// <para lang="en">DragDropService drag and drop service</para>
/// </summary>

/// <typeparam name="T"></typeparam>
internal class DragDropService<T>
{
/// <summary>
/// <para lang="zh">活动的Item</para>
/// <para lang="en">Active Item</para>
/// <para lang="zh">获得/设置 活动的Item</para>
/// <para lang="en">Gets or sets Active Item</para>
/// </summary>
public T? ActiveItem { get; set; }

/// <summary>
/// <para lang="zh">悬停的项目</para>
/// <para lang="en">Drag Target Item</para>
/// <para lang="zh">获得/设置 悬停的项目</para>
/// <para lang="en">Gets or sets Drag Target Item</para>
/// </summary>
public T? DragTargetItem { get; set; }

/// <summary>
/// <para lang="zh">被拖拽的Items</para>
/// <para lang="en">Dragged Items</para>
/// <para lang="zh">获得/设置 被拖拽的 Items</para>
/// <para lang="en">Gets or sets Dragged Items</para>
/// </summary>
public List<T>? Items { get; set; }

/// <summary>
/// <para lang="zh">活动的Id</para>
/// <para lang="en">Active Id</para>
/// <para lang="zh">获得/设置 活动的 Id</para>
/// <para lang="en">Gets or sets Active Id</para>
/// </summary>
public int? ActiveSpacerId { get; set; }

/// <summary>
/// <para lang="zh">之前的位置</para>
/// <para lang="en">Previous Index</para>
/// <para lang="zh">获得/设置 之前的位置</para>
/// <para lang="en">Gets or sets Previous Index</para>
/// </summary>
public int? OldIndex { get; set; }

/// <summary>
/// <para lang="zh">通知刷新</para>
/// <para lang="en">Notify StateChanged</para>
/// <para lang="zh">获得/设置 通知刷新方法</para>
/// <para lang="en">Gets or sets Notify StateChanged</para>
/// </summary>
public EventHandler? StateHasChanged { get; set; }

/// <summary>
/// <para lang="zh">重置方法</para>
/// <para lang="en">Reset method</para>
/// </summary>
public void Reset()
{
if (OldIndex is >= 0 && Items != null && ActiveItem != null)
Expand All @@ -57,6 +61,10 @@ public void Reset()
Commit();
}

/// <summary>
/// <para lang="zh">提交方法</para>
/// <para lang="en">Commit method</para>
/// </summary>
public void Commit()
{
ActiveItem = default;
Expand Down
14 changes: 1 addition & 13 deletions src/BootstrapBlazor/Components/Drawer/Drawer.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@
namespace BootstrapBlazor.Components;

/// <summary>
/// <para lang="zh">Drawer component</para>
/// <para lang="zh">Drawer 抽屉组件</para>
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Chinese comment has a typo or spacing issue. There's an extra space between "Drawer" and "抽屉组件". It should either be "Drawer抽屉组件" or "Drawer 组件" for consistency. Based on the pattern in DragDropService.cs where the component name is included (e.g., "DragDropService 拖拽服务"), this should likely be "Drawer 组件" to be consistent.

Suggested change
/// <para lang="zh">Drawer 抽屉组件</para>
/// <para lang="zh">Drawer 组件</para>

Copilot uses AI. Check for mistakes.
/// <para lang="en">Drawer component</para>
/// </summary>
public partial class Drawer
{
/// <summary>
/// <para lang="zh">获得 组件样式</para>
/// <para lang="en">Get Component CSS Style</para>
/// </summary>
private string? ClassString => CssBuilder.Default("drawer collapse")
.AddClass("no-bd", !ShowBackdrop)
.AddClassFromAttributes(AdditionalAttributes)
Expand All @@ -26,21 +22,13 @@ public partial class Drawer
.AddStyleFromAttributes(AdditionalAttributes)
.Build();

/// <summary>
/// <para lang="zh">获得 抽屉 Style 字符串</para>
/// <para lang="en">Get Drawer Style String</para>
/// </summary>
private string? DrawerStyleString => CssBuilder.Default()
.AddClass($"--bb-drawer-width: {Width};", !string.IsNullOrEmpty(Width) && !IsVertical)
.AddClass($"--bb-drawer-height: {Height};", !string.IsNullOrEmpty(Height) && IsVertical)
.Build();

private bool IsVertical => Placement == Placement.Top || Placement == Placement.Bottom;

/// <summary>
/// <para lang="zh">获得 抽屉样式</para>
/// <para lang="en">Get Drawer CSS Style</para>
/// </summary>
private string? DrawerClassString => CssBuilder.Default("drawer-body")
.AddClass("left", Placement != Placement.Right && Placement != Placement.Top && Placement != Placement.Bottom)
.AddClass("top", Placement == Placement.Top)
Expand Down
Loading