Skip to content

Conversation

onesounds
Copy link
Contributor

What's the PR

image

  • Fixes a XAML error caused by a card property that used to be set automatically within a card group.
  • Changed the 'First', 'Middle', and 'Last' properties, which were previously set automatically within the Card control, to be added manually upon registration.
  • Added the property to each pages

Details

  • This property was introduced to adjust the borders when there are multiple cards inside a CardGroup. The previous method, which seems to have operated automatically, would display an error message when the card was not part of a CardGroup. In other words, the issue was caused by a dependency on whether or not the control was within a CardGroup. Even with a fallback value, the error persisted, so we've modified the logic to function regardless of whether it's in a CardGroup. Now, developers are required to explicitly set the value if needed.

@prlabeler prlabeler bot added the bug Something isn't working label Jun 27, 2025
@coderabbitai coderabbitai bot added the enhancement New feature or request label Jun 27, 2025
Copy link
Contributor

coderabbitai bot commented Jun 27, 2025

📝 Walkthrough

"""

Walkthrough

The changes update the Card control's styling logic by introducing and utilizing a new Type property to identify a card's position within a group (First, Middle, Last). XAML files for various settings pages are updated to set this Type attribute on relevant cards. The CardType enum is expanded to support these new values.

Changes

Files/Groups Change Summary
Flow.Launcher/Resources/Controls/Card.xaml Modified style triggers to use the Card's Type property instead of an attached property for styling.
Flow.Launcher/Resources/Controls/Card.xaml.cs Added First, Middle, and Last values to the CardType enum.
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml
Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml
Added Type="First" and Type="Last" attributes to relevant <cc:Card> elements in grouped sections.
Flow.Launcher/SettingPages/Views/SettingsPaneProxy.xaml Assigned Type="First" to the first card, Type="Middle" to intermediate cards, and Type="Last" to the last card in the proxy settings.
Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml Added Type="First" and Type="Last" attributes to cards in hotkey settings.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SettingsPage (XAML)
    participant Card Control
    participant Card.xaml (Style)

    User->>SettingsPage (XAML): Loads settings page
    SettingsPage (XAML)->>Card Control: Instantiates Card with Type (First/Middle/Last)
    Card Control->>Card.xaml (Style): Applies style based on Type property
    Card.xaml (Style)-->>Card Control: Sets styling (Margin, CornerRadius, etc.)
    Card Control-->>SettingsPage (XAML): Renders styled card
Loading

Suggested reviewers

  • onesounds
    """

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c83921f and bafb5d7.

📒 Files selected for processing (1)
  • Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: build

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b183298 and c9de2f0.

📒 Files selected for processing (6)
  • Flow.Launcher/Resources/Controls/Card.xaml (1 hunks)
  • Flow.Launcher/Resources/Controls/Card.xaml.cs (1 hunks)
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (6 hunks)
  • Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml (2 hunks)
  • Flow.Launcher/SettingPages/Views/SettingsPaneProxy.xaml (1 hunks)
  • Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml (4 hunks)
🧰 Additional context used
🧠 Learnings (3)
Flow.Launcher/Resources/Controls/Card.xaml (4)
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:20:54.978Z
Learning: In WPF applications like Flow.Launcher, Border elements cannot directly display text content and require a child element like TextBlock to handle text rendering. This separation of concerns (Border for visual container styling, TextBlock for text display) follows WPF best practices and provides greater styling flexibility.
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:20:54.978Z
Learning: In WPF applications like Flow.Launcher, Border elements cannot directly display text content and require a child element like TextBlock to handle text rendering. This separation of concerns (Border for visual container styling, TextBlock for text display) follows WPF best practices and provides greater styling flexibility.
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:12:13.386Z
Learning: In Flow.Launcher, hotkey styling is implemented with a two-component structure: a Border element with style `ItemHotkeyBGStyle` that provides background and border styling, containing a TextBlock with style `ItemHotkeyStyle` that handles the text styling.
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#0
File: :0-0
Timestamp: 2025-04-23T15:14:49.986Z
Learning: In WPF applications like Flow.Launcher, font styling should be applied using implicit styles instead of setting the FontFamily property on individual controls. Define implicit styles in a ResourceDictionary using <Style TargetType="{x:Type Button}"> format and merge it into App.xaml, which automatically applies the font to all instances of the control type while still allowing explicit overrides where needed.
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (1)
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#3118
File: Flow.Launcher/ViewModel/MainViewModel.cs:1404-1413
Timestamp: 2024-12-08T21:12:12.060Z
Learning: In the `MainViewModel` class, the `_lastQuery` field is initialized in the constructor and is never null.
Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml (1)
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:12:13.386Z
Learning: In Flow.Launcher, hotkey styling is implemented with a two-component structure: a Border element with style `ItemHotkeyBGStyle` that provides background and border styling, containing a TextBlock with style `ItemHotkeyStyle` that handles the text styling.
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: build
🔇 Additional comments (7)
Flow.Launcher/Resources/Controls/Card.xaml.cs (1)

12-15: LGTM! Clean enum extension.

The addition of First, Middle, and Last values to the CardType enum is well-structured and follows the existing pattern. This supports the new explicit positioning approach for card styling.

Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml (1)

492-493: Excellent implementation of the new Type attribute pattern.

The Type assignments correctly identify first and last cards in their respective CardGroups, ensuring proper visual styling boundaries. The pattern is consistent across both backdrop/shadow and clock/date card groups.

Also applies to: 509-510, 551-554, 575-578

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (1)

94-97: Consistent and correct Type attribute implementation.

All CardGroups properly implement the First/Last pattern for their respective card pairs. The Type assignments will ensure appropriate visual styling for grouped cards while maintaining the new explicit positioning approach.

Also applies to: 122-122, 203-206, 215-218, 388-389, 398-399

Flow.Launcher/Resources/Controls/Card.xaml (1)

41-46: Well-implemented style trigger updates for the new Type property.

The DataTrigger bindings correctly use the Card's Type property instead of the attached property, and the styling logic appropriately handles visual grouping:

  • First cards: Clean start with no borders
  • Middle/Last cards: Top border creates visual continuation
  • All grouped cards: Transparent background maintains cohesion

This resolves the dependency issue while preserving the intended card grouping visual effects.

Also applies to: 48-53, 55-60

Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml (3)

54-57: LGTM: Explicit Type attribute correctly applied.

The Type="First" attribute properly identifies this card as the first element in the CardGroup, replacing the previous automatic detection that caused XAML errors.


65-68: LGTM: Explicit Type attribute correctly applied.

The Type="Last" attribute properly identifies this card as the last element in the CardGroup, completing the explicit positioning approach for this group.


213-221: LGTM: New RenameFileHotkey card properly implemented.

The new card follows the established pattern:

  • Uses Type="Inside" consistent with other cards in the hotkeyPresets section
  • Properly configured HotkeyControl with F2 default hotkey
  • Includes appropriate validation settings
  • Uses correct resource binding for the title

The implementation aligns well with the existing hotkey cards in this section.

Copy link
Member

@Jack251970 Jack251970 left a comment

Choose a reason for hiding this comment

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

LGTM! The performance of the settings window under debug configuration is improved largely!

@Jack251970 Jack251970 added Dev branch only An issue or fix for the Dev branch build and removed bug Something isn't working enhancement New feature or request 5 min review labels Jun 27, 2025
@onesounds onesounds enabled auto-merge June 27, 2025 11:40
@onesounds onesounds merged commit fd97901 into Flow-Launcher:dev Jun 27, 2025
7 checks passed
@Jack251970 Jack251970 changed the title Fix Card Control Fix Card Control in CardGroup Jun 27, 2025
@prlabeler prlabeler bot added the bug Something isn't working label Jun 27, 2025
@Jack251970 Jack251970 removed the Dev branch only An issue or fix for the Dev branch build label Jun 27, 2025
@onesounds
Copy link
Contributor Author

I turned off this debug message, so I was completely aware of it.

@jjw24 jjw24 added this to the 2.0.0 milestone Jun 27, 2025
@jjw24 jjw24 added Dev branch only An issue or fix for the Dev branch build bug Something isn't working and removed bug Something isn't working Dev branch only An issue or fix for the Dev branch build labels Jun 27, 2025
Copy link

gitstream-cm bot commented Jun 27, 2025

🥷 Code experts: Yusyuriv, Jack251970

onesounds, Jack251970 have most 👩‍💻 activity in the files.
onesounds, Yusyuriv have most 🧠 knowledge in the files.

See details

Flow.Launcher/Resources/Controls/Card.xaml

Activity based on git-commit:

onesounds Jack251970
JUN 3 additions & 3 deletions
MAY
APR
MAR 13 additions & 13 deletions
FEB
JAN

Knowledge based on git-blame:
onesounds: 87%
Yusyuriv: 13%

Flow.Launcher/Resources/Controls/Card.xaml.cs

Activity based on git-commit:

onesounds Jack251970
JUN 4 additions & 1 deletions
MAY
APR
MAR
FEB
JAN

Knowledge based on git-blame:
onesounds: 63%
Yusyuriv: 37%

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Activity based on git-commit:

onesounds Jack251970
JUN 50 additions & 36 deletions 1 additions & 2 deletions
MAY 51 additions & 11 deletions
APR 130 additions & 69 deletions 11 additions & 8 deletions
MAR 43 additions & 62 deletions 44 additions & 20 deletions
FEB 1 additions & 1 deletions
JAN 8 additions & 1 deletions

Knowledge based on git-blame:
onesounds: 64%
Yusyuriv: 23%

Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml

Activity based on git-commit:

onesounds Jack251970
JUN 17 additions & 2 deletions 0 additions & 9 deletions
MAY 4 additions & 1 deletions 1 additions & 1 deletions
APR
MAR 14 additions & 28 deletions
FEB
JAN

Knowledge based on git-blame:
Yusyuriv: 84%
onesounds: 12%

Flow.Launcher/SettingPages/Views/SettingsPaneProxy.xaml

Activity based on git-commit:

onesounds Jack251970
JUN 5 additions & 5 deletions
MAY
APR 4 additions & 4 deletions
MAR
FEB
JAN

Knowledge based on git-blame:
Yusyuriv: 65%
onesounds: 30%

Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml

Activity based on git-commit:

onesounds Jack251970
JUN 12 additions & 4 deletions
MAY 2 additions & 2 deletions
APR 25 additions & 10 deletions 35 additions & 10 deletions
MAR 174 additions & 149 deletions 62 additions & 35 deletions
FEB
JAN

Knowledge based on git-blame:
onesounds: 78%
Yusyuriv: 17%

To learn more about /:\ gitStream - Visit our Docs

@jjw24 jjw24 modified the milestones: 2.0.0, 1.20.2 Jul 13, 2025
jjw24 added a commit that referenced this pull request Jul 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants