Enhance compose experience with comprehensive autocomplete systems
## Major Features Added ### Smart Mention Completion - **Full fediverse handles**: @user@instance.com format instead of incomplete usernames - **Multi-source suggestions**: Search API + followers + following for comprehensive results - **Real-time API integration**: No more hardcoded sample data - **Intelligent filtering**: Prefix-based matching across all user connections ### Comprehensive Emoji System - **5,000+ Unicode emojis**: Complete emoji dataset via python-emoji library - **Keyword-based search**: Find emojis by typing descriptive words (:fire, :heart, :grin) - **Actual emoji insertion**: Inserts Unicode characters (🎃) not shortcodes (🎃) - **Accurate selection**: Fixed bug where wrong emoji was inserted from autocomplete list - **Smart synonyms**: Common aliases for frequently used emojis ### Enhanced ActivityPub Integration - **Account relationships**: get_followers(), get_following(), search_accounts() methods - **Expanded API coverage**: Better integration with fediverse social graph - **Robust error handling**: Graceful fallbacks for API failures ### User Experience Improvements - **Bug fixes**: Resolved autocomplete selection and focus restoration issues - **Documentation**: Updated README with comprehensive feature descriptions - **Dependencies**: Added emoji>=2.0.0 to requirements for Unicode support ## Technical Details - Removed incomplete fallback data in favor of live API integration - Improved completer selection logic to use actually selected items - Enhanced error handling for network requests and API limitations - Updated installation instructions for new emoji library dependency 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -178,6 +178,35 @@ class ActivityPubClient:
|
||||
endpoint = f'/api/v1/accounts/{account_id}/unfollow'
|
||||
return self._make_request('POST', endpoint)
|
||||
|
||||
def get_followers(self, account_id: str, max_id: Optional[str] = None, limit: int = 40) -> List[Dict]:
|
||||
"""Get followers for an account"""
|
||||
params = {'limit': limit}
|
||||
if max_id:
|
||||
params['max_id'] = max_id
|
||||
|
||||
endpoint = f'/api/v1/accounts/{account_id}/followers'
|
||||
return self._make_request('GET', endpoint, params=params)
|
||||
|
||||
def get_following(self, account_id: str, max_id: Optional[str] = None, limit: int = 40) -> List[Dict]:
|
||||
"""Get accounts that an account is following"""
|
||||
params = {'limit': limit}
|
||||
if max_id:
|
||||
params['max_id'] = max_id
|
||||
|
||||
endpoint = f'/api/v1/accounts/{account_id}/following'
|
||||
return self._make_request('GET', endpoint, params=params)
|
||||
|
||||
def search_accounts(self, query: str, limit: int = 10) -> List[Dict]:
|
||||
"""Search for accounts by username"""
|
||||
params = {
|
||||
'q': query,
|
||||
'type': 'accounts',
|
||||
'limit': limit
|
||||
}
|
||||
|
||||
result = self._make_request('GET', '/api/v2/search', params=params)
|
||||
return result.get('accounts', [])
|
||||
|
||||
def search(self, query: str, account_id: Optional[str] = None,
|
||||
max_id: Optional[str] = None, min_id: Optional[str] = None,
|
||||
type_filter: Optional[str] = None, limit: int = 20) -> Dict:
|
||||
|
Reference in New Issue
Block a user