prompt_navigator 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/prompt_navigator/history.css +20 -0
- data/app/models/prompt_navigator/prompt_execution.rb +11 -0
- data/app/views/prompt_navigator/_history_card.html.erb +1 -1
- data/lib/generators/prompt_navigator/modeling/modeling_generator.rb +1 -0
- data/lib/generators/prompt_navigator/modeling/templates/db/migrate/20261007000000_add_model_label_to_prompt_navigator_prompt_executions.rb +14 -0
- data/lib/prompt_navigator/configuration.rb +13 -0
- data/lib/prompt_navigator/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d596c5be7dbf5ef6bec487f6078e337a718bbdfaf7124fdb93b2d23f275cfbd9
|
|
4
|
+
data.tar.gz: 1c2879a0ab667b2536f98e1d0173ad2fc08ba96108475bc6b001a90b9d73de1d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0d99e1a69902fca5890e27e483aa7b058a1f8a5235a649885576acbd7f2387d7c679c9440b3527f00f4d2e0ec5a1142bc7a28fd5e0c1be5ab77a2f247ad8b1e4
|
|
7
|
+
data.tar.gz: 9926f7f7d70f38209bab66dd762566ef1d3f2ed185e65962653866df1570174bff60791608a629367fe66ed7b4ae661f6e30d445dbe74a490761526035c9df1a
|
|
@@ -113,6 +113,26 @@
|
|
|
113
113
|
font-weight: 700;
|
|
114
114
|
letter-spacing: 0.02em;
|
|
115
115
|
flex-shrink: 0;
|
|
116
|
+
|
|
117
|
+
/* This label is whatever the host registered in `model_labels`, which is
|
|
118
|
+
usually the catalog's display name rather than a short platform word —
|
|
119
|
+
that is the point, so an Ollama-hosted Qwen reads "Qwen3.6 35B" and not
|
|
120
|
+
"Ollama". Catalog names get long: "Gemini 3.1 Flash Image (Nano Banana 2)"
|
|
121
|
+
is 38 characters. With no cap the chip claimed the whole row and the
|
|
122
|
+
prompt preview beside it collapsed to nothing, because the link is the
|
|
123
|
+
flex item that yields (`flex: 1; min-width: 0`) while this one does not
|
|
124
|
+
shrink. Cap it and ellipsise; the full name is already on the element's
|
|
125
|
+
`title`, so nothing is lost. */
|
|
126
|
+
max-width: 45%;
|
|
127
|
+
/* Border-box so the cap counts the padding. Without it `max-width` bounds
|
|
128
|
+
only the content box and the 12px of horizontal padding is added on top,
|
|
129
|
+
so a 45% cap renders at nearly 49% — enough to push the prompt under half
|
|
130
|
+
the row, which is the thing being prevented. */
|
|
131
|
+
box-sizing: border-box;
|
|
132
|
+
overflow: hidden;
|
|
133
|
+
text-overflow: ellipsis;
|
|
134
|
+
white-space: nowrap;
|
|
135
|
+
|
|
116
136
|
padding: 2px 6px;
|
|
117
137
|
border-radius: 4px;
|
|
118
138
|
min-width: 28px;
|
|
@@ -19,6 +19,17 @@ module PromptNavigator
|
|
|
19
19
|
|
|
20
20
|
before_create :set_execution_id
|
|
21
21
|
|
|
22
|
+
# What the sidebar shows for this turn.
|
|
23
|
+
#
|
|
24
|
+
# `model_label` is captured when the turn is written, so it keeps saying
|
|
25
|
+
# "Gemini 2.5 Flash Image (Nano Banana)" after that model leaves the host's
|
|
26
|
+
# catalog. Rows written before the column existed fall back to resolving
|
|
27
|
+
# against the live config, which is the old behaviour — the platform name
|
|
28
|
+
# once the model is gone.
|
|
29
|
+
def display_label
|
|
30
|
+
model_label.presence || PromptNavigator.label_for(platform: llm_platform, model: model)
|
|
31
|
+
end
|
|
32
|
+
|
|
22
33
|
# Builds a context array from the direct lineage for summarization.
|
|
23
34
|
# Each entry contains { prompt:, response: } from ancestor PromptExecutions.
|
|
24
35
|
# Optionally limit to the most recent N ancestors.
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<% end %>
|
|
44
44
|
<% end %>
|
|
45
45
|
<% if ann.llm_platform.present? %>
|
|
46
|
-
<% platform_label =
|
|
46
|
+
<% platform_label = ann.display_label %>
|
|
47
47
|
<% tooltip = ann.model.present? ? "#{ann.model} (#{ann.llm_platform})" : ann.llm_platform.to_s %>
|
|
48
48
|
<span class="history-card-platform-label" data-platform="<%= ann.llm_platform %>" title="<%= tooltip %>"><%= platform_label %></span>
|
|
49
49
|
<% end %>
|
|
@@ -18,6 +18,7 @@ module PromptNavigator
|
|
|
18
18
|
def add_migrations
|
|
19
19
|
migration_template "db/migrate/20260129073026_create_prompt_navigator_prompt_executions.rb", "db/migrate/create_prompt_navigator_prompt_executions.rb"
|
|
20
20
|
migration_template "db/migrate/20260913000000_add_prompt_navigator_supplements.rb", "db/migrate/add_prompt_navigator_supplements.rb"
|
|
21
|
+
migration_template "db/migrate/20261007000000_add_model_label_to_prompt_navigator_prompt_executions.rb", "db/migrate/add_model_label_to_prompt_navigator_prompt_executions.rb"
|
|
21
22
|
end
|
|
22
23
|
end
|
|
23
24
|
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# The catalog's display name for the model that answered, captured when the turn
|
|
2
|
+
# is written.
|
|
3
|
+
#
|
|
4
|
+
# Without it the sidebar resolves a label from the host's LIVE model catalog, so
|
|
5
|
+
# a turn's label depends on whether that model is still offered today. Retiring a
|
|
6
|
+
# model silently downgraded every past turn that used it to the platform name:
|
|
7
|
+
# on one production history, 350 of 520 turns had already decayed that way,
|
|
8
|
+
# including Ollama-hosted ones showing "Ollama" — the exact case the per-model
|
|
9
|
+
# label exists to fix. A history row has to carry what it needs.
|
|
10
|
+
class AddModelLabelToPromptNavigatorPromptExecutions < ActiveRecord::Migration[8.1]
|
|
11
|
+
def change
|
|
12
|
+
add_column :prompt_navigator_prompt_executions, :model_label, :string
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -33,6 +33,19 @@ module PromptNavigator
|
|
|
33
33
|
yield config
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
# The registered label for this model, or nil when none is known.
|
|
37
|
+
#
|
|
38
|
+
# Deliberately NOT falling back to the platform name: a caller that wants to
|
|
39
|
+
# PERSIST a label needs to tell "the catalog calls this Qwen3.6 35B" from
|
|
40
|
+
# "nothing is registered, so you are seeing the platform". Writing the fallback
|
|
41
|
+
# into a history row would freeze a worse label than the host may know later.
|
|
42
|
+
def self.model_label_for(model)
|
|
43
|
+
key = model.to_s
|
|
44
|
+
return nil if key.empty?
|
|
45
|
+
|
|
46
|
+
config.model_labels[key]
|
|
47
|
+
end
|
|
48
|
+
|
|
36
49
|
# Resolution order: per-model override → per-platform → raw platform string.
|
|
37
50
|
# Returns "" only when both inputs are blank.
|
|
38
51
|
def self.label_for(platform:, model: nil)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: prompt_navigator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- dhq_boiler
|
|
@@ -61,6 +61,7 @@ files:
|
|
|
61
61
|
- lib/generators/prompt_navigator/modeling/modeling_generator.rb
|
|
62
62
|
- lib/generators/prompt_navigator/modeling/templates/db/migrate/20260129073026_create_prompt_navigator_prompt_executions.rb
|
|
63
63
|
- lib/generators/prompt_navigator/modeling/templates/db/migrate/20260913000000_add_prompt_navigator_supplements.rb
|
|
64
|
+
- lib/generators/prompt_navigator/modeling/templates/db/migrate/20261007000000_add_model_label_to_prompt_navigator_prompt_executions.rb
|
|
64
65
|
- lib/prompt_navigator.rb
|
|
65
66
|
- lib/prompt_navigator/configuration.rb
|
|
66
67
|
- lib/prompt_navigator/engine.rb
|