Skip to content

fix: make Upload skill control a normal button (not a single-item dropdown) (#1955) - #2103

Merged
larryro merged 1 commit into
mainfrom
tale/xs72epzvt7v8pzw6zvh0vn20m58975es
Jun 24, 2026
Merged

larryro merged 1 commit into
mainfrom
tale/xs72epzvt7v8pzw6zvh0vn20m58975es

Conversation

@larryro

@larryro larryro commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolves #1955.

The "Upload skill" control was a DataTableActionMenu dropdown with a single "Upload skill" item. This replaces it with a plain button that opens the upload dialog directly — using the DataTableActionMenu simple-button mode (onClick instead of menuItems), so styling stays consistent with the table toolbar and no chevron/dropdown is rendered.

Acceptance criteria

  • "Upload skill" is a single button.
  • No dropdown chevron / menu.

Verification

  • oxlint --type-aware on the changed file: clean.
  • tsc --noEmit: clean.
  • UI test skills-table.test.tsx (asserts the button named "Upload skill" + axe audit): 2 passed.

Summary by CodeRabbit

  • Refactor
    • Simplified the skills action menu implementation for a cleaner, more direct menu rendering approach.
    • Improved internal handling of menu actions while keeping the visible behavior unchanged.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2fbec00c-aff3-4155-a41d-cd56583cf836

📥 Commits

Reviewing files that changed from the base of the PR and between 6b90e78 and 6949ff3.

📒 Files selected for processing (1)
  • services/platform/app/features/skills/components/skills-action-menu.tsx

📝 Walkthrough

Walkthrough

SkillsActionMenu is refactored to remove the useMemo-based menuItems array pattern. The component previously constructed a DataTableActionMenuItem[] via useMemo and passed it as a menuItems prop. It now passes label, icon, and an inline onClick handler directly to DataTableActionMenu. The useMemo import, DataTableActionMenuItem type import, and the memoized array are removed; useState is imported as a standalone import.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes a summary and verification, but it omits the required checklist section and a filled test plan. Add the checklist with checked or N/A items for each required line, and include a brief test plan section per the template.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main change to make the Upload skill control a normal button.
Linked Issues check ✅ Passed The change matches issue #1955 by replacing the single-item dropdown with a direct button that opens the upload dialog.
Out of Scope Changes check ✅ Passed The PR stays focused on the upload control refactor and does not introduce unrelated changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tale/xs72epzvt7v8pzw6zvh0vn20m58975es

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@larryro

larryro commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Desk review — READY TO MERGE ✅

Reviewed the fix for #1955 on tale/xs72epzvt7v8pzw6zvh0vn20m58975es (two rounds: 5 parallel review subagents across correctness/robustness/elegance/tests/boundaries, then independent re-verification of the would-block findings).

What the change does — skills-action-menu.tsx swaps the single-item DataTableActionMenu dropdown (the menuItems/useMemo array) for the component's existing simple-button mode via onClick={() => setUploadOpen(true)}, and drops the now-unused useMemo and DataTableActionMenuItem imports.

Correctness — With menuItems/href/children all absent, DataTableActionMenu falls through to the <Button onClick=…> branch (data-table-action-menu.tsx:127-138) — plain button, no ChevronDown, no DropdownMenu. Both acceptance criteria met (single button; no chevron/menu). Dialog wiring (uploadOpen state + SkillUploadDialog open) is intact, so clicking still opens the upload dialog.

Robustness / elegance — Removed imports have no remaining references; inline onClick arrow is the idiomatic single-action form already used by sibling action menus (api-keys, knowledge-entries). Minimal, focused, no dead code.

Resolution / boundaries — Genuinely fixes the reported control; no other "Upload skill" site renders a single-item dropdown (skill-row-actions / skill-detail-panel are legitimately different). Pure UI swap — no new trust boundary. i18n key skills.uploadSkill present in en/de/fr, unchanged.

Tests — Ran the project's UI suite for the touched area:
bunx vitest --run --config vitest.ui.config.ts data-table-action-menu skills-table skills-action-menu → 5 passed (2 files). data-table-action-menu.test.tsx covers the simple-button (onClick) mode; skills-table.test.tsx asserts the "Upload skill" button renders.

Minor (non-blocking) note — skills-table.test.tsx's getByRole('button', { name: /Upload skill/ }) passes for both the old dropdown trigger and the new button, so it isn't a strict regression guard against re-introducing a dropdown. Optional hardening: add expect(screen.queryByRole('menuitem')).not.toBeInTheDocument();. Not required for merge.

CI — gh pr checks: 46 passed, 5 skipped (conditional jobs: web/docs container tests, Trivy, fork-PR image validation), 0 failed, 0 pending.

Verdict: READY TO MERGE.

@larryro
larryro merged commit d21399b into main Jun 24, 2026
50 checks passed
@larryro
larryro deleted the tale/xs72epzvt7v8pzw6zvh0vn20m58975es branch June 24, 2026 08:55
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.

Improvement: Make the "Upload skill" control a normal button (not a single-item dropdown)

1 participant