Skip to content

feat: Introduce built-in portals extension for scoped searching and command execution. - #53

Merged
Xoshbin merged 1 commit into
mainfrom
feat/portals
Mar 21, 2026
Merged

Xoshbin merged 1 commit into
mainfrom
feat/portals

Conversation

@Xoshbin

@Xoshbin Xoshbin commented Mar 21, 2026

Copy link
Copy Markdown
Owner

No description provided.

@Xoshbin
Xoshbin merged commit d31df79 into main Mar 21, 2026
@Xoshbin
Xoshbin deleted the feat/portals branch March 21, 2026 17:28
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a powerful new 'Portals' extension, designed to significantly enhance user productivity by allowing the creation of custom, searchable URL shortcuts. Users can now define 'portals' for frequently used search engines or websites, and then execute scoped searches directly from the main command bar. This feature streamlines workflows by reducing the need to navigate to external sites manually, making common web interactions faster and more integrated within the application.

Highlights

  • New Portals Extension: Introduced a new built-in 'Portals' extension that allows users to create and manage custom URL shortcuts for scoped searching and command execution.
  • Dynamic Search Integration: Integrated portals directly into the main search bar, enabling users to activate a portal by typing its name, then perform a query within that portal's context. This includes visual hints for partial portal matches and a dedicated input mode for active portals.
  • Portal Management UI: Provided a dedicated Svelte view (DefaultView.svelte) for listing, adding, editing, and deleting portals, complete with form validation and persistent storage.
  • Keyboard Navigation: Implemented keyboard navigation (ArrowUp/Down, Tab, Backspace) for interacting with portal hints, activating portals, and navigating within the portal management view.
  • Command Execution with Query: Enhanced the command execution mechanism to pass a 'query' argument to portal commands, allowing dynamic URL construction based on user input.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a well-implemented built-in 'portals' extension for creating scoped search shortcuts. The changes are comprehensive, covering data storage with localStorage, a Svelte-based UI for management, and seamless integration into the main search workflow. The code is generally clean and follows good patterns. My review includes a few suggestions to improve maintainability by removing some redundant logic, enhance the user experience by refining the behavior when dismissing a portal, and replacing a blocking dialog with a more modern approach.

const portal = e.detail;
if (editingId) {
portalStore.update(editingId, portal);
await removePortalFromIndex(editingId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The call to removePortalFromIndex is redundant when updating a portal. The syncPortalToIndex function effectively performs an 'upsert' operation, as both searchService.indexItem and commandService.registerCommand will overwrite existing entries with the same ID. Removing this line simplifies the code and avoids an unnecessary delete operation from the search index.

}

async function handleDelete(portal: Portal) {
if (!confirm('Are you sure you want to delete this portal?')) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using the native confirm() dialog is generally discouraged as it's a blocking operation that freezes the UI and cannot be styled. For a better and more consistent user experience, consider replacing this with a non-blocking, custom-styled confirmation modal.

Comment on lines +67 to +76
// Dynamic portal fallback (should be handled by commandService now, but kept as safety net)
const portal = portalStore.getById(commandId);
if (portal) {
const query = args?.query ?? '';
const url = portal.url.includes('{query}')
? portal.url.replace(/\{query\}/g, encodeURIComponent(query))
: portal.url;
await invoke('plugin:opener|open_url', { url });
return { type: 'no-view' };
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This 'Dynamic portal fallback' block appears to be unreachable dead code. The commandId passed to executeCommand will be in the format cmd_portals_<uuid>, while portalStore.getById() expects just the UUID. Therefore, portalStore.getById(commandId) will never find a portal. As the comment suggests this logic is now handled by commandService, this block can be safely removed to improve code clarity and maintainability.

Comment thread src/routes/+page.svelte
const trigger = activePortal?.name ?? '';
activePortal = null;
portalQuery = '';
const newValue = clearAll ? '' : trigger.slice(0, -1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

When dismissing portal mode via the Backspace key, setting the new input value to trigger.slice(0, -1) results in a confusing user experience. For example, a portal named 'Search Google' would leave 'Search Googl' in the input. A more intuitive behavior would be to restore the full trigger name, allowing the user to easily edit it. I suggest changing this to just trigger.

    const newValue = clearAll ? '' : trigger;

Xoshbin added a commit that referenced this pull request May 24, 2026
feat: Introduce built-in portals extension for scoped searching and command execution.
Xoshbin added a commit that referenced this pull request May 24, 2026
fix: use strict type exports for IApplicationService to fix Vite binding errors
Xoshbin added a commit that referenced this pull request May 24, 2026
fix: use strict type exports for IApplicationService to fix Vite binding errors
Xoshbin added a commit that referenced this pull request Nov 7, 2026
…53)

Append a stable FNV-1a hash of the full cache key when truncating to
prevent cache collisions between distinct applications that share a prefix
longer than the filename limit. Keep keys under 200 bytes untouched and
preserve UTF-8 char boundary safety.
Xoshbin added a commit that referenced this pull request Nov 7, 2026
…) (#1003)

* fix(application): safe char boundary truncation for app icon cache (#53)

Avoid raw byte slicing into multi-byte UTF-8 character sequences when
truncating icon cache keys to 200 bytes in `extract_app_icon` and
`extract_uwp_app_icon`. Use `floor_char_boundary` to prevent panics when
multi-byte characters straddle the byte limit.

* fix(application): disambiguate long icon cache keys with FNV-1a hash (#53)

Append a stable FNV-1a hash of the full cache key when truncating to
prevent cache collisions between distinct applications that share a prefix
longer than the filename limit. Keep keys under 200 bytes untouched and
preserve UTF-8 char boundary safety.
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.

1 participant