feat(site/src/pages/AgentsPage): group context indicator resources by directory#26598
Merged
Conversation
… directory Group the Skills and Context files lists in the context usage popover by their parent directory so resources pulled from different roots (for example a repo-root AGENTS.md and a nested one, or same-named skills from different skill roots) stay distinguishable instead of collapsing to identical basenames. Each group renders a dimmed directory header with a folder icon. Add a getPathDirname helper (with tests) and a MultipleContextRoots story covering files and skills spanning several directories.
sreya
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Groups the Skills and Context files lists in the context-usage popover (
ContextUsageIndicator) by their parent directory. Resources pulled from different roots, for example a repo-rootAGENTS.mdand a nestedsite/AGENTS.md, or same-named skills from.coder/skillsvs.agents/skills, previously collapsed to identical basenames and lost their provenance. Each group now renders a dimmed directory header with a folder icon, and its items are indented beneath it.Why
ChatContextResource.sourcecarries the real path for instruction files and skill directories, but the popover only rendered the basename, so multiple context roots were indistinguishable.Notes
mcp_server'ssourceis a server name (not a path) and the row carries no reference to themcp_configthat declared it, so it does not fit the directory model without a backend change.getPathDirnamehelper (with tests) and switches the skill listkeyfromskill.nametoskill.sourceto avoid collisions across roots.Test plan
ContextUsageIndicator.stories.tsx: newMultipleContextRootsstory (files + skills across several directories);Cleanstory updated to assert the single-root header. Storybook play tests pass (4/4).path.test.ts: addedgetPathDirnamecases (unit pass).biome check,tsc -p ., andmake pre-commitall pass.Design decision log
titletooltip). Open follow-ups: collapse$HOMEto~or show fewer path segments if the labels feel long.mcp_serveris keyed by name and has no link to itsmcp_config(confirmed incodersdk.ChatContextResourceand thepinnedContextResourcesbuilder), so grouping servers under a config would require a backend data change. Left flat for this PR.🤖 This PR was created by Coder Agents on behalf of @kylecarbs.