Skip to content

Fix Quick Access Links of type File ignoring custom name in search results#4354

Merged
Jack251970 merged 2 commits into
devfrom
copilot/fix-quick-access-links-names
Mar 15, 2026
Merged

Fix Quick Access Links of type File ignoring custom name in search results#4354
Jack251970 merged 2 commits into
devfrom
copilot/fix-quick-access-links-names

Conversation

@VictoriousRaptor
Copy link
Copy Markdown
Contributor

@VictoriousRaptor VictoriousRaptor commented Mar 14, 2026

Fixes #3772


Summary by cubic

Summary of changes
Fixes file-type Quick Access Links ignoring custom names by passing the saved link name into ResultManager.CreateFileResult, so search results display the custom title.

  • Changed: QuickAccess.AccessLinkListMatched and AccessLinkListAll now call CreateFileResult(..., name: l.Name) for ResultType.File.
  • Changed: ResultManager.CreateFileResult accepts an optional string name and uses it for the result title; falls back to Path.GetFileName(filePath) when not provided.
  • Added: Support for displaying custom names for file-type Quick Access Links in results.
  • Removed: Nothing; filename fallback remains.
  • Memory impact: None noticeable. Only an extra optional string parameter; no new persistent allocations.
  • Security: No new risks. Only the display title changes; file paths and execution behavior are unchanged.
  • Tests: No new unit tests included.

Written for commit d0c30df. Summary will update on new commits.

Copilot AI and others added 2 commits March 13, 2026 14:26
Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com>
@VictoriousRaptor VictoriousRaptor self-assigned this Mar 14, 2026
@VictoriousRaptor VictoriousRaptor added the bug Something isn't working label Mar 14, 2026
@github-actions github-actions Bot added this to the 2.2.0 milestone Mar 14, 2026
@gitstream-cm
Copy link
Copy Markdown

gitstream-cm Bot commented Mar 14, 2026

🥷 Code experts: Jack251970

Jack251970 has most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

Plugins/Flow.Launcher.Plugin.Explorer/Search/QuickAccessLinks/QuickAccess.cs

Activity based on git-commit:

Jack251970
MAR
FEB
JAN
DEC
NOV
OCT

Knowledge based on git-blame:
Jack251970: 100%

Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs

Activity based on git-commit:

Jack251970
MAR
FEB
JAN
DEC
NOV
OCT

Knowledge based on git-blame:
Jack251970: 100%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@gitstream-cm
Copy link
Copy Markdown

gitstream-cm Bot commented Mar 14, 2026

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 14, 2026

📝 Walkthrough

Walkthrough

This change adds support for custom file names in Quick Access Links search results by introducing an optional name parameter to the CreateFileResult method. The parameter takes precedence over the default filename extraction behavior, allowing renamed Quick Access Links to display their custom names instead of original filenames.

Changes

Cohort / File(s) Summary
Quick Access call sites
Plugins/Flow.Launcher.Plugin.Explorer/Search/QuickAccessLinks/QuickAccess.cs
Updated two CreateFileResult call sites to pass name: l.Name argument, enabling custom names for Quick Access Link results.
Result creation logic
Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs
Extended CreateFileResult method with optional string name parameter; updated title computation to use provided name with fallback to extracted filename.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PR #1018: Modifies the same CreateFileResult method signature and title/subtitle computation logic in ResultManager.cs.

Suggested reviewers

  • Jack251970
  • jjw24
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: fixing Quick Access Links of type File to display custom names in search results.
Description check ✅ Passed The description is clearly related to the changeset, explaining the problem, solution, and changes made to address the issue.
Linked Issues check ✅ Passed The code changes directly address issue #3772 by passing custom names to CreateFileResult for file-type Quick Access Links, ensuring custom names display in search results.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the Quick Access Links naming issue; modifications to CreateFileResult signature and its call sites are directly related to the stated objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/fix-quick-access-links-names
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

Copy link
Copy Markdown
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs`:
- Line 288: The title assignment treats empty or whitespace-only name as valid;
update the fallback to use string.IsNullOrWhiteSpace so blank names fall back to
the filename. Replace the current expression that sets title (var title = name
?? Path.GetFileName(filePath) ?? string.Empty;) with a conditional using
string.IsNullOrWhiteSpace(name) (e.g., var title =
string.IsNullOrWhiteSpace(name) ? Path.GetFileName(filePath) ?? string.Empty :
name.Trim(); ) so that null/empty/whitespace names use
Path.GetFileName(filePath) and non-empty names are trimmed and used.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d5f7f1c6-c608-43d1-95ca-b29ee00f74ce

📥 Commits

Reviewing files that changed from the base of the PR and between 86d7c1e and d0c30df.

📒 Files selected for processing (2)
  • Plugins/Flow.Launcher.Plugin.Explorer/Search/QuickAccessLinks/QuickAccess.cs
  • Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs

{
var isMedia = IsMedia(Path.GetExtension(filePath));
var title = Path.GetFileName(filePath) ?? string.Empty;
var title = name ?? Path.GetFileName(filePath) ?? string.Empty;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Handle empty custom names in fallback logic.

On Line 288, an empty/whitespace name is treated as a valid title, which can render blank file result titles. Fallback should apply for null and empty/whitespace values.

Suggested fix
-            var title = name ?? Path.GetFileName(filePath) ?? string.Empty;
+            var title = string.IsNullOrWhiteSpace(name)
+                ? (Path.GetFileName(filePath) ?? string.Empty)
+                : name;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs` at line 288,
The title assignment treats empty or whitespace-only name as valid; update the
fallback to use string.IsNullOrWhiteSpace so blank names fall back to the
filename. Replace the current expression that sets title (var title = name ??
Path.GetFileName(filePath) ?? string.Empty;) with a conditional using
string.IsNullOrWhiteSpace(name) (e.g., var title =
string.IsNullOrWhiteSpace(name) ? Path.GetFileName(filePath) ?? string.Empty :
name.Trim(); ) so that null/empty/whitespace names use
Path.GetFileName(filePath) and non-empty names are trimmed and used.

@Jack251970 Jack251970 merged commit c55e91b into dev Mar 15, 2026
22 checks passed
@Jack251970 Jack251970 deleted the copilot/fix-quick-access-links-names branch March 15, 2026 17:29
@jjw24 jjw24 modified the milestones: 2.2.0, 2.1.2 May 9, 2026
jjw24 pushed a commit that referenced this pull request May 9, 2026
…links-names

Fix Quick Access Links of type File ignoring custom name in search results
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.

dev: renamed file type Quick Access Links do not display the new names

4 participants