Skip to content

Dusk - #697

Open
PrefacedCorg wants to merge 4 commits into
net10from
dusk
Open

Dusk#697
PrefacedCorg wants to merge 4 commits into
net10from
dusk

Conversation

@PrefacedCorg

Copy link
Copy Markdown
Collaborator

No description provided.

@augmentcode

augmentcode Bot commented Oct 10, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary:
Integrates Dusk native ink rendering and input into the main window.
Adds selectable WPF, Dusk, and WinRT backends, with Dusk as the default.
Replaces the WinRT toggle with an immediately applied engine dropdown.
Retains the legacy useWinRTInk setting through a compatibility accessor.
Hosts a full-window WpfNativeInkCanvas alongside the existing WPF canvas.
Initializes native history, pen attributes, eraser size, and overlay ticks.
Adds Dusk handling to pen and eraser tool transitions.
Adds native branches for undo, redo, and canvas clearing.
Maps desktop annotations to slot 0 and whiteboard pages to numbered slots.
Updates toolbar layering and adds localized engine-setting labels.
Supports SDK project references or bundled DLLs and disposes Dusk on exit.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 7 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Background="Transparent" />

<!-- Dusk 原生内核墨迹画布:全屏置顶接管书写与渲染 -->
<dusk:WpfNativeInkCanvas x:Name="duskCanvas"

@augmentcode augmentcode Bot Oct 10, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

At Ink Canvas/MainWindow.xaml:252, Dusk strokes stay in the new canvas, while SaveInkCanvasStrokes still serializes only inkCanvas.Strokes (Ink Canvas/MainWindow_cs/MW_Save&OpenStrokes.cs:829) and no stroke bridge is installed. Could you check saving and reopening a page drawn with the now-default Dusk engine, which currently reports success while saving none of that ink?

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

{
LogHelper.WriteLogToFile($"[Startup] 主窗口加载开始,启动模式={App.CurrentStartupMode}", LogHelper.LogType.Info);
loadPenCanvas();
ApplyInkEngine(Settings?.Canvas?.InkEngine ?? InkEngineType.Dusk);

@augmentcode augmentcode Bot Oct 10, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

At Ink Canvas/MainWindow.xaml.cs:1535, this runs before LoadSettings(true) at line 1545, so SettingsManager's initial Dusk default is applied instead of the persisted InkEngine. Could you check restarting after selecting WPF or WinRT, since loading the saved settings never calls ApplyInkEngine again and leaves the window configured for Dusk?

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.


inkCanvas.IsHitTestVisible = true;
inkCanvas.Visibility = Visibility.Visible;
SetDuskCanvasActive(true);

@augmentcode augmentcode Bot Oct 10, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you check the WPF cursor-to-pen path at Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs:3705 (also applies to other locations in the PR)? CursorIcon_Click leaves inkCanvas.IsHitTestVisible=false, but SetDuskCanvasActive returns immediately for WPF and SetCurrentToolMode does not restore hit testing, so the WPF canvas can no longer receive drawing input after this transition.

Severity: medium

Other Locations
  • Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs:4986

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

if (inkCanvas != null)
{
inkCanvas.IsHitTestVisible = false;
inkCanvas.Visibility = Visibility.Hidden;

@augmentcode augmentcode Bot Oct 10, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you check existing image/PDF content when entering pen mode at Ink Canvas/MainWindow_cs/MW_DuskInk.cs:151 (also applies to other locations in the PR)? These elements are still hosted in inkCanvas.Children, so hiding the entire WPF canvas hides the document being annotated, not just its WPF ink renderer.

Severity: medium

Other Locations
  • Ink Canvas/MainWindow_cs/MW_DuskInk.cs:49
  • Ink Canvas/MainWindow_cs/MW_DuskInk.cs:93
  • Ink Canvas/MainWindow.xaml:230

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

/// <param name="e">路由事件参数</param>
private void BtnUndo_Click(object sender, RoutedEventArgs e)
{
if (Settings?.Canvas?.InkEngine == InkEngineType.Dusk && duskCanvas != null && duskCanvas.CanUndo)

@augmentcode augmentcode Bot Oct 10, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you check whether the Dusk history branch at Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs:4484 is reachable through the toolbars (also applies to redo)? Their buttons and click handlers are gated by IsUndoEnabled/IsRedoEnabled, which are updated only by the WPF timeMachine, so drawing Dusk strokes leaves undo disabled and Dusk history changes never enable redo.

Severity: medium

Other Locations
  • Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs:4507

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment on lines +247 to +250
if (isErasedByCode)
{
// 代码内部切页/暂存过渡,不销毁当前槽位笔迹
return;

@augmentcode augmentcode Bot Oct 10, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

At Ink Canvas/MainWindow_cs/MW_DuskInk.cs:247-250, every code-driven clear becomes a no-op for Dusk, but OnPPTSlideShowNextSlide calls ClearStrokes(true) and never switches Dusk slots. Could you check advancing a presentation after annotating slide 1, since all slideshow pages remain in slot 0 and slide 1's ink stays visible over later slides?

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

}

var targetIndex = isBackupMain ? 0 : CurrentWhiteboardIndex;
DuskSwitchSlot(targetIndex);

@augmentcode augmentcode Bot Oct 10, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you check inserting a whiteboard page before an existing page at Ink Canvas/MainWindow_cs/MW_BoardControls.cs:262? BtnWhiteBoardAdd_Click shifts only the WPF histories, so DuskSwitchSlot(targetIndex) selects the old next page's native strokes for the supposedly blank new page, while the displaced page subsequently selects a different slot.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants