Skip to content

白板名言位置自定义调节#434

Draft
CJKmkp wants to merge 5 commits intobetafrom
trae/solo-agent-mqsfBN
Draft

白板名言位置自定义调节#434
CJKmkp wants to merge 5 commits intobetafrom
trae/solo-agent-mqsfBN

Conversation

@CJKmkp
Copy link
Copy Markdown
Member

@CJKmkp CJKmkp commented Apr 6, 2026

No description provided.

CJKmkp and others added 3 commits April 6, 2026 05:39
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a154e13717

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1378 to +1380
_watermarkStartX = WaterMarkCanvas.ActualWidth - BlackBoardWaterMark.ActualWidth - right;
// 转换为Left定位
Canvas.SetRight(BlackBoardWaterMark, double.NaN);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve x-position when switching from Right to Left anchor

When the watermark starts with only Canvas.Right set (the default XAML state), this branch clears Canvas.Right but never sets Canvas.Left. A simple click on the watermark without dragging then leaves both anchors unset, so WPF repositions it at the canvas origin on the next layout pass. This produces an unexpected jump to the left edge even though the user did not move it.

Useful? React with 👍 / 👎.

Comment on lines +1412 to +1413
if (newLeft + BlackBoardWaterMark.ActualWidth > WaterMarkCanvas.ActualWidth)
newLeft = WaterMarkCanvas.ActualWidth - BlackBoardWaterMark.ActualWidth;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clamp watermark position after right-edge overflow math

The boundary logic can still produce a negative newLeft when the quote text is wider than the canvas: after clamping negative values to 0, this assignment overwrites it with ActualWidth - TextWidth, which is negative. In that case the saved position becomes off-screen, so users with long quotes or narrow windows can end up with a watermark they cannot fully bring back into view.

Useful? React with 👍 / 👎.

Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93ca8e778b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Settings.Appearance.IsWatermarkPositionCustomized = true;

// 延迟保存避免频繁写盘
SaveSettingsToFile();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Defer settings persistence until drag completes

Calling SaveSettingsToFile() on every MouseMove event writes the full settings JSON synchronously for each pointer update, which can cause visible UI stutter during dragging (especially on slower disks) and unnecessary disk churn. This handler already saves again on mouse-up, so persisting only at the end of the drag (or with an actual debounce/throttle) avoids a performance regression introduced by this feature.

Useful? React with 👍 / 👎.

Comment on lines +542 to +543
System.Windows.Controls.Canvas.SetLeft(BlackBoardWaterMark, Settings.Appearance.WatermarkPositionX);
System.Windows.Controls.Canvas.SetTop(BlackBoardWaterMark, Settings.Appearance.WatermarkPositionY);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clamp restored watermark coordinates to current canvas

When loading a customized watermark position, the code applies stored WatermarkPositionX/Y directly without validating against the current WaterMarkCanvas size. If the user saved coordinates on a larger display and later opens on a smaller one, the watermark can load off-screen and become impossible to drag back through the UI. Clamp the restored values to the canvas bounds before assigning them.

Useful? React with 👍 / 👎.

Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3f38bda7e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1323 to +1326
private void InkCanvas_EndWatermarkAdjustment(object sender, MouseButtonEventArgs e)
{
EndWatermarkAdjustment();
inkCanvas.MouseDown -= InkCanvas_EndWatermarkAdjustment;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Mark adjustment-exit clicks as handled

The exit handler ends adjustment mode but does not set e.Handled, so the same click continues through normal canvas input processing. In this app, inkCanvas already has a MouseDown handler (inkCanvas_MouseDown) that captures input and starts interaction, so when users click the canvas to finish watermark positioning, that click can also create an unintended stroke/dot in drawing workflows. Consuming the event (or handling this in preview phase) avoids modifying the board when the user is only trying to exit adjustment mode.

Useful? React with 👍 / 👎.

@CJKmkp CJKmkp marked this pull request as draft April 6, 2026 06:16
@doudou0720
Copy link
Copy Markdown
Member

怎么还有bot coauthored

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