dde-file-manager icon indicating copy to clipboard operation
dde-file-manager copied to clipboard

修复两个桌面整理的问题

Open itsXuSt opened this issue 5 months ago • 8 comments
trafficstars

Summary by Sourcery

Enhance the desktop organizer plugin by introducing screen‐specific style configurations with fallback to the last used layout, deprecating legacy custom‐style code, and fixing collection relayout selection issues.

Bug Fixes:

  • Ensure newly created collections are included in relayout and deduplicated by switching to QSet for relayoutedCollectionIDs.
  • Fallback to the last saved style configuration when no layout exists for the current screen resolution.

Enhancements:

  • Refactor normalStyle/update/write APIs to accept a generated screenConfigId instead of a custom flag.
  • Add generateScreenConfigId logic based on surface dimensions and persist lastStyleConfigId in settings.
  • Stub out obsolete custom style methods and remove associated settings writes.

itsXuSt avatar Jun 16 '25 09:06 itsXuSt

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: itsXuSt

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

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

deepin-ci-robot avatar Jun 16 '25 09:06 deepin-ci-robot

deepin pr auto review

关键摘要:

  • ConfigPresenter类中,customStyleupdateCustomStylewriteCustomStyle方法被注释掉,可能需要确认这些功能是否真的不再需要。
  • ConfigPresenter类中新增的setLastStyleConfigIdlastStyleConfigIdhasConfigId方法,应该添加相应的注释说明其用途和功能。
  • OrganizerConfig类中新增的setLastStyleConfigIdlastStyleConfigIdhasConfigId方法,应该添加相应的注释说明其用途和功能。
  • NormalizedMode类中新增的generateScreenConfigId方法,应该添加相应的注释说明其用途和功能。
  • NormalizedMode类中的layout方法中,对于validConfigId的使用,应该添加注释说明其选择逻辑。
  • NormalizedMode类中的rebuild方法中,对于profiles的使用,应该添加注释说明其来源和用途。

是否建议立即修改: 是

  • 确认注释掉的方法是否真的不再需要,如果需要,应该恢复这些方法。
  • 添加必要的注释,以便其他开发者理解代码的意图和功能。
  • 确保新增的方法有适当的文档说明,以便维护和扩展。

deepin-ci-robot avatar Jun 16 '25 09:06 deepin-ci-robot

Reviewer's Guide

Introduces per-screen persistent style configuration IDs and refactors style APIs across ConfigPresenter and OrganizerConfig to use these IDs, disables legacy custom-style methods, adds fallback to the last used config when the current one is missing, and improves rebuild logic by switching to a set for relayout tracking and ensuring newly created collections are selected.

Sequence Diagram: Retrieving Normal Style with configId

sequenceDiagram
    participant NM as NormalizedMode
    participant CP as ConfigPresenter
    participant OC as OrganizerConfig

    NM->>CP: normalStyle(configId, key)
    CP->>OC: collectionStyle(configId, key)
    OC-->>CP: CollectionStyle
    CP-->>NM: CollectionStyle

Sequence Diagram: Updating Normal Style with configId

sequenceDiagram
    participant NMP as NormalizedModePrivate
    participant CP as ConfigPresenter
    participant OC as OrganizerConfig

    NMP->>CP: updateNormalStyle(configId, style)
    CP->>OC: updateCollectionStyle(configId, style)
    CP->>OC: sync()

Sequence Diagram: Layout Style Configuration Logic in NormalizedMode

sequenceDiagram
    participant NM as NormalizedMode
    participant NMP as NormalizedModePrivate
    participant CP as ConfigPresenter

    NM->>NMP: generateScreenConfigId()
    NMP-->>NM: currentConfigId
    NM->>CP: lastStyleConfigId()
    CP-->>NM: lastConfigId
    NM->>CP: hasConfigId(currentConfigId)
    CP-->>NM: bool hasCurrentConfig

    alt hasCurrentConfig is true
        NM->>NM: validConfigId = currentConfigId
    else hasCurrentConfig is false
        NM->>NM: validConfigId = lastConfigId
    end

    loop for each collection holder
        NM->>CP: normalStyle(validConfigId, holderId)
        CP-->>NM: CollectionStyle
    end

    NM->>CP: writeNormalStyle(currentConfigId, stylesToSave)
    NM->>CP: setLastStyleConfigId(currentConfigId)

Entity Relationship Diagram: Style Configuration Storage

erDiagram
    ConfigStorage {
        string LastStyleConfigId
    }
    StyleProfile {
        string ConfigID PK "e.g., StyleConfig_1920x1080"
    }
    CollectionStyleData {
        string Key PK "within StyleProfile"
        string Rect
        int ScreenIndex
    }

    ConfigStorage ||--o{ StyleProfile : "has multiple"
    StyleProfile ||--|{ CollectionStyleData : "contains"

Class Diagram: ConfigPresenter Changes

classDiagram
    class ConfigPresenter {
        +setLastStyleConfigId(QString id): void
        +lastStyleConfigId(): QString
        +hasConfigId(QString configId): bool
        +normalStyle(QString configId, QString key): CollectionStyle
        +updateNormalStyle(QString configId, CollectionStyle style): void
        +writeNormalStyle(QString configId, QList<CollectionStyle> styles): void
        +customStyle(QString key): CollectionStyle "stubbed"
        +updateCustomStyle(CollectionStyle style): void "stubbed"
        +writeCustomStyle(QList<CollectionStyle> styles): void "stubbed"
    }

Class Diagram: OrganizerConfig Changes

classDiagram
    class OrganizerConfig {
        +setLastStyleConfigId(QString id): void
        +lastStyleConfigId(): QString
        +hasConfigId(QString configId): bool
        +collectionStyle(QString styleId, QString key): CollectionStyle
        +updateCollectionStyle(QString styleId, CollectionStyle style): void
        +writeCollectionStyle(QString styleId, QList<CollectionStyle> styles): void
    }

Class Diagram: NormalizedModePrivate Changes

classDiagram
    class NormalizedModePrivate {
        +relayoutedCollectionIDs: QSet<QString>
        +generateScreenConfigId(): QString
    }

File-Level Changes

Change Details Files
Introduce and persist screen-specific style-config IDs and refactor style APIs to use them
  • Added generateScreenConfigId to compute an ID from surface resolutions
  • Added ConfigPresenter methods setLastStyleConfigId, lastStyleConfigId, hasConfigId
  • Extended OrganizerConfig with setLastStyleConfigId, lastStyleConfigId and hasConfigId persistence
  • Updated normalStyle, updateNormalStyle and writeNormalStyle signatures in both ConfigPresenter and OrganizerConfig to accept configId
config/configpresenter.cpp
config/configpresenter.h
config/organizerconfig.cpp
config/organizerconfig.h
mode/normalizedmode.cpp
mode/normalizedmode_p.h
Disable legacy custom-style handling
  • Replaced customStyle, updateCustomStyle and writeCustomStyle implementations with stubs
  • Commented out old custom-style logic in ConfigPresenter
config/configpresenter.cpp
config/configpresenter.h
Fallback to last used style-config when current ID is missing
  • In layout(), check hasConfigId before using generated ID
  • Use lastStyleConfigId as validConfigId when generated configId is not found
  • Apply validConfigId for subsequent style lookups and writes
mode/normalizedmode.cpp
Ensure new collections are included in selection and improve relayout tracking
  • Replaced QList with QSet for relayoutedCollectionIDs to speed up membership tests
  • During rebuild(), detect collections absent from the original profile, insert their IDs into the set and append their files for selection
mode/normalizedmode.cpp
mode/normalizedmode_p.h

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

  • Contact our support team for questions or feedback.
  • Visit our documentation for detailed guides and information.
  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.

sourcery-ai[bot] avatar Jun 16 '25 10:06 sourcery-ai[bot]

TAG Bot

New tag: 6.5.64 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2925

deepin-bot[bot] avatar Jun 18 '25 03:06 deepin-bot[bot]

TAG Bot

New tag: 6.5.65 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2927

deepin-bot[bot] avatar Jun 18 '25 11:06 deepin-bot[bot]

TAG Bot

New tag: 6.5.66 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2934

deepin-bot[bot] avatar Jun 20 '25 06:06 deepin-bot[bot]

TAG Bot

New tag: 6.5.67 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2942

deepin-bot[bot] avatar Jun 23 '25 04:06 deepin-bot[bot]

TAG Bot

New tag: 6.5.68 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2946

deepin-bot[bot] avatar Jun 23 '25 09:06 deepin-bot[bot]

TAG Bot

New tag: 6.5.69 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2956

deepin-bot[bot] avatar Jun 27 '25 09:06 deepin-bot[bot]

TAG Bot

New tag: 6.5.70 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2961

deepin-bot[bot] avatar Jul 01 '25 13:07 deepin-bot[bot]

TAG Bot

New tag: 6.5.71 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2964

deepin-bot[bot] avatar Jul 02 '25 03:07 deepin-bot[bot]

TAG Bot

New tag: 6.5.72 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2969

deepin-bot[bot] avatar Jul 03 '25 08:07 deepin-bot[bot]

TAG Bot

New tag: 6.5.73 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2970

deepin-bot[bot] avatar Jul 03 '25 08:07 deepin-bot[bot]

TAG Bot

New tag: 6.5.74 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2971

deepin-bot[bot] avatar Jul 03 '25 12:07 deepin-bot[bot]

TAG Bot

New tag: 6.5.75 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2976

deepin-bot[bot] avatar Jul 04 '25 10:07 deepin-bot[bot]

TAG Bot

New tag: 6.5.76 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #2994

deepin-bot[bot] avatar Jul 10 '25 12:07 deepin-bot[bot]

TAG Bot

New tag: 6.5.77 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3003

deepin-bot[bot] avatar Jul 16 '25 02:07 deepin-bot[bot]

TAG Bot

New tag: 6.5.78 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3004

deepin-bot[bot] avatar Jul 17 '25 11:07 deepin-bot[bot]

TAG Bot

New tag: 6.5.79 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3007

deepin-bot[bot] avatar Jul 17 '25 13:07 deepin-bot[bot]

TAG Bot

New tag: 6.5.80 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3008

deepin-bot[bot] avatar Jul 18 '25 02:07 deepin-bot[bot]

TAG Bot

New tag: 6.5.81 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3023

deepin-bot[bot] avatar Jul 24 '25 10:07 deepin-bot[bot]

TAG Bot

New tag: 6.5.83 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3037

deepin-bot[bot] avatar Jul 31 '25 09:07 deepin-bot[bot]

TAG Bot

New tag: 6.5.84 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3056

deepin-bot[bot] avatar Aug 08 '25 07:08 deepin-bot[bot]

TAG Bot

New tag: 6.5.85 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3067

deepin-bot[bot] avatar Aug 13 '25 09:08 deepin-bot[bot]

TAG Bot

New tag: 6.5.86 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3068

deepin-bot[bot] avatar Aug 13 '25 09:08 deepin-bot[bot]

TAG Bot

New tag: 6.5.87 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3070

deepin-bot[bot] avatar Aug 14 '25 06:08 deepin-bot[bot]

TAG Bot

New tag: 6.5.88 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3079

deepin-bot[bot] avatar Aug 21 '25 13:08 deepin-bot[bot]

TAG Bot

New tag: 6.5.89 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3081

deepin-bot[bot] avatar Aug 22 '25 03:08 deepin-bot[bot]

TAG Bot

New tag: 6.5.90 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3094

deepin-bot[bot] avatar Aug 29 '25 03:08 deepin-bot[bot]

TAG Bot

New tag: 6.5.91 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #3110

deepin-bot[bot] avatar Sep 04 '25 13:09 deepin-bot[bot]