Skip to content

snap doc - #117

Draft
glyvut wants to merge 1 commit into
linuxdeepin:masterfrom
glyvut:s4
Draft

glyvut wants to merge 1 commit into
linuxdeepin:masterfrom
glyvut:s4

Conversation

@glyvut

@glyvut glyvut commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Refresh the unstable snap-target protocol documentation to reflect current behavior.

Enhancements:

  • Update the unstable snap-target protocol documentation to remove outdated compositor positioning and seat-association requirements, along with the obsolete snap-busy failure-event description.

Documentation:

  • Clarify the snap-target protocol documentation by removing no-longer-applicable behavior and event semantics.

@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@glyvut
glyvut marked this pull request as ready for review September 29, 2026 06:29
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: glyvut

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the snap-target protocol XML to report invalid seat arguments separately from busy snap sessions and aligns the surrounding start, failure event, and surface documentation with the clarified behavior.

File-Level Changes

Change Details Files
Distinguish invalid seat arguments from an already-active snap session in the protocol failure reasons.
  • Add the invalid_seat enum value with its wl_seat validation semantics.
  • Document that start reports invalid_seat when the seat object is invalid while retaining snap_busy for active sessions.
public/treeland-snap-target-unstable-v1.xml
Streamline and clarify snap-target protocol documentation.
  • Remove redundant compositor seat-policy wording.
  • Remove the duplicate snap_busy explanation from the failed event documentation.
  • Remove the compositor layout-engine positioning claim from the snap-target surface description.
public/treeland-snap-target-unstable-v1.xml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@glyvut
glyvut requested a review from wineee September 29, 2026 06:30

@sourcery-ai sourcery-ai 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.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="public/treeland-snap-target-unstable-v1.xml" line_range="29" />
<code_context>
     1. Raises the surface above normal windows and their popup panels.
     2. Disables window open/close animations.
     3. Excludes the surface from the multitask view and window switcher.
-    4. Disables automatic positioning by the compositor's layout engine.

     Such a surface does not affect the snapping protocol; snapping
</code_context>
<issue_to_address>
**nitpick:** Removing item 4 makes the protocol documentation no longer state that snap-mask surfaces are excluded from automatic compositor positioning, even though the surrounding list still presents the remaining items as the surface configuration applied by the compositor.

**Suggested fix:** Restore the automatic-positioning item unless that compositor behavior was intentionally removed as part of this change.
</issue_to_address>

### Comment 2
<location path="public/treeland-snap-target-unstable-v1.xml" line_range="123-127" />
<code_context>
       <description summary="reasons why snapping failed"/>
       <entry name="snap_busy" value="0"
              summary="another client has an active snap session"/>
+      <entry name="invalid_seat" value="1"
+             summary="the seat argument is not a valid wl_seat"/>
     </enum>
</code_context>
<issue_to_address>
**issue (bug_risk):** A non-null `object` argument declared with `interface="wl_seat"` is type-checked by the Wayland dispatcher before `start` is delivered; an unknown, null, or non-`wl_seat` object causes a protocol error rather than a `failed` event with `invalid_seat`. The new reason therefore cannot distinguish the malformed `wl_seat` arguments described by its summary.

**Triggers:** When the client passes an unknown, null, destroyed, or object of another interface as `seat`.

**Suggested fix:** Define `invalid_seat` in terms of a compositor-level seat validation failure for an otherwise valid `wl_seat`, or document that malformed object arguments are protocol errors and cannot produce this event.

```suggestion
        If snapping cannot be started because another client's snap session
        is already active, the compositor sends a failed event with the
        snap_busy reason instead. If the seat argument is unknown, null, or
        not a wl_seat, the request causes a protocol error and no failed event
        is sent. If compositor-level validation of an otherwise valid wl_seat
        fails, the compositor sends a failed event with the invalid_seat
        reason.
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread public/treeland-snap-target-unstable-v1.xml
Comment thread public/treeland-snap-target-unstable-v1.xml Outdated
@glyvut
glyvut marked this pull request as draft September 29, 2026 07:02
@glyvut glyvut changed the title fix(protocol): add invalid_seat failure reason to snap-target fdoc Sep 29, 2026
@glyvut glyvut changed the title fdoc snap doc Sep 29, 2026
Removed unnecessary wording from the snap-target protocol spec:
the auto-positioning exclusion clause, the seat policy note, and
the snap_busy explanation.

精简snap-target协议规范文本:移除自动定位排除条款、seat策略说明和snap_busy解释。

Log: 精简snap-target协议规范文本
Influence: 协议规范文本更精简,不影响协议接口的功能和语义。
@deepin-bot

deepin-bot Bot commented Oct 10, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 0.7.0
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #121

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