Skip to content

Quality-of-life: catalog sort/search, skill duplicate & clone, state persistence, editor upgrades - #2

Merged
robzilla1738 merged 3 commits into
mainfrom
claude/quality-of-life-improvements-iBA0l
Jun 5, 2026
Merged

Quality-of-life: catalog sort/search, skill duplicate & clone, state persistence, editor upgrades#2
robzilla1738 merged 3 commits into
mainfrom
claude/quality-of-life-improvements-iBA0l

Conversation

@robzilla1738

Copy link
Copy Markdown
Owner

Summary

A comprehensive quality-of-life pass across four areas, built to match existing patterns (@MainActor stores, @AppStorage settings, CatalogFilter as the single filter source, the CatalogSection/SkillzAppearance enum idioms). Two new types only: CatalogSortOrder, ToastCenter.

Sorting + search-in-content

  • CatalogSortOrder (name / date-modified / platform / type) with a stable name tiebreak. Sort menu + "Search Inside Skills" toggle live in the list column header; the choice persists.
  • SkillItem.searchableBody is indexed at scan time (length-capped to 8KB, lowercased) — no extra disk I/O — and CatalogFilter matches it only when body search is enabled.

Duplicate / clone-to-platform

  • SkillFileService.duplicateSkill / copySkill copy the whole folder (multi-file skills) with -copy collision-free naming and rewrite the primary SKILL.md name frontmatter.
  • Context menu: Duplicate Skill, Copy to Platform (targets = detected platforms minus existing).

State persistence

  • Last selection / section / platform / sort persist via AppSettings and restore on launch through a shared CatalogSelection.resolve helper.
  • Window frame autosave via SkillzWindowChromeCleaner (set once). Split-column-width persistence was intentionally left out — no reliable macOS 14 API.

Editor niceties + toasts

  • MarkdownTextView (NSTextView) replaces the plain TextEditor: native Find bar, undo, line-wrap toggle. The updateNSView text diff guards the SwiftUI⇄AppKit feedback loop; wrap is re-applied only when the mode changes.
  • Editor footer: word/char count (EditorMetrics) + "Open in Editor".
  • ToastCenter + SkillzToast for auto-dismissing success/info feedback; errors keep the explicit-dismiss banner.

Tests

Adds 12 @Test functions (sort orders, body search, selection resolve, duplicate/copy-to-platform, editor metrics, toast center). Suite total: 60. Docs (CLAUDE.md/AGENTS.md) updated in sync.

Validation

⚠️ Changes were developed in a Linux container with no Swift/Xcode toolchain, so they were not compiled or tested locally — this PR exists so CI builds and runs skillzTests on macos-26.

Known risks to watch in review/CI:

  • The NSTextView bridge is the most likely source of a compile/runtime surprise (Swift 5 concurrency: MainActor.assumeIsolated in the delegate; the CatalogSelection fallback closure).
  • Window-frame restore behavior on macOS 14 (setFrameAutosaveName vs .defaultSize) — degrades gracefully if it doesn't restore.
  • Cmd-F find-bar first-responder routing inside NavigationSplitView/HSplitView.

https://claude.ai/code/session_01GoyGVatSJsyfhtpiMi8ZNy


Generated by Claude Code

claude and others added 3 commits June 5, 2026 16:08
…editor upgrades

Quality-of-life roadmap across four areas:

Sorting + content search
- CatalogSortOrder (name/date-modified/platform/type) with stable name tiebreak;
  sort menu + "Search Inside Skills" toggle in the list column header.
- SkillItem.searchableBody indexed at scan time (length-capped, lowercased, no extra
  disk I/O); CatalogFilter gains searchBody matching.

State persistence
- Last selection/section/platform/sort persist via AppSettings and restore on launch.
- CatalogSelection.resolve shared by refresh/reloadCatalog.
- Window frame autosave via SkillzWindowChromeCleaner.

Duplicate / clone-to-platform
- SkillFileService.duplicateSkill / copySkill copy the whole folder (multi-file skills)
  with -copy collision-free naming and rewrite primary SKILL.md name frontmatter.
- Context menu: Duplicate Skill, Copy to Platform.

Editor niceties + toasts
- NSTextView-backed MarkdownTextView (native Find bar, undo, line-wrap) replacing the
  plain TextEditor; updateNSView diff guards the SwiftUI<->AppKit feedback loop.
- Editor footer: word/char count (EditorMetrics) + Open in Editor.
- ToastCenter + SkillzToast for auto-dismissing success/info feedback; errors keep the
  explicit-dismiss banner.

Adds 12 unit tests (sort, body search, selection resolve, duplicate/copy, editor
metrics, toast center). Docs (CLAUDE.md/AGENTS.md) updated.
…atch editor inset

- SkillzWindowChromeCleaner: set frameAutosaveName only once (cleanWindow runs on every
  updateNSView; re-applying could snap the window to the saved frame).
- MarkdownTextView: re-apply line-wrap only when the mode changes instead of on every
  keystroke, avoiding redundant text-container relayout; track applied state in coordinator.
- MarkdownTextView: use SkillzSpacing.lg/.md for textContainerInset so the NSTextView editor
  keeps the prior 16pt padding feel instead of a tighter inset.
@robzilla1738
robzilla1738 merged commit 81614ac into main Jun 5, 2026
1 check passed
@robzilla1738
robzilla1738 deleted the claude/quality-of-life-improvements-iBA0l branch June 5, 2026 20:47
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.

2 participants