Skip to content

fix(skills): reuse shared upload field in skill import modal; logo-only Quartr icon#5026

Merged
waleedlatif1 merged 2 commits into
stagingfrom
worktree-fix+skill-modal-upload
Jun 13, 2026
Merged

fix(skills): reuse shared upload field in skill import modal; logo-only Quartr icon#5026
waleedlatif1 merged 2 commits into
stagingfrom
worktree-fix+skill-modal-upload

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Replace the hand-rolled drop zone in the skill Import modal with the shared ChipModalField type='file' control — the same upload component the Create Knowledge Base and Help & support modals use — so the upload zone is visually consistent across modals.
  • Migrate the Import from GitHub and Paste SKILL.md Content rows to ChipModalField so every field shares the canonical gutter, label, and error rendering, and align the or dividers to match.
  • Drop the monospace font on the paste textarea so its text matches the rest of the modal (fixes the inconsistent font at the bottom).
  • Quartr icon now renders the logo mark only (no wordmark) as a black mark on a white rounded tile.

Type of Change

  • Bug fix

Testing

Tested manually — verified the import modal renders the shared upload field, GitHub/paste rows align with the Create tab, and the Quartr icon renders centered.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…ly Quartr icon

- Replace the hand-rolled drop zone in the skill import modal with the shared
  ChipModalField type='file' control (same component the Knowledge Base and
  Help & Support modals use), so the upload zone is visually consistent.
- Migrate the GitHub-URL and paste-content rows to ChipModalField so every
  field shares the canonical px-4 gutter and error rendering, and align the
  'or' dividers to match.
- Drop the monospace font on the paste textarea so its text matches the rest
  of the modal.
- Quartr icon now renders the logo mark only (no wordmark) as a black mark on
  a white rounded tile.
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jun 13, 2026 5:42pm

Request Review

@cursor

cursor Bot commented Jun 13, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
UI consistency and a shared modal primitive extension; import/GitHub/paste logic is unchanged aside from the upload control wiring.

Overview
The skill Import modal no longer uses a one-off drop zone and hand-labeled rows. Upload, Import from GitHub, and Paste SKILL.md now go through ChipModalField (type='file' and type='custom') so labels, gutters, and inline errors match other chip modals (e.g. knowledge-base document upload). File handling is wired through onChange(files: File[]); the paste textarea drops font-mono so typography matches the rest of the modal, and or dividers use slightly wider horizontal padding.

ChipModalField file controls gain an optional loading prop: the drop zone shows a spinner, sets aria-busy, and blocks click/drag while async work runs (used for zip/md import with an Importing… label).

QuartrIcon is redrawn as the logo mark only on a 32×32 white rounded tile (black paths), replacing the wide wordmark SVG that used currentColor.

Reviewed by Cursor Bugbot for commit 460b304. Configure here.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e6ef14e. Configure here.

@greptile-apps

greptile-apps Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces the hand-rolled upload drop zone and field wrappers in the skill Import modal with the shared ChipModalField component family, achieving visual and structural consistency with other modals (Create Knowledge Base, Help & support). It also extends ChipModalFileControl with an optional loading prop that restores the animated spinner dropped in the original migration, and updates the Quartr icon to a logo-mark-only tile.

  • skill-import.tsx: Removes custom drag-counter state, fileInputRef, and bespoke drag-event handlers; delegates all upload chrome to ChipModalField type='file' and wraps the GitHub/paste rows in ChipModalField type='custom', with min-w-0 added to ChipInput to prevent overflow and font-mono removed from the paste textarea.
  • chip-modal.tsx: ChipModalFileControl gains a loading prop that renders a Loader spinner, sets aria-busy, and gates drag/click interaction behind an isInteractive derived flag.
  • icons.tsx: QuartrIcon is replaced with a compact 32×32 logo-mark tile (white rounded rect + black mark), dropping the 151×40 wordmark SVG.

Confidence Score: 5/5

Safe to merge — changes are a UI refactor with no new network calls, state logic, or data paths.

The upload migration correctly threads the file through handleFiles → processFile unchanged, the new loading prop in ChipModalFileControl is well-guarded with isInteractive, and the Quartr icon swap is self-contained. No application logic changed.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/skills/components/skill-import/skill-import.tsx Hand-rolled drop zone and field wrappers replaced with shared ChipModalField; loading spinner restored via new prop; unused refs/drag-counter state removed; minor layout fixes (min-w-0, divider padding).
apps/sim/components/emcn/components/chip-modal/chip-modal.tsx Adds optional loading prop to ChipModalFileControl: renders animated Loader, blocks click/drop via isInteractive guard, and sets aria-busy; clean implementation with no regressions.
apps/sim/components/icons.tsx Quartr icon replaced from full 151×40 wordmark SVG to a 32×32 logo-mark-only tile with fixed white background and black mark, consistent with other brand icon tiles in the file.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User opens Import modal] --> B{Choose method}
    B --> C[Upload File]
    B --> D[Import from GitHub]
    B --> E[Paste SKILL.md Content]

    C --> C1[ChipModalField type=file]
    C1 --> C2{Drop or click}
    C2 --> C3[handleFiles callback]
    C3 --> C4[processFile]
    C4 --> C5{fileState}
    C5 -->|loading| C6[loading=true → Loader spinner + aria-busy]
    C5 -->|error| C7[fileError shown via ChipModalField error prop]
    C5 -->|idle| C8[onImport called]

    D --> D1[ChipModalField type=custom]
    D1 --> D2[ChipInput + Chip Fetch button]
    D2 --> D3[handleGithubImport]
    D3 -->|error| D4[githubError shown]
    D3 -->|success| D5[onImport called]

    E --> E1[ChipModalField type=custom]
    E1 --> E2[ChipTextarea + Chip Import button]
    E2 --> E3[handlePasteImport]
    E3 -->|error| E4[pasteError shown]
    E3 -->|success| E5[onImport called]
Loading

Reviews (3): Last reviewed commit: "fix(emcn): restore upload spinner via lo..." | Re-trigger Greptile

Comment thread apps/sim/components/icons.tsx
@greptile-apps

greptile-apps Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR refactors the skill import modal to replace a hand-rolled file drop zone and custom field rows with the shared ChipModalField component (type='file' and type='custom'), removing ~60 lines of bespoke drag-handling and chrome. The Quartr icon is also updated to render only its logo mark as a black mark on a white rounded tile (dropping the wordmark).

  • skill-import.tsx: fileInputRef, dragCounter, and five drag/file-change callbacks are deleted; each import method (file, GitHub URL, paste) now delegates chrome and error display to ChipModalField, and the monospace font-mono class is removed from the paste textarea.
  • icons.tsx: QuartrIcon moves from a 151×40 combined logo+wordmark SVG to a 32×32 logo-only mark with hardcoded fill='black' paths on a fill='white' rounded rect.

Confidence Score: 4/5

Safe to merge; the refactor delegates well-tested shared components and removes complexity without changing business logic.

Both changed files are UI-layer only. The skill-import refactor faithfully reproduces all prior behaviours (drag-and-drop, error display, loading state) through the shared ChipModalFileControl, and the processFile / GitHub / paste logic is untouched. The only open question is the Quartr icon's hardcoded black-on-white fill, which won't automatically adapt in dark mode.

icons.tsx — the QuartrIcon's hardcoded fill values deserve a quick check against dark-mode rendering to confirm the white-tile approach is intentional.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/skills/components/skill-import/skill-import.tsx Replaces hand-rolled drop zone and field rows with shared ChipModalField primitives; removes fileInputRef, dragCounter, and five drag-handler callbacks; minor alignment fix (px-1→px-2 on ImportDivider).
apps/sim/components/icons.tsx QuartrIcon viewBox changed from 151×40 (logo + wordmark) to 32×32 (logo only); paths now use hardcoded fill='black' on a fill='white' rounded rect rather than fill='currentColor'.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[SkillImport modal] --> B[ChipModalField file]
    A --> C[ChipModalField GitHub]
    A --> D[ChipModalField Paste]

    B -->|onChange| E[handleFiles]
    E --> F[processFile]
    F -->|md| G[file.text]
    F -->|zip| H[extractSkillFromZip]
    G --> I[parseSkillMarkdown]
    H --> I
    I --> J[onImport]

    C --> K[ChipInput + Fetch Chip]
    K -->|onClick| L[handleGithubImport]
    L --> M[requestJson]
    M --> I

    D --> N[ChipTextarea + Import Chip]
    N -->|onClick| O[handlePasteImport]
    O --> I
Loading

Comments Outside Diff (1)

  1. apps/sim/components/icons.tsx, line 3710-3730 (link)

    P2 Hardcoded colors break dark-mode adaptability

    The new icon embeds fill='white' on the background rect and fill='black' on every path. These values are static, so in dark mode the tile will always render as a bright-white square with a black mark regardless of the surrounding color scheme — whereas the old icon used fill='currentColor' and adapted to the active theme. Most other brand icons in this file that display a white-background tile wrap the background color in the parent container (e.g. an IntegrationCard) rather than baking it into the SVG, so the SVG itself stays theme-neutral. Confirm this is the intended approach for Quartr, especially if the icon is ever rendered on a dark surface.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (2): Last reviewed commit: "fix(skills): reuse shared upload field i..." | Re-trigger Greptile

…file control

Addresses review feedback — the shared file drop zone now accepts an optional
loading prop that renders an animated spinner and blocks further picks while an
async import is in flight, restoring the feedback the skill import modal lost
when it migrated off its bespoke drop zone.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 460b304. Configure here.

@waleedlatif1 waleedlatif1 merged commit e51bc57 into staging Jun 13, 2026
15 checks passed
@waleedlatif1 waleedlatif1 deleted the worktree-fix+skill-modal-upload branch June 13, 2026 17:59
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