Skip to content

KIL-688 Polish Available Tools/Skills lists with "+N more" modal#1445

Open
sfierro wants to merge 2 commits into
mainfrom
sfierro/KIL-688
Open

KIL-688 Polish Available Tools/Skills lists with "+N more" modal#1445
sfierro wants to merge 2 commits into
mainfrom
sfierro/KIL-688

Conversation

@sfierro
Copy link
Copy Markdown
Contributor

@sfierro sfierro commented Jun 3, 2026

BEFORE:
Screenshot 2026-06-02 at 9 07 33 PM

AFTER:
Screenshot 2026-06-02 at 11 46 27 PM

Screenshot 2026-06-02 at 11 46 32 PM

Linear ticket: https://linear.app/kiln_ai/issue/KIL-688/available-tools-in-property-list-needs-polish-for-many-tools

Description

The Available Tools and Available Skills lists overflowed and looked messy when a run config had many tools/skills. This caps each list at one badge plus a +N more badge that opens a width="wide" modal with the full set — the same paradigm we already use for tags in tables.

Changes

  • property_list.svelte / property_list.ts — add opt-in collapse_badges. The tools/skills rows on the run-config detail and run detail pages now collapse to the first pill + +N more, opening a wide modal titled by the property name (Available Tools / Available Skills). Modal pills use the exact same badge badge-outline hover:bg-base-200 markup as the inline pills, and stay individually clickable links.
  • badge_list.svelte — add opt-in collapse + modal_title. The Optimize run-config table Tools/Skills columns now collapse, opening a modal titled Tools / Skills to match the column headers. +N more and the dialog stop click propagation so they don't trigger the row's navigate-on-click.
  • dialog.svelte — give modal-box its own text-base-content so a dialog title no longer inherits color from its trigger context (the tools/skills modals open from inside text-gray-500 table cells, which previously washed out their titles).
  • Copy unification — the tag truncation on the specs/dataset tables now reads +N more (was +N other(s)) to match the tools/skills wording. Distinct pill styles are intentionally kept (tag = single filled pill; tools/skills = outline link-pills).

Audit

Audited the app for other long inline badge/pill lists in constrained spaces. The only actionable spot beyond the above was the Optimize table (fixed here). The kiln-task-tools list in tools/[project_id]/+page.svelte is already hidden behind an InfoTooltip, so it was left as-is.

Tests

  • property_list.test.ts (5) and badge_list.test.ts (5) covering: all-badges default, collapse to +N more, single-item no-collapse, modal opens with the full list + title, and link navigation.
  • Full web suite green (927 tests), build passes, lint/format/svelte-check clean.

Note: the local pre-commit OpenAPI schema check flagged drift, but it compares against a stale running dev server, not the branch code — this change is purely frontend and touches no API. CI regenerates the schema from source and is the source of truth.

🤖 Generated with Claude Code

Available Tools / Available Skills lists overflowed when a run config had
many tools or skills. Cap these lists at one badge plus a "+N more" badge
that opens a wide modal with the full set.

- property_list.svelte: add opt-in collapse_badges; tools/skills rows on the
  run-config and run detail pages now collapse, opening a wide modal titled by
  the property name. Modal pills match the inline pills (badge-outline + hover).
- badge_list.svelte: add opt-in collapse + modal_title; the Optimize run-config
  table tools/skills columns now collapse (modal titled "Tools"/"Skills").
- dialog.svelte: give modal-box its own text-base-content so a dialog title no
  longer inherits color from its trigger context (e.g. a gray table cell).
- Unify "+N more" copy: tag truncation on the specs/dataset tables now reads
  "+N more" to match the tools/skills wording.

Adds component tests for both collapse behaviors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 05bcf993-0648-4684-80bc-8ec6d3c3f326

📥 Commits

Reviewing files that changed from the base of the PR and between 29df57d and bba15a4.

📒 Files selected for processing (2)
  • app/web_ui/src/lib/ui/property_list.svelte
  • app/web_ui/src/lib/ui/property_list.test.ts

Walkthrough

Adds optional collapse behavior to badge lists: components show only the first badge plus a "+N more" control when enabled, opening a modal that lists all items (with links). Includes types, tests, minor dialog styling, and page-level enablement.

Changes

Badge collapse feature with modal expansion

Layer / File(s) Summary
BadgeList collapse implementation
app/web_ui/src/lib/ui/badge_list.svelte, app/web_ui/src/lib/ui/badge_list.test.ts
BadgeList adds collapse and modal_title props; computes visible_items/all_items; when collapsed shows first badge + "+N more" and opens a Dialog listing all items; tests cover rendering, collapse rules, and modal interactions.
PropertyList collapse implementation and type contract
app/web_ui/src/lib/ui/property_list.ts, app/web_ui/src/lib/ui/property_list.svelte, app/web_ui/src/lib/ui/property_list.test.ts
Adds optional UiProperty.collapse_badges; PropertyList slices inline badges when enabled, shows "+N more" to open a modal populated with modal_values/modal_links; tests validate inline behavior, modal content, and link anchors.
Dialog styling enhancement
app/web_ui/src/lib/ui/dialog.svelte
Modal box <div> class now includes text-base-content alongside the width sizing class.
Feature activation and UI consistency
app/web_ui/src/lib/utils/run_config_formatters.ts, app/web_ui/src/routes/(app)/dataset/[project_id]/[task_id]/+page.svelte, app/web_ui/src/routes/(app)/dataset/[project_id]/[task_id]/[run_id]/run/+page.svelte, app/web_ui/src/routes/(app)/optimize/[project_id]/[task_id]/+page.svelte, app/web_ui/src/routes/(app)/specs/[project_id]/[task_id]/+page.svelte
Enables collapse_badges: true for Available Tools/Skills in run configs; optimize page passes collapse and modal_title to BadgeList; dataset/specs pages unify "+N more" phrasing for extra tags.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant BadgeList
  participant Dialog
  User->>BadgeList: render with collapse=true
  BadgeList->>User: show first visible_item + "+N more" button
  User->>BadgeList: click "+N more"
  BadgeList->>Dialog: dialog.show()
  Dialog->>User: display all_items (with optional links)
  User->>Dialog: click close
  Dialog->>BadgeList: dialog closed
Loading
sequenceDiagram
  participant User
  participant PropertyList
  participant Dialog
  participant Navigation
  User->>PropertyList: render with collapse_badges=true
  PropertyList->>User: show first badge + "+N more"
  User->>PropertyList: click "+N more"
  PropertyList->>Dialog: open with modal_title and modal_values
  Dialog->>User: display badge pills for all items
  User->>Dialog: click badge pill with link
  Dialog->>Navigation: navigate to link
  Navigation->>User: arrive at target
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • Kiln-AI/Kiln#977: Modifies getRunConfigUiProperties in the same formatter file touched here.
  • Kiln-AI/Kiln#338: Earlier changes to PropertyList that this PR extends with collapse/modal behavior.
  • Kiln-AI/Kiln#804: Related run-config / PropertyList interactions that render these properties.

Suggested reviewers

  • scosman
  • leonardmq
  • chiang-daniel
  • tawnymanticore

Poem

🐰 I folded badges, neat and small,
A "+N more" to free the hall,
Click to open, view them all,
Modal hugs each tiny call,
Happy hops for tidy UI!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a '+N more' modal collapse feature for Available Tools/Skills lists with clear reference to the ticket number KIL-688.
Description check ✅ Passed The PR description includes visual before/after screenshots, detailed change explanations, testing coverage confirmation, and related issue link, but is missing explicit CLA confirmation and test checklist items.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sfierro/KIL-688

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a badge collapsing feature to the BadgeList and PropertyList components, which displays only the first badge alongside a '+N more' button that opens a modal containing the full list. This helps prevent layout overflow for long lists of tools or skills. Unit tests have been added to verify this behavior, and various pages have been updated to utilize the new collapse option. The review feedback suggests improving accessibility and semantic HTML inside the PropertyList modal by using standard <a> and <span> tags instead of <button> elements, and updating the corresponding tests to assert the href attributes directly.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +145 to +154
<button
class="badge badge-outline h-auto hover:bg-base-200"
on:click={() => {
if (link) {
goto(link)
}
}}
>
{value}
</button>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similarly to the inline badges, the badges inside the modal should also use semantic <a> tags for links and <span> tags for non-clickable items to ensure proper accessibility and standard browser navigation behaviors.

      {#if link}
        <a
          href={link}
          class="badge badge-outline h-auto hover:bg-base-200"
        >
          {value}
        </a>
      {:else}
        <span class="badge badge-outline h-auto">
          {value}
        </span>
      {/if}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Done in bba15a4 — but I also applied the same change to the inline badges (not just the modal), so links render as semantic <a href> and non-links as <span> in both places. Changing only the modal would have made it diverge from the inline pills (which were <button on:click={goto}>); now both use anchors and match badge_list.svelte.

Comment on lines +112 to +119
const pills = container.querySelectorAll(
"dialog button.badge.badge-outline",
)
expect(pills.length).toBe(2)
expect(pills[1].textContent?.trim()).toBe("beta")
// Clicking a pill navigates to its tool link.
await fireEvent.click(pills[1])
expect(goto).toHaveBeenCalledWith("/tools/b")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since we are refactoring the badges in the modal to use semantic <a> tags instead of <button> elements, we should update the test to query for a.badge.badge-outline and assert the href attribute directly. This is more robust and standard than mocking and asserting goto calls.

Suggested change
const pills = container.querySelectorAll(
"dialog button.badge.badge-outline",
)
expect(pills.length).toBe(2)
expect(pills[1].textContent?.trim()).toBe("beta")
// Clicking a pill navigates to its tool link.
await fireEvent.click(pills[1])
expect(goto).toHaveBeenCalledWith("/tools/b")
const pills = container.querySelectorAll(
"dialog a.badge.badge-outline",
)
expect(pills.length).toBe(2)
expect(pills[1].textContent?.trim()).toBe("beta")
expect(pills[1].getAttribute("href")).toBe("/tools/b")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in bba15a4 — the test now queries dialog a.badge.badge-outline and asserts href directly, and I dropped the goto mock since it's no longer needed.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

📊 Coverage Report

Overall Coverage: 92%

Diff: origin/main...HEAD

No lines with coverage information in this diff.


Address Gemini review: render badge links as <a href> and non-links as
<span> instead of <button on:click={goto}>, for both the inline list and the
"+N more" modal. Keeps inline and modal pills identical and aligns
property_list with badge_list's markup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant