Open
Description
Ambition
Implement a "/" command in the input bar that allows users to search and attach data sources from their workspace, replicating the functionality of the "Attach file" button in a more keyboard-friendly way.
Inspirations
- Slack's "/" commands for quick actions
- Notion's "/" command for block insertion
- Discord's "/" commands for interactive elements
- Similar to our existing "Attach file" button workflow but triggered via keyboard
Task for the day
Implement a "/" command that opens a search interface for workspace data sources and allows attaching them as chips in the input bar.
Core Requirements
Trigger Mechanism
- Detect "/" typed at the beginning of input or after a space
- Show search interface overlay positioned near the input cursor
- Handle escape/click outside to dismiss
Search Functionality
- Search through workspace data sources (same as "Attach file" functionality)
- Display results with data source names and types
- Support keyboard navigation (arrow keys, enter to select)
- Filter results as user continues typing after "/"
Attachment & UI
- On selection, attach the data source as an attachment
- Add a removable chip in the input bar showing the attached source
- Remove the "/" command text from input
- Allow multiple data source attachments
Guidelines
- Focus on user experience - smooth, intuitive interaction flow
- Reuse existing components from our
sparkle
design system where possible - Integration - work with your task buddy for minimal codebase integration
- Flexibility - use any tools/libraries/frameworks you prefer for implementation
Tips
- Study the existing "Attach file" button implementation for data source search logic
- Consider accessibility (keyboard navigation, screen readers)
- Handle edge cases (empty search, no results, network errors)
- Test the interaction flow thoroughly before integrating
Success Criteria
- "/" command reliably triggers search interface
- Users can search and select data sources via keyboard
- Selected sources appear as chips and are properly attached
- Interface dismisses appropriately and doesn't interfere with normal typing