Skip to content

Commit 21c099a

Browse files
abidlabsclaudegradio-pr-bot
authored
Fix: Open browser with write_token so trackio show allows mutations (#509)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
1 parent 8e26ab9 commit 21c099a

4 files changed

Lines changed: 25 additions & 4 deletions

File tree

.changeset/wet-garlics-joke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trackio": minor
3+
---
4+
5+
feat:Fix: Open browser with write_token so trackio show allows mutations

trackio/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -922,12 +922,13 @@ def show(
922922
)
923923

924924
if not utils.is_in_notebook():
925-
print(f"* Trackio UI launched at: {dashboard_url}")
925+
print(f"\033[1m\033[38;5;208m* Trackio UI launched at: {dashboard_url}\033[0m")
926+
utils.print_write_token_instructions(full_url)
926927
if open_browser:
927-
webbrowser.open(dashboard_url)
928+
webbrowser.open(full_url)
928929
block_thread = block_thread if block_thread is not None else True
929930
else:
930-
utils.embed_url_in_notebook(dashboard_url)
931+
utils.embed_url_in_notebook(full_url)
931932
block_thread = block_thread if block_thread is not None else False
932933

933934
if block_thread:

trackio/frontend/src/pages/Runs.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script>
2+
import { tick } from "svelte";
23
import LoadingTrackio from "../components/LoadingTrackio.svelte";
34
import { getProjectSummary, getRunSummary, deleteRun, renameRun } from "../lib/api.js";
45
import { navigateTo, setQueryParam } from "../lib/router.js";
@@ -19,6 +20,7 @@
1920
let loading = $state(false);
2021
let renamingIndex = $state(-1);
2122
let renameValue = $state("");
23+
let renameInput = $state(null);
2224
2325
async function loadRuns() {
2426
if (!project) {
@@ -65,10 +67,13 @@
6567
}
6668
}
6769
68-
function startRename(index, currentName) {
70+
async function startRename(index, currentName) {
6971
if (!canMutateRuns) return;
7072
renamingIndex = index;
7173
renameValue = currentName;
74+
await tick();
75+
renameInput?.focus();
76+
renameInput?.select();
7277
}
7378
7479
async function submitRename(run) {
@@ -149,6 +154,7 @@
149154
class="rename-input"
150155
type="text"
151156
bind:value={renameValue}
157+
bind:this={renameInput}
152158
onkeydown={(e) => handleRenameKeydown(e, run)}
153159
onblur={() => submitRename(run)}
154160
/>

trackio/utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,15 @@ def print_dashboard_instructions(project: str) -> None:
429429
print(f'* or by running in Python: trackio.show(project="{project}")')
430430

431431

432+
def print_write_token_instructions(full_url: str) -> None:
433+
print()
434+
print(f"* Trackio dashboard opened in browser with write access at: {full_url}")
435+
print(
436+
"* Warning: anyone with access to your dashboard with the write_token can "
437+
"write logs, rename/delete runs, and connect MCP tools"
438+
)
439+
440+
432441
def preprocess_space_and_dataset_ids(
433442
space_id: str | None,
434443
dataset_id: str | None,

0 commit comments

Comments
 (0)