Skip to content

fix: Prioritize diff contexts in script mode for ai chat #5888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 9, 2025

Conversation

claude[bot]
Copy link
Contributor

@claude claude bot commented Jun 5, 2025

Summary

This PR fixes the AI context badges by implementing the requested improvements:

  1. Prioritize diff contexts: Diff contexts now appear first in the available context list
  2. Improve readability: Replace underscores with spaces in context titles for better user experience

Changes

  • AvailableContextList.svelte: Added sorting logic to prioritize diff context types first
  • AvailableContextList.svelte: Replace underscores with spaces in context titles using .replace(/_/g, ' ')
  • ContextElementBadge.svelte: Replace underscores with spaces in badge titles

Examples

Context titles are now displayed as:

  • diff with last saved draft instead of diff_with_last_saved_draft
  • diff with last deployed version instead of diff_with_last_deployed_version

Testing

The changes are straightforward UI text formatting improvements that don't affect functionality. Diff contexts will now:

  1. Appear at the top of the context list
  2. Display with readable names instead of technical underscore-separated names

Fixes #5884

Generated with Claude Code


Important

Prioritize diff contexts and improve readability by replacing underscores with spaces in context titles in AvailableContextList.svelte and ContextElementBadge.svelte.

  • Behavior:
    • Prioritize diff contexts in AvailableContextList.svelte by sorting them first.
    • Replace underscores with spaces in diff context titles in AvailableContextList.svelte and ContextElementBadge.svelte.
  • Files:
    • AvailableContextList.svelte: Adds sorting logic and text replacement for diff context titles.
    • ContextElementBadge.svelte: Updates badge titles to replace underscores with spaces.
    • ContextManager.svelte.ts: Maintains underscore in diff titles for internal logic.

This description was created by Ellipsis for 959e7b7. You can customize this summary. It will automatically update as commits are pushed.

…AI context badges

- Sort context list to show diff contexts first in AvailableContextList.svelte
- Replace underscores with spaces in display names for both AvailableContextList.svelte and ContextElementBadge.svelte
- Improves UX by making diff context names more readable (e.g., "diff with last saved draft" instead of "diff_with_last_saved_draft")

Fixes #5884

Co-authored-by: centdix <[email protected]>
@claude claude bot mentioned this pull request Jun 5, 2025
Copy link

cloudflare-workers-and-pages bot commented Jun 5, 2025

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: 959e7b7
Status: ✅  Deploy successful!
Preview URL: https://548b80d4.windmill.pages.dev
Branch Preview URL: https://claude-issue-5884-20250605-2.windmill.pages.dev

View logs

@centdix centdix marked this pull request as ready for review June 6, 2025 08:14
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to f973cd0 in 1 minute and 35 seconds. Click for details.
  • Reviewed 73 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/src/lib/components/copilot/chat/AvailableContextList.svelte:11
  • Draft comment:
    The typePriority mapping assigns 'code' a value of 1 and 'diff' a value of 2, meaning code contexts appear before diff contexts. To prioritize diff contexts as requested, invert these values (e.g., set diff: 1 and code: 2).
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment makes an assumption that diff contexts should be prioritized over code contexts, but there's no evidence in the code or diff to support this assumption. This appears to be a new feature being added to sort contexts, and the chosen priority order (code first, then diff) could be intentional. Without additional context about requirements or design decisions, we can't know if this ordering is incorrect. The sorting order could be important for UX reasons that aren't visible in the code. Maybe there's documentation or requirements somewhere that specify the intended order. Even if there are external requirements, they aren't visible here. We should follow the rule of not keeping speculative comments or asking authors to confirm their intentions. Delete the comment because it makes assumptions about the intended priority order without clear evidence that the current implementation is wrong.
2. frontend/src/lib/components/copilot/chat/ContextManager.svelte.ts:93
  • Draft comment:
    Diff context titles have been updated to replace underscores with spaces. This meets the readability requirement. Ensure that any future diff-related titles follow the same convention.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative and does not provide a specific suggestion or request for action. It does not align with the rules for good comments, as it does not ask for a specific change or confirmation of intention.

Workflow ID: wflow_cHFmbHWaV9H3lGcn

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@centdix centdix force-pushed the claude/issue-5884-20250605_200810 branch from f973cd0 to 959e7b7 Compare June 6, 2025 13:13
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 959e7b7 in 1 minute and 35 seconds. Click for details.
  • Reviewed 50 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/src/lib/components/copilot/chat/AvailableContextList.svelte:18
  • Draft comment:
    Consider avoiding in-place sorting of the prop array. Using availableContext.sort(...) mutates the input. Use availableContext.slice().sort(...) to avoid potential side effects.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
2. frontend/src/lib/components/copilot/chat/AvailableContextList.svelte:12
  • Draft comment:
    The type priority mapping does not match the PR requirement. The PR states diff contexts should appear first, but current priorities assign code: 1 and diff: 2. Consider swapping these (e.g. diff: 1, code: 2) so diff appears first.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. frontend/src/lib/components/copilot/chat/ContextManager.svelte.ts:96
  • Draft comment:
    Typo: The word "hightlighting" should be "highlighting" in the comment text.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While the comment is technically correct about the typo, it's an extremely minor issue in a code comment that doesn't affect functionality. Comments are for human readability and this typo doesn't significantly impact understanding. The rules state not to make comments that are obvious or unimportant. The typo could theoretically cause confusion for non-native English speakers. Also, maintaining high quality even in comments shows attention to detail. While quality is important, this is too minor to warrant a PR comment. The rules explicitly state not to make obvious or unimportant comments. Delete this comment as it points out an extremely minor typo that doesn't impact code functionality or comment comprehension.

Workflow ID: wflow_dh42a3GvKSYDjABV

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@centdix centdix changed the title [Claude PR] Fix AI context badges: prioritize diff contexts and improve readability #5888: fix: Prioritize diff contexts in script mode for ai chat Jun 9, 2025
@centdix centdix changed the title #5888: fix: Prioritize diff contexts in script mode for ai chat fix: Prioritize diff contexts in script mode for ai chat Jun 9, 2025
@HugoCasa HugoCasa added this pull request to the merge queue Jun 9, 2025
Merged via the queue into main with commit a47939d Jun 9, 2025
14 checks passed
@HugoCasa HugoCasa deleted the claude/issue-5884-20250605_200810 branch June 9, 2025 15:14
@github-actions github-actions bot locked and limited conversation to collaborators Jun 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AI] Better AI context badges
2 participants