Amber Tanaka commited on
Commit
28bc4e5
·
unverified ·
1 Parent(s): 4d6710e

Make tooltips more dynamic (#70)

Browse files
Files changed (2) hide show
  1. content.py +28 -1
  2. ui_components.py +17 -17
content.py CHANGED
@@ -616,7 +616,34 @@ span.wrap[tabindex="0"][role="button"][data-editable="false"] {
616
  line-height: 1.3;
617
  display: flex;
618
  flex-direction: column;
619
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
620
  /* About Page CSS */
621
  #about-page-content-wrapper {
622
  margin-left: auto;
 
616
  line-height: 1.3;
617
  display: flex;
618
  flex-direction: column;
619
+ }
620
+ @media (max-width: 800px) {
621
+ .tooltip-card {
622
+ transform: none;
623
+ left: 10px;
624
+ max-width: calc(100vw - 100px);
625
+ }
626
+ .tooltip-icon-legend:hover::before {
627
+ left: 50%;
628
+ transform: translateX(-50%);
629
+ }
630
+ }
631
+ .tooltip-pin-left .tooltip-card {
632
+ left: 0;
633
+ transform: none;
634
+ }
635
+ .tooltip-pin-right .tooltip-card {
636
+ right: 0;
637
+ left: auto;
638
+ transform: none;
639
+ }
640
+ .table-legend-item {
641
+ display: flex;
642
+ align-items: center;
643
+ white-space: nowrap;
644
+ margin-top: 8px;
645
+ flex-wrap: wrap;
646
+ }
647
  /* About Page CSS */
648
  #about-page-content-wrapper {
649
  margin-left: auto;
ui_components.py CHANGED
@@ -167,10 +167,10 @@ def build_openness_tooltip_content() -> str:
167
  Generates the inner HTML for the Agent Openness tooltip card,
168
  """
169
  descriptions = {
170
- "Open Source + Open Weights": "Both code and ML models are open",
171
- "Open Source + Closed Weights": "Code is open but uses an ML model with closed-weights",
172
- "API Available": "No access to code; API access only",
173
- "Closed Source + UI Only": "No access to code or API; UI access only",
174
  }
175
  html_items = []
176
  for name, info in OPENNESS_SVG_MAP.items():
@@ -211,8 +211,8 @@ def build_tooling_tooltip_content() -> str:
211
  """Generates the inner HTML for the Agent Tooling tooltip card."""
212
  descriptions = {
213
  "Standard": "Uses only predefined tools from the evaluation environment (as defined in Inspect's state.tools).",
214
- "Custom Interface": "Custom tools for accessing an equivalent underlying environment:",
215
- "Fully Custom": "Uses tools beyond constraints of Standard or Custom interface",
216
  }
217
  custom_interface_sub_list = """
218
  <ul class="tooltip-sub-list">
@@ -250,7 +250,7 @@ def build_descriptions_tooltip_content(table) -> str:
250
  <div class="tooltip-description-item"><b>Submitter:</b> Organization or individual who submitted the agent for evaluation.</div>
251
  <div class="tooltip-description-item"><b>LLM Base:</b> Model(s) used by the agent. Hover over ⓘ to view all.</div>
252
  <div class="tooltip-description-item"><b>Overall Score:</b> Macro-average of the four category-level average scores. Each category contributes equally.</div>
253
- <div class="tooltip-description-item"><b>Overall Cost:</b> Macro-average cost per problem across all categories, in USD. Based on submission-time values. Each category contributes equally</div>
254
  <div class="tooltip-description-item"><b>Literature Understanding Score:</b> Macro-average score across Literature Understanding benchmarks.</div>
255
  <div class="tooltip-description-item"><b>Literature Understanding Cost:</b> Macro-average cost per problem (USD) across Literature Understanding benchmarks.</div>
256
  <div class="tooltip-description-item"><b>Code Execution Score:</b> Macro-average score across Code & Execution benchmarks.</div>
@@ -289,7 +289,7 @@ def build_descriptions_tooltip_content(table) -> str:
289
  # Dynamically generate the correct HTML for the legend parts
290
  openness_html = " ".join([create_svg_html(name, OPENNESS_SVG_MAP) for name in OPENNESS_SVG_MAP])
291
  tooling_html = " ".join([create_svg_html(name, TOOLING_SVG_MAP) for name in TOOLING_SVG_MAP])
292
- # Create HTML for the "Openness" legend items
293
  openness_html_items = []
294
  for name, info in OPENNESS_SVG_MAP.items():
295
  uri = get_svg_as_data_uri(info["path"])
@@ -302,7 +302,7 @@ for name, info in OPENNESS_SVG_MAP.items():
302
  )
303
  openness_html = " ".join(openness_html_items)
304
 
305
- # Create HTML for the "Tooling" legend items
306
  tooling_html_items = []
307
  for name, info in TOOLING_SVG_MAP.items():
308
  uri = get_svg_as_data_uri(info["path"])
@@ -330,14 +330,14 @@ def create_legend_markdown(which_table: str) -> str:
330
 
331
  <div> <!-- Container for the Pareto section -->
332
  <b>Pareto</b>
333
- <span class="tooltip-icon-legend">
334
 
335
  <span class="tooltip-card">{pareto_tooltip_content}</span>
336
  </span>
337
- <div style="margin-top: 8px; display: flex; align-items: center; gap: 6px;">
338
- <img src="{trophy_uri}" alt="On Frontier" style="width: 25px; height: 25px;">
339
- <span>On Frontier</span>
340
- </div>
341
  </div>
342
 
343
  <div> <!-- Container for the Openness section -->
@@ -350,7 +350,7 @@ def create_legend_markdown(which_table: str) -> str:
350
  <div class="tooltip-items-container">{openness_tooltip_content}</div>
351
  </span>
352
  </span>
353
- <div style="display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px;">{openness_html}</div>
354
  </div>
355
 
356
  <div> <!-- Container for the Tooling section -->
@@ -363,12 +363,12 @@ def create_legend_markdown(which_table: str) -> str:
363
  <div class="tooltip-items-container">{tooling_tooltip_content}</div>
364
  </span>
365
  </span>
366
- <div style="display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px;">{tooling_html}</div>
367
  </div>
368
 
369
  <div><!-- Container for the Column Descriptions section -->
370
  <b>Column Descriptions</b>
371
- <span class="tooltip-icon-legend">
372
 
373
  <span class="tooltip-card">
374
  <h3>Column Descriptions</h3>
 
167
  Generates the inner HTML for the Agent Openness tooltip card,
168
  """
169
  descriptions = {
170
+ "Open source & open weights": "Both code and ML models are open",
171
+ "Open source & closed weights": "Code is open but uses an ML model with closed-weights",
172
+ "Closed source & API available": "No access to code; API access only",
173
+ "Closed source & UI only": "No access to code or API; UI access only",
174
  }
175
  html_items = []
176
  for name, info in OPENNESS_SVG_MAP.items():
 
211
  """Generates the inner HTML for the Agent Tooling tooltip card."""
212
  descriptions = {
213
  "Standard": "Uses only predefined tools from the evaluation environment (as defined in Inspect's state.tools).",
214
+ "Custom interface": "Custom tools for accessing an equivalent underlying environment:",
215
+ "Fully custom": "Uses tools beyond constraints of Standard or Custom interface",
216
  }
217
  custom_interface_sub_list = """
218
  <ul class="tooltip-sub-list">
 
250
  <div class="tooltip-description-item"><b>Submitter:</b> Organization or individual who submitted the agent for evaluation.</div>
251
  <div class="tooltip-description-item"><b>LLM Base:</b> Model(s) used by the agent. Hover over ⓘ to view all.</div>
252
  <div class="tooltip-description-item"><b>Overall Score:</b> Macro-average of the four category-level average scores. Each category contributes equally.</div>
253
+ <div class="tooltip-description-item"><b>Overall Cost:</b> Macro-average cost per problem across all categories, in USD. Each category contributes equally.</div>
254
  <div class="tooltip-description-item"><b>Literature Understanding Score:</b> Macro-average score across Literature Understanding benchmarks.</div>
255
  <div class="tooltip-description-item"><b>Literature Understanding Cost:</b> Macro-average cost per problem (USD) across Literature Understanding benchmarks.</div>
256
  <div class="tooltip-description-item"><b>Code Execution Score:</b> Macro-average score across Code & Execution benchmarks.</div>
 
289
  # Dynamically generate the correct HTML for the legend parts
290
  openness_html = " ".join([create_svg_html(name, OPENNESS_SVG_MAP) for name in OPENNESS_SVG_MAP])
291
  tooling_html = " ".join([create_svg_html(name, TOOLING_SVG_MAP) for name in TOOLING_SVG_MAP])
292
+ # Create HTML for the "Openness" legend items for table
293
  openness_html_items = []
294
  for name, info in OPENNESS_SVG_MAP.items():
295
  uri = get_svg_as_data_uri(info["path"])
 
302
  )
303
  openness_html = " ".join(openness_html_items)
304
 
305
+ # Create HTML for the "Tooling" legend items for table
306
  tooling_html_items = []
307
  for name, info in TOOLING_SVG_MAP.items():
308
  uri = get_svg_as_data_uri(info["path"])
 
330
 
331
  <div> <!-- Container for the Pareto section -->
332
  <b>Pareto</b>
333
+ <span class="tooltip-icon-legend tooltip-pin-left">
334
 
335
  <span class="tooltip-card">{pareto_tooltip_content}</span>
336
  </span>
337
+ <div class="table-legend-item">
338
+ <img src="{trophy_uri}" alt="On Frontier" style="width:20px; height:20px; margin-right: 4px; flex-shrink: 0;">
339
+ <span>On frontier</span>
340
+ </div>
341
  </div>
342
 
343
  <div> <!-- Container for the Openness section -->
 
350
  <div class="tooltip-items-container">{openness_tooltip_content}</div>
351
  </span>
352
  </span>
353
+ <div class="table-legend-item">{openness_html}</div>
354
  </div>
355
 
356
  <div> <!-- Container for the Tooling section -->
 
363
  <div class="tooltip-items-container">{tooling_tooltip_content}</div>
364
  </span>
365
  </span>
366
+ <div class="table-legend-item">{tooling_html}</div>
367
  </div>
368
 
369
  <div><!-- Container for the Column Descriptions section -->
370
  <b>Column Descriptions</b>
371
+ <span class="tooltip-icon-legend tooltip-pin-right">
372
 
373
  <span class="tooltip-card">
374
  <h3>Column Descriptions</h3>