Skip to content

Comments

Fix upper search bar navigation from any page and Scramjet URL decoding#36

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-upper-search-bar-functionality
Draft

Fix upper search bar navigation from any page and Scramjet URL decoding#36
Copilot wants to merge 3 commits intomainfrom
copilot/fix-upper-search-bar-functionality

Conversation

Copy link
Contributor

Copilot AI commented Nov 20, 2025

The upper search bar was non-functional on settings pages, and Scramjet-proxied URLs displayed in encoded form instead of showing the actual URL.

Changes

Enable search from any page

  • Add fallback navigation when iframe doesn't exist: redirect to /?redir=<query> to leverage existing redirect handling
  • Allows search bar to function from settings and other non-main pages

Fix Scramjet URL decoding

  • Replace manual string manipulation with $scramjet.url.href for proper URL retrieval
  • Add fallback decoding from iframe.src using ScramjetController.decodeUrl() when proxy objects aren't initialized
  • Apply fix to both UpperSearchBar.astro and index.astro for consistency

Before:

// Incorrect - manual string replacement loses encoding
pageURL = scramjetURL
    .replace(iframeWin.location.origin, '')
    .replace(iframeWin.$scramjet.config.prefix, '');

After:

// Correct - use Scramjet's decoded URL property
pageURL = iframeWin.$scramjet.url.href;

// With fallback for uninitialized proxy
const tempController = new ScramjetController({ prefix: '/~/scramjet/' });
const decoded = tempController.decodeUrl(encoded);

Screenshot

URL bar now correctly displays decoded URL:

Search bar with decoded URL

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: node /home/REDACTED/work/Radius/Radius/node_modules/.bin/astro dev (dns block)
  • google.com
    • Triggering command: node /home/REDACTED/work/Radius/Radius/node_modules/.bin/astro dev (dns block)
  • telemetry.astro.build
    • Triggering command: node /home/REDACTED/work/Radius/Radius/node_modules/.bin/astro build (dns block)
    • Triggering command: node /home/REDACTED/work/Radius/Radius/node_modules/.bin/astro dev (dns block)
  • www.google.com
    • Triggering command: node /home/REDACTED/work/Radius/Radius/node_modules/.bin/astro dev (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

fix make it so you can use the upper search bar on any page (even inside of the settings page) and it will work as normal and take you into the search system, fix the scramjet url, so when using scramjet, the url is used, not the proxied one.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@codesandbox
Copy link

codesandbox bot commented Nov 20, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copilot AI and others added 2 commits November 20, 2025 11:10
- Enable upper search bar to work from any page including settings
- Fix scramjet URL decoding to use proper $scramjet.url.href
- Update both UpperSearchBar and index page for consistent behavior

Co-authored-by: sriail <225764385+sriail@users.noreply.github.com>
- Fix URL display to properly decode from iframe src when proxy objects unavailable
- Ensure consistent URL decoding for both UV and Scramjet proxies
- Tested with both proxies successfully

Co-authored-by: sriail <225764385+sriail@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix upper search bar functionality across all pages Fix upper search bar navigation from any page and Scramjet URL decoding Nov 20, 2025
Copilot AI requested a review from sriail November 20, 2025 11:17
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