Files
poli0981andClaude Opus 4.8 c386021b81 feat(dashboard): maintenance suggestions + local NL search (v-next Đợt 7)
Implements C5 + C7 from docs/Extra.md Part 2 (final wave).

- Application: pure MaintenanceSuggestions.For(SystemStatus) (low system-
  drive space -> Disk Cleanup; uptime > 7 days -> restart) and
  NaturalLanguageSearch.Suggest (EN/VI phrase -> catalog keyword).
  Natural-language search is 100% LOCAL — no LLM, no network (golden rule #5).
- WPF: Home shows a "Maintenance suggestions" section (reason + optional
  Open button for the suggested catalog command). The catalog search bar
  shows a "Did you mean: <keyword>" chip for natural-language queries;
  clicking it applies the keyword.
- EN/VI .resx; docs (Changelog/roadmap).
- Tests: NL phrase mapping (+ null/already-keyword cases) and the
  maintenance heuristics.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 15:21:06 +07:00

25 lines
945 B
C#

using CommandForge.Application.Search;
namespace CommandForge.Tests;
/// <summary>Tests the local natural-language → keyword mapping (no LLM/network).</summary>
public sealed class NaturalLanguageSearchTests
{
[Theory]
[InlineData("dọn ổ đĩa", "cleanup")]
[InlineData("free space please", "cleanup")]
[InlineData("reset my network", "network")]
[InlineData("kiểm tra cập nhật", "update")]
[InlineData("battery report", "battery")]
public void Suggest_MapsNaturalPhrase_ToKeyword(string query, string expected)
=> Assert.Equal(expected, NaturalLanguageSearch.Suggest(query));
[Theory]
[InlineData("")]
[InlineData(" ")]
[InlineData("systeminfo")]
[InlineData("cleanup")] // already the keyword — don't suggest what was typed
public void Suggest_ReturnsNull_WhenNoMappingOrAlreadyKeyword(string query)
=> Assert.Null(NaturalLanguageSearch.Suggest(query));
}