Skip to content

release/v5.6.4#68

Merged
code-crusher merged 8 commits intomainfrom
release/v5.6.4
Mar 12, 2026
Merged

release/v5.6.4#68
code-crusher merged 8 commits intomainfrom
release/v5.6.4

Conversation

@code-crusher
Copy link
Member

@matter-ai-bot
Copy link
Contributor

matter-ai-bot bot commented Mar 12, 2026

Context

Release v5.6.4 focusing on search accuracy and UI modernization.

Implementation

Summary By MatterAI MatterAI logo

🔄 What Changed

  • Search Ranking: Introduced a multi-signal ranking algorithm in file-search.ts that prioritizes exact basenames, extensions, and path suffixes.
  • Settings UI: Overhauled SettingsView.tsx with a modern sidebar layout, profile section, and plan-based upgrade prompts.
  • Input Preservation: Enhanced ChatTextArea.tsx with snapshotting logic to preserve text and mentions when selecting image context.
  • Version Bump: Updated extension version to 5.6.4 in package.json.

🔍 Impact of the Change

  • Precision: Users will experience significantly more accurate file suggestions when using @ mentions.
  • UX: The settings interface is more intuitive and professional, aligning with modern IDE standards.
  • Reliability: Prevents data loss in the chat input during context switching.

📁 Total Files Changed

Click to Expand
File ChangeLog
Search Ranking src/services/search/file-search.ts Implemented rankWorkspaceSearchResults using 10+ signals (basename length, extension exactness, etc.).
Settings Sidebar webview-ui/src/components/settings/SettingsView.tsx Major refactor to a sidebar-based navigation with profile and logout integration.
Input Snapshot webview-ui/src/components/chat/ChatTextArea.tsx Added getCurrentInputSnapshot to maintain state during context menu interactions.
Plan Upgrade webview-ui/src/components/kilocode/BottomControls.tsx Added dynamic "Upgrade to [Next Plan]" button based on user profile data.
Version Bump src/package.json Incremented version to 5.6.4.
Test Suite src/services/search/__tests__/file-search.spec.ts Added unit tests for the new file ranking logic.

🧪 Test Added/Recommended

Added

  • file-search.spec.ts: Validates ranking signals like exact basename and extension preference.
  • ChatTextArea.spec.tsx: Ensures image context preservation keeps existing text and chips.
  • context-mentions.spec.ts: Tests preference for .tsx over .ts in context menus.

Recommended

  • Add integration tests for the sidebar navigation in SettingsView to ensure all tabs render correctly.

🔒 Security Vulnerabilities

  • N/A. Input validation for file paths is performed via fs.existsSync and path normalization.

Screenshots

before after
N/A N/A

How to Test

  • Open the Settings view and verify the new sidebar layout and profile information.
  • Type @ in the chat input and search for files; verify that exact filename matches appear at the top.
  • Start typing a message with mentions, then click "Add Context" -> "Add Image" and verify your text is preserved.

Get in Touch

N/A

Copy link
Contributor

@matter-ai-bot matter-ai-bot bot left a comment

Choose a reason for hiding this comment

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

🧪 PR Review is completed: The PR introduces solid improvements to file search ranking and webview UI components. However, there are a few performance optimizations and UI bugs that need to be addressed, particularly regarding redundant string operations during sorting and invalid Tailwind opacity modifiers on CSS variables.

Skipped files
  • webview-ui/src/i18n/locales/en/kilocode.json: Skipped file pattern
  • webview-ui/src/i18n/locales/en/settings.json: Skipped file pattern
⬇️ Low Priority Suggestions (2)
webview-ui/src/components/settings/SettingsView.tsx (1 suggestion)

Location: webview-ui/src/components/settings/SettingsView.tsx (Lines 702-702)

🔵 UI/UX Improvement

Issue: When profileEmail is in its initial state of "loading...", the avatar will display "L" which might look like a user's initial.

Fix: Check if the email is "loading..." before using its first character, or use a generic fallback like "U" or an icon until the actual email is loaded.

Impact: Prevents confusing UI state during initial load.

-  							{profileEmail ? profileEmail.charAt(0).toUpperCase() : "S"}
+  							{profileEmail && profileEmail !== "loading..." ? profileEmail.charAt(0).toUpperCase() : "U"}
webview-ui/src/components/chat/ChatTextArea.tsx (1 suggestion)

Location: webview-ui/src/components/chat/ChatTextArea.tsx (Lines 1616-1624)

🟡 UX Improvement

Issue: When clicking the "Add Context (@)" button, it always prepends a space (" @"), even if the input is empty or already ends with a space. This can lead to leading spaces or double spaces.

Fix: Conditionally add the space only if there is preceding text that doesn't end with a space.

Impact: Cleaner input formatting without unnecessary spaces.

-  									const nextValue =
-  										currentValue.slice(0, currentCursorPosition) +
-  										" @" +
-  										currentValue.slice(currentCursorPosition)
-  									const nextCursorPosition = currentCursorPosition + 2
-  
-  									setInputValue(nextValue)
-  									setCursorPosition(nextCursorPosition)
-  									intendedCursorPositionRef.current = nextCursorPosition
+  									const prefix = currentValue.slice(0, currentCursorPosition)
+  									const insertText = prefix.length > 0 && !prefix.endsWith(" ") ? " @" : "@"
+  									const nextValue =
+  										prefix +
+  										insertText +
+  										currentValue.slice(currentCursorPosition)
+  									const nextCursorPosition = currentCursorPosition + insertText.length
+  
+  									setInputValue(nextValue)
+  									setCursorPosition(nextCursorPosition)
+  									intendedCursorPositionRef.current = nextCursorPosition

Comment on lines +62 to +63
className="flex items-center gap-1 px-2.5 py-0.5 rounded-full bg-[var(--vscode-button-background)]/15 hover:bg-[var(--vscode-button-hoverBackground)] hover:text-[var(--vscode-button-foreground)] text-[var(--vscode-button-background)] text-xs font-medium transition-all duration-200 hover:scale-105"
onClick={() => openExternalLink("https://app.matterai.so/orbital")}
Copy link
Contributor

Choose a reason for hiding this comment

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

🔴 UI Bug

Issue: Tailwind's opacity modifier (/15) does not work with VS Code's CSS variables because they are defined as hex colors (e.g., #007acc), not RGB channels. This will result in invalid CSS (rgb(#007acc / 0.15)) and the background color will not be applied.

Fix: Use CSS color-mix to apply opacity to hex CSS variables, or use a solid color if transparency isn't strictly required.

Impact: Ensures the button renders with the correct background color.

Suggested change
className="flex items-center gap-1 px-2.5 py-0.5 rounded-full bg-[var(--vscode-button-background)]/15 hover:bg-[var(--vscode-button-hoverBackground)] hover:text-[var(--vscode-button-foreground)] text-[var(--vscode-button-background)] text-xs font-medium transition-all duration-200 hover:scale-105"
onClick={() => openExternalLink("https://app.matterai.so/orbital")}
className="flex items-center gap-1 px-2.5 py-0.5 rounded-full hover:bg-[var(--vscode-button-hoverBackground)] hover:text-[var(--vscode-button-foreground)] text-[var(--vscode-button-background)] text-xs font-medium transition-all duration-200 hover:scale-105"
style={{ backgroundColor: "color-mix(in srgb, var(--vscode-button-background) 15%, transparent)" }}
onClick={() => openExternalLink("https://app.matterai.so/orbital")}

Comment on lines +55 to +71
return [...results].sort((left, right) => {
const a = getRankSignals(left, normalizedQuery)
const b = getRankSignals(right, normalizedQuery)

return (
b.exactBasename - a.exactBasename ||
b.extensionExactness - a.extensionExactness ||
b.exactPathSuffix - a.exactPathSuffix ||
b.basenameStartsWith - a.basenameStartsWith ||
b.pathSegmentMatch - a.pathSegmentMatch ||
b.basenameIncludes - a.basenameIncludes ||
b.isFile - a.isFile ||
a.basenameLength - b.basenameLength ||
a.pathLength - b.pathLength ||
left.path.localeCompare(right.path)
)
})
Copy link
Contributor

Choose a reason for hiding this comment

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

🟠 Performance

Issue: getRankSignals performs multiple string operations and is called inside the sort comparator. For an array of N items, the comparator runs O(N log N) times, leading to redundant calculations and potential performance bottlenecks during search.

Fix: Use the Schwartzian transform pattern to pre-calculate the rank signals once per item before sorting.

Impact: Significantly improves search ranking performance by reducing redundant string operations.

Suggested change
return [...results].sort((left, right) => {
const a = getRankSignals(left, normalizedQuery)
const b = getRankSignals(right, normalizedQuery)
return (
b.exactBasename - a.exactBasename ||
b.extensionExactness - a.extensionExactness ||
b.exactPathSuffix - a.exactPathSuffix ||
b.basenameStartsWith - a.basenameStartsWith ||
b.pathSegmentMatch - a.pathSegmentMatch ||
b.basenameIncludes - a.basenameIncludes ||
b.isFile - a.isFile ||
a.basenameLength - b.basenameLength ||
a.pathLength - b.pathLength ||
left.path.localeCompare(right.path)
)
})
const withSignals = results.map((item) => ({ item, signals: getRankSignals(item, normalizedQuery) }))
return withSignals
.sort((left, right) => {
const a = left.signals
const b = right.signals
return (
b.exactBasename - a.exactBasename ||
b.extensionExactness - a.extensionExactness ||
b.exactPathSuffix - a.exactPathSuffix ||
b.basenameStartsWith - a.basenameStartsWith ||
b.pathSegmentMatch - a.pathSegmentMatch ||
b.basenameIncludes - a.basenameIncludes ||
b.isFile - a.isFile ||
a.basenameLength - b.basenameLength ||
a.pathLength - b.pathLength ||
left.item.path.localeCompare(right.item.path)
)
})
.map((obj) => obj.item)

Comment on lines +64 to +79
return [...items].sort((left, right) => {
const a = getSignals(left)
const b = getSignals(right)

return (
b.exactBasename - a.exactBasename ||
b.extensionExactness - a.extensionExactness ||
b.exactPathSuffix - a.exactPathSuffix ||
b.basenameStartsWith - a.basenameStartsWith ||
b.basenameIncludes - a.basenameIncludes ||
b.isFile - a.isFile ||
a.basenameLength - b.basenameLength ||
a.pathLength - b.pathLength ||
(left.value || "").localeCompare(right.value || "")
)
})
Copy link
Contributor

Choose a reason for hiding this comment

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

🟠 Performance

Issue: getSignals is called inside the sort comparator, which runs O(N log N) times. This causes redundant string operations for the same items during sorting.

Fix: Pre-calculate the signals before sorting (Schwartzian transform) to improve performance.

Impact: Improves context menu rendering performance, especially with a large number of file matches.

Suggested change
return [...items].sort((left, right) => {
const a = getSignals(left)
const b = getSignals(right)
return (
b.exactBasename - a.exactBasename ||
b.extensionExactness - a.extensionExactness ||
b.exactPathSuffix - a.exactPathSuffix ||
b.basenameStartsWith - a.basenameStartsWith ||
b.basenameIncludes - a.basenameIncludes ||
b.isFile - a.isFile ||
a.basenameLength - b.basenameLength ||
a.pathLength - b.pathLength ||
(left.value || "").localeCompare(right.value || "")
)
})
const withSignals = items.map((item) => ({ item, signals: getSignals(item) }))
return withSignals
.sort((left, right) => {
const a = left.signals
const b = right.signals
return (
b.exactBasename - a.exactBasename ||
b.extensionExactness - a.extensionExactness ||
b.exactPathSuffix - a.exactPathSuffix ||
b.basenameStartsWith - a.basenameStartsWith ||
b.basenameIncludes - a.basenameIncludes ||
b.isFile - a.isFile ||
a.basenameLength - b.basenameLength ||
a.pathLength - b.pathLength ||
(left.item.value || "").localeCompare(right.item.value || "")
)
})
.map((obj) => obj.item)

@code-crusher code-crusher merged commit fec2610 into main Mar 12, 2026
5 of 13 checks passed
@code-crusher code-crusher deleted the release/v5.6.4 branch March 12, 2026 19:33
This was referenced Mar 13, 2026
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