TinyTapeout / xschem-viewer

Online viewer of Xschem schematic files
https://xschem-viewer.com/
Apache License 2.0
20 stars 1 forks source link

Descending into subcircuit replaces full url with just the file name #4

Closed htfab closed 5 months ago

htfab commented 5 months ago

Example to reproduce:

  1. open https://www.xschem-viewer.com/?file=https://github.com/RTimothyEdwards/sky130_ef_ip__xtal_osc_16M/blob/main/xschem/sky130_ef_ip__xtal_osc_16M.sch
  2. click on the "level_shifter" subcircuit label
  3. url is rewritten to https://www.xschem-viewer.com/?file=level_shifter.sch

Relevant code: https://github.com/TinyTapeout/xschem-viewer/blob/main/src/index.ts#L90-L92

Suggested fix (untested): currentPath = new URLSearchParams(window.location.search).get('file') ?? defaultFile; newPath = (new URL(path, currentPath)).href;

urish commented 5 months ago

Fixed, thanks for the detailed bug report!