Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/API-Reference/project/SidebarView.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,23 @@ Returns the visibility state of the sidebar.

**Kind**: global function
**Returns**: <code>boolean</code> - true if element is visible, false if it is not visible
<a name="resize"></a>

## resize(width)
Programmatically resize the sidebar to the given width. Persists
the new size so it is restored on reload, resyncs the drag handle,
and fires `panelResizeEnd`.

**Kind**: global function

| Param | Type | Description |
| --- | --- | --- |
| width | <code>number</code> | Desired sidebar width in pixels |

<a name="getWidth"></a>

## getWidth() ⇒ <code>number</code>
Get the current sidebar width in pixels. Returns the CSS width
even if the sidebar is hidden (so the value can be restored later).

**Kind**: global function
15 changes: 15 additions & 0 deletions docs/API-Reference/view/SidebarTabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ cached jQuery/DOM references held by extensions remain valid.

* [view/SidebarTabs](#module_view/SidebarTabs)
* [.SIDEBAR_TAB_FILES](#module_view/SidebarTabs..SIDEBAR_TAB_FILES) : <code>string</code>
* [.AI_TAB_GOOD_WIDTH](#module_view/SidebarTabs..AI_TAB_GOOD_WIDTH) : <code>number</code>
* [.PREF_AI_WIDTH_SET_INITIAL](#module_view/SidebarTabs..PREF_AI_WIDTH_SET_INITIAL)
* [.EVENT_TAB_ADDED](#module_view/SidebarTabs..EVENT_TAB_ADDED) : <code>string</code>
* [.EVENT_TAB_REMOVED](#module_view/SidebarTabs..EVENT_TAB_REMOVED) : <code>string</code>
* [.EVENT_TAB_CHANGED](#module_view/SidebarTabs..EVENT_TAB_CHANGED) : <code>string</code>
Expand All @@ -38,6 +40,19 @@ cached jQuery/DOM references held by extensions remain valid.
### view/SidebarTabs.SIDEBAR\_TAB\_FILES : <code>string</code>
The built-in Files tab id.

**Kind**: inner constant of [<code>view/SidebarTabs</code>](#module_view/SidebarTabs)
<a name="module_view/SidebarTabs..AI_TAB_GOOD_WIDTH"></a>

### view/SidebarTabs.AI\_TAB\_GOOD\_WIDTH : <code>number</code>
Preferred sidebar width (px) when a non-files tab (e.g. AI) is
first activated. Applied once if the current width is narrower.

**Kind**: inner constant of [<code>view/SidebarTabs</code>](#module_view/SidebarTabs)
<a name="module_view/SidebarTabs..PREF_AI_WIDTH_SET_INITIAL"></a>

### view/SidebarTabs.PREF\_AI\_WIDTH\_SET\_INITIAL
Preference key used to track whether the initial width bump has been applied.

**Kind**: inner constant of [<code>view/SidebarTabs</code>](#module_view/SidebarTabs)
<a name="module_view/SidebarTabs..EVENT_TAB_ADDED"></a>

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@
"_patchVersionBump": "gulp patchVersionBump",
"_minorVersionBump": "gulp minorVersionBump",
"_majorVersionBump": "gulp majorVersionBump",
"serve": "node serve-proxy.js . -p 8000 -c-1",
"serveLocalAccount": "node serve-proxy.js . -p 8000 -c-1 --localAccount",
"serveStagingAccount": "node serve-proxy.js . -p 8000 -c-1 --stagingAccount",
"serve": "npm install --prefix src-node && node serve-proxy.js . -p 8000 -c-1",
"serveLocalAccount": "npm install --prefix src-node && node serve-proxy.js . -p 8000 -c-1 --localAccount",
"serveStagingAccount": "npm install --prefix src-node && node serve-proxy.js . -p 8000 -c-1 --stagingAccount",
"_serveWithWebCacheHelp": "echo !!!Make sure to npm run release:dev/stageing/prod before testing the cache!!!",
"serveWithWebCache": "npm run _releaseWebCache && npm run _serveWithWebCacheHelp && http-server ./dist -p 8000 -c-1",
"serveExternal": "node serve-proxy.js . -p 8000 -a 0.0.0.0 --log-ip -c-1",
"serveExternal": "npm install --prefix src-node && node serve-proxy.js . -p 8000 -a 0.0.0.0 --log-ip -c-1",
"createJSDocs": "node build/api-docs-generator.js && git add docs",
"_translateStrings": "gulp translateStrings",
"_minify": "r.js -o require.min.config.js && echo this is untested see https://stackoverflow.com/questions/14337970/minifying-requirejs-javascript-codebase-to-a-single-file"
Expand Down
25 changes: 25 additions & 0 deletions serve-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,31 @@ const server = http.createServer((req, res) => {
return;
}

// Handle getPhoenixPath API for Tauri dev mode
if (parsedUrl.pathname === '/api/getPhoenixPath') {
const response = {
phoenixPath: config.root
};

if (!config.silent) {
console.log(`[API] ${req.method} ${parsedUrl.pathname} -> ${JSON.stringify(response)}`);
}

const headers = {
'Content-Type': 'application/json'
};

if (config.cors) {
headers['Access-Control-Allow-Origin'] = '*';
headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, DELETE, OPTIONS';
headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization, Cache-Control';
}

res.writeHead(200, headers);
res.end(JSON.stringify(response));
return;
}

// Handle proxy config request
if (parsedUrl.pathname === '/proxy/config') {
const configResponse = {
Expand Down
28 changes: 22 additions & 6 deletions src/node-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,18 +635,34 @@ function nodeLoader() {
nodeErrorLogCount = 0;
}, NODE_ERROR_LOGS_RESET_INTERVAL);

async function _tauriNodeSetup() {
let nodeSrcPath = await window.__TAURI__.path.resolveResource("src-node/index.js");
async function _resolveSrcNodePath() {
// Check if running from localhost dev server
if (window.location.href.startsWith('http://localhost:')) {
// Fetch phoenix path from dev server API to use local src-node
const response = await fetch('/api/getPhoenixPath');
const pathInfo = await response.json();
const srcNodePath = `${pathInfo.phoenixPath}/src-node/index.js`;
console.log('PhNode: Using dev server src-node path:', srcNodePath);
return srcNodePath;
}

// Production Tauri path resolution
let srcNodePath = await window.__TAURI__.path.resolveResource("src-node/index.js");
// Strip Windows UNC prefix (\\?\) that Tauri adds on Windows
// Node 24 doesn't handle UNC paths correctly in module resolution
if (Phoenix.platform === "win" && nodeSrcPath.startsWith('\\\\?\\')) {
nodeSrcPath = nodeSrcPath.slice(4);
if (Phoenix.platform === "win" && srcNodePath.startsWith('\\\\?\\')) {
srcNodePath = srcNodePath.slice(4);
}
if(Phoenix.platform === "linux") {
if (Phoenix.platform === "linux") {
// in linux installed distributions, src-node is present in the same dir as the executable.
const cliArgs = await window.__TAURI__.invoke('_get_commandline_args');
nodeSrcPath = `${window.path.dirname(cliArgs[0])}/src-node/index.js`;
srcNodePath = `${window.path.dirname(cliArgs[0])}/src-node/index.js`;
}
return srcNodePath;
}

async function _tauriNodeSetup() {
const nodeSrcPath = await _resolveSrcNodePath();
// node is designed such that it is not required at boot time to lower startup time.
// Keep this so to increase boot speed.
const inspectPort = Phoenix.isTestWindow ? getRandomNumber(5000, 50000) : 9229;
Expand Down
Loading