From f7c1a33637c12bc0f73140622dc4bde4c72e33a2 Mon Sep 17 00:00:00 2001 From: InduwaraSMPN Date: Thu, 11 Dec 2025 11:04:04 +0530 Subject: [PATCH 1/2] refactor(web): rename .model-id-cell to .id-cell, add copy failure state, unify copy handling --- packages/web/src/index.css | 13 +++-- packages/web/src/index.ts | 34 +++++++++--- packages/web/src/render.tsx | 103 +++++++++++++++++++----------------- 3 files changed, 91 insertions(+), 59 deletions(-) diff --git a/packages/web/src/index.css b/packages/web/src/index.css index 58a4a5c4..f68e8118 100644 --- a/packages/web/src/index.css +++ b/packages/web/src/index.css @@ -330,7 +330,7 @@ tbody { color: var(--color-text-secondary); } - .model-id-cell { + .id-cell { display: flex; align-items: center; justify-content: space-between; @@ -351,11 +351,11 @@ tbody { transition: opacity 0.2s ease, color 0.2s ease; } - .model-id-cell:hover .copy-button { + .id-cell:hover .copy-button { opacity: 1; } - .model-id-cell .copy-button svg { + .id-cell .copy-button svg { display: block; } @@ -372,6 +372,11 @@ tbody { color: var(--color-brand) !important; } + /* Visual failure state when copy is not possible */ + .copy-button.failed { + color: #e11 !important; + } + .modalities { display: flex; gap: 0.25rem; @@ -546,4 +551,4 @@ dialog { } } -} \ No newline at end of file +} diff --git a/packages/web/src/index.ts b/packages/web/src/index.ts index 81afb434..6aeb8076 100644 --- a/packages/web/src/index.ts +++ b/packages/web/src/index.ts @@ -183,15 +183,14 @@ search.addEventListener("keydown", (e) => { }); /////////////////////////////////// -// Handle Copy model ID function +// Handle Copy ID function /////////////////////////////////// -(window as any).copyModelId = async ( - button: HTMLButtonElement, - modelId: string -) => { +// Generic copy function for model or provider IDs +// Copy text helper for buttons. This is now used by delegation below +async function copyText(button: HTMLButtonElement, id: string) { try { if (navigator.clipboard) { - await navigator.clipboard.writeText(modelId); + await navigator.clipboard.writeText(id); // Switch to check icon const copyIcon = button.querySelector(".copy-icon") as HTMLElement; @@ -209,7 +208,28 @@ search.addEventListener("keydown", (e) => { } catch (err) { console.error("Failed to copy text: ", err); } -}; +} + +// Attach to window for compatibility with any existing calling sites. +(window as any).copyText = copyText; + +// Event delegation: catch clicks on copy buttons and handle them safely. +document.addEventListener("click", (e) => { + const target = e.target as Element | null; + if (!target) return; + + const button = target.closest("button.copy-button") as HTMLButtonElement | null; + if (!button) return; + + const id = button.dataset.copyId; + if (!id) return; + + // Prevent accidental form submits/navigation + e.preventDefault(); + copyText(button, id); +}); + +// NOTE: If you need to support older releases, update the calling sites accordingly. /////////////////////////////////// // Initialize State from URL diff --git a/packages/web/src/render.tsx b/packages/web/src/render.tsx index a1bdfcc2..e810bcde 100644 --- a/packages/web/src/render.tsx +++ b/packages/web/src/render.tsx @@ -68,6 +68,59 @@ function renderProviderLogo(providerId: string) { return ; } +// Render a reusable table cell for IDs (provider/model). +function renderIdCell( + id: string, + label: string, + className = "id-cell" +) { + const textClass = "id-text"; + return ( + +
+ {id} + +
+ + ); +} + const getModalityIcon = (modality: string) => { switch (modality) { case "text": @@ -363,54 +416,8 @@ export const Rendered = renderToString( {model.name} {model.family ?? "-"} - {providerId} - -
- {modelId} - -
- + {renderIdCell(providerId, "Provider")} + {renderIdCell(modelId, "Model")} {model.tool_call ? "Yes" : "No"} {model.reasoning ? "Yes" : "No"} From f6fa33ecfe6de34bdae1650ca31c99a05285e5cb Mon Sep 17 00:00:00 2001 From: InduwaraSMPN Date: Wed, 17 Dec 2025 08:17:35 +0530 Subject: [PATCH 2/2] feat: add OpenRouter model configs for Nemotron 3 Nano 30B A3B and MiMo V2 Flash --- .../nvidia/nemotron-3-nano-30b-a3b.toml | 25 +++++++++++++++++++ .../models/xiaomi/mimo-v2-flash.toml | 25 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 providers/openrouter/models/nvidia/nemotron-3-nano-30b-a3b.toml create mode 100644 providers/openrouter/models/xiaomi/mimo-v2-flash.toml diff --git a/providers/openrouter/models/nvidia/nemotron-3-nano-30b-a3b.toml b/providers/openrouter/models/nvidia/nemotron-3-nano-30b-a3b.toml new file mode 100644 index 00000000..9131f8c6 --- /dev/null +++ b/providers/openrouter/models/nvidia/nemotron-3-nano-30b-a3b.toml @@ -0,0 +1,25 @@ +name = "Nemotron 3 Nano 30B A3B" +family = "nemotron-3-nano" +release_date = "2025-12-10" +last_updated = "2025-12-10" +attachment = false +reasoning = true +temperature = true +tool_call = true +knowledge = "2025-12" +open_weights = true + +[cost] +input = 0 +output = 0 + +[limit] +context = 256_000 +output = 256_000 + +[modalities] +input = ["text"] +output = ["text"] + +[provider] +npm = "@openrouter/ai-sdk-provider" diff --git a/providers/openrouter/models/xiaomi/mimo-v2-flash.toml b/providers/openrouter/models/xiaomi/mimo-v2-flash.toml new file mode 100644 index 00000000..02c83453 --- /dev/null +++ b/providers/openrouter/models/xiaomi/mimo-v2-flash.toml @@ -0,0 +1,25 @@ +name = "MiMo V2 Flash (free)" +family = "mimo-v2-flash" +release_date = "2025-12-10" +last_updated = "2025-12-10" +attachment = false +reasoning = true +temperature = true +tool_call = true +knowledge = "2025-12" +open_weights = true + +[cost] +input = 0 +output = 0 + +[limit] +context = 262_144 +output = 262_144 + +[modalities] +input = ["text"] +output = ["text"] + +[provider] +npm = "@openrouter/ai-sdk-provider"