Skip to content

Commit ad4ab97

Browse files
committed
Merge branch 'main' into create-bookmark
2 parents 4f45bae + 153f945 commit ad4ab97

603 files changed

Lines changed: 11421 additions & 2322 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
pull_request:
8+
branches:
9+
- "**"
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
lint:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: "22"
26+
27+
- name: Install dependencies
28+
run: npm install
29+
30+
- name: Run linter
31+
run: npm run lint
32+
33+
build:
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v4
39+
40+
- name: Set up Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: "22"
44+
45+
- name: Install dependencies
46+
run: npm install
47+
48+
- name: Build extension
49+
run: npm run build
50+
51+
type-check:
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v4
57+
58+
- name: Set up Node.js
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: "22"
62+
63+
- name: Install dependencies
64+
run: npm install
65+
66+
- name: Run type checks
67+
run: npm run type-check

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build & Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
build-and-release:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout tag
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
ref: ${{ github.ref }}
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: "20"
27+
28+
- name: Cache npm modules
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.npm
32+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
- name: Build extension
38+
run: npm run build
39+
40+
- name: Compute BUILD_DIR
41+
run: echo "BUILD_DIR=$HOME/.config/raycast/extensions/anytype" >> $GITHUB_ENV
42+
43+
- name: Verify build output
44+
run: |
45+
if [ ! -d "${BUILD_DIR}" ]; then
46+
echo "❌ Build directory '${BUILD_DIR}' not found!"
47+
exit 1
48+
fi
49+
50+
- name: Compress extension to tar.gz
51+
run: |
52+
TAR_NAME="anytype-raycast-${{ github.ref_name }}.tar.gz"
53+
tar czf "${GITHUB_WORKSPACE}/${TAR_NAME}" --transform "s,^,anytype-raycast-${{ github.ref_name }}/," -C "${BUILD_DIR}" .
54+
55+
- name: Create Release & Upload Asset
56+
uses: softprops/action-gh-release@v2
57+
with:
58+
name: ${{ github.ref_name }}
59+
files: anytype-raycast-${{ github.ref_name }}.tar.gz
60+
generate_release_notes: true
61+
draft: false
62+
prerelease: false
63+
token: ${{ secrets.GITHUB_TOKEN }}

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
npm run build
2+
npx lint-staged

.husky/pre-push

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
INSTALL_PYTHON=python3
4+
ARGS=(hook-impl --config=.pre-commit-config.yaml --hook-type=pre-push)
5+
6+
HERE="$(cd "$(dirname "$0")" && pwd)"
7+
ARGS+=(--hook-dir "$HERE" -- "$@")
8+
9+
if command -v pre-commit > /dev/null; then
10+
exec pre-commit "${ARGS[@]}"
11+
elif [ -x "$INSTALL_PYTHON" ]; then
12+
exec "$INSTALL_PYTHON" -mpre_commit "${ARGS[@]}"
13+
else
14+
echo "`pre-commit` not found, install via `brew install pre-commit`." 1>&2
15+
exit 1
16+
fi

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repos:
2+
- repo: https://github.com/zricethezav/gitleaks
3+
rev: v8.18.0
4+
hooks:
5+
- id: gitleaks

CHANGELOG.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,96 @@
11
# Anytype Changelog
22

3+
## [Fixes] - {PR_MERGE_DATE}
4+
5+
- Fix error when creating objects without linked type properties
6+
- Fix display issues when Note layouts are missing icons
7+
- Fix draft functionality in CreateObject form
8+
- Fix form validation in AddToList command
9+
- Fix string pluralization issues
10+
11+
## [UI Polish, Tag Management & Fixes] - 2025-05-26
12+
13+
- Add context actions to manage tags on objects (add/remove)
14+
- Improve type indicators across all object lists
15+
- Support built-in SVG icons for type creation and editing
16+
- Standardize placeholder text and information messages
17+
- Update to API version 2025-05-20
18+
19+
## [Properties, Types & Tags] - 2025-05-07
20+
21+
#### New Creation Options
22+
23+
When browsing spaces, press `CMD+N` to create new objects, types, properties or tags.
24+
25+
- Add ability to create new spaces
26+
- Add ability to create new types
27+
- Add ability to create new properties
28+
- Add ability to create new tags
29+
30+
#### Edit Form Enhancements
31+
32+
Use `CMD+E` to quickly edit the currently selected item - whether it's a space, object, type, property, or tag.
33+
34+
- Add support for editing spaces
35+
- Add support for editing objects
36+
- Add support for editing types
37+
- Add support for editing properties
38+
- Add support for editing tags
39+
40+
#### New Commands & Navigation
41+
42+
- Add new command to add objects to lists
43+
- Pop back to list view when deleting object, with automatic refresh
44+
- List properties when browsing space
45+
- Browse tags for select/multi-select properties
46+
- Open bookmarks directly in browser
47+
48+
#### Form Improvements
49+
50+
- Allow custom properties (inherited from type) for object creation
51+
- Improve number and emoji validation logic in create form
52+
53+
## [✨ AI Enhancements & Improvements] - 2025-04-22
54+
55+
#### AI Extension
56+
57+
- Interact naturally with your Anytype spaces using `@anytype` to create object content with the power of AI
58+
- Use simple natural-language queries to search globally or within specific spaces
59+
- Manage objects and lists (collections) easily with commands like adding to or removing objects from lists
60+
61+
#### Pinning
62+
63+
- Pin objects to top of global search for quicker access
64+
- Pin spaces and specific objects/types/members per space
65+
66+
#### Object Creation & Templates
67+
68+
- Create objects directly within collections
69+
- Use predefined templates when creating new objects
70+
- Quickly create spaces and objects with pre-selected context (space, collection, or type) directly from empty search results
71+
72+
#### Object Details
73+
74+
- Show all properties (including custom ones) of an object in the detail sidebar
75+
- Toggle the sidebar visibility using action or keyboard shortcut
76+
- Make object references clickable in the sidebar (e.g. type of the object, linked project etc.)
77+
78+
#### Browsing
79+
80+
- Browse items within lists (collections and sets) with support for multiple views
81+
- Display objects of a specific type beneath their corresponding templates when viewing types within a space
82+
- Show space names in navigation titles when browsing spaces or lists
83+
84+
#### Preferences
85+
86+
- New preference setting to open objects directly in Anytype app instead of displaying them in Raycast’s detail view
87+
- Add setting to make URLs & Mailto links clickable in sidebar
88+
89+
#### Bug Fixes & Performance Improvements
90+
91+
- Fix fetching limitation of max 100 types in dropdown during object creation
92+
- Correctly handle UNIX epoch date timestamps for members
93+
394
## [Fixes] - 2025-01-28
495

596
- Fix bugs for search, navigation and deeplinks

CLAUDE.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Essential Commands
6+
7+
### Development
8+
- `npm run dev` - Start Raycast development mode
9+
- `npm run build` - Build the extension
10+
- `npm run lint` - Run ESLint
11+
- `npm run fix-lint` - Fix ESLint issues
12+
- `npm run type-check` - Run TypeScript type checking
13+
14+
### Testing
15+
- `npm test` - Run tests with Vitest
16+
- `npm run test:ui` - Run tests with Vitest UI
17+
- `npm run test:coverage` - Run tests with coverage report
18+
19+
### Single Test Execution
20+
- `npx vitest run <file-pattern>` - Run specific test files
21+
- `npx vitest run src/utils/api.test.ts` - Run single test file
22+
23+
## Architecture Overview
24+
25+
This is a Raycast extension for Anytype that enables users to interact with Anytype's local API directly from Raycast. The codebase follows a modular architecture:
26+
27+
### Core Structure
28+
- **`src/api/`** - API layer organized by feature domains (auth, objects, spaces, lists, members, etc.)
29+
- **`src/components/`** - React components for UI, organized by purpose (Forms, Actions, Lists, etc.)
30+
- **`src/hooks/`** - Custom React hooks for data fetching and state management
31+
- **`src/models/`** - TypeScript interfaces and types
32+
- **`src/utils/`** - Utility functions for API calls, error handling, form validation, etc.
33+
- **`src/tools/`** - AI-enabled tools for Raycast's AI integration
34+
- **`src/mappers/`** - Data transformation functions between API responses and UI models
35+
36+
### Key Architectural Patterns
37+
38+
**API Layer**: Centralized in `src/utils/api.ts` with `apiFetch()` function that handles authentication, error handling, and response parsing. Each API endpoint is organized by domain (objects, spaces, members, etc.).
39+
40+
**Authentication**: Token-based authentication with local storage fallback. Supports both manual API keys and app-based pairing flow.
41+
42+
**Data Flow**: API → Hooks → Components. Custom hooks encapsulate data fetching logic and provide React Query-like patterns for caching and state management.
43+
44+
**Component Organization**:
45+
- Forms for creation/updates are in `CreateForm/` and `UpdateForm/`
46+
- List components for displaying collections
47+
- Action components for user interactions
48+
- Empty view components for no-data states
49+
50+
**AI Tools Integration**: Special tool files in `src/tools/` that interface with Raycast's AI system, allowing natural language interaction with Anytype data.
51+
52+
### Raycast Integration
53+
The extension integrates with Raycast through:
54+
- Commands defined in `package.json` that map to main component files
55+
- AI tools for natural language interaction
56+
- Preferences for API configuration and behavior customization
57+
- Local authentication flow with the Anytype desktop app
58+
59+
### Testing Setup
60+
- Vitest for testing with Happy DOM environment
61+
- Mocked Raycast API in `src/test/mocks/raycast.ts`
62+
- Coverage reporting configured
63+
- Test files follow `.test.ts` naming convention

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Anytype for Raycast
22

3-
Create, browse and search in Anytype - right at your fingertips, anywhere on your Mac.
3+
Create, browse, search and edit within Anytype - right at your fingertips, anywhere on your Mac.
44

55
## Setup
66

@@ -10,10 +10,10 @@ To get started, grant the extension access to your account using the local pairi
1010
2. **Open Anytype Desktop**: Ensure the app is running and you are logged in.
1111
3. **Run a Command**: Trigger any extension command.
1212
4. **Authenticate**: When prompted, press <kbd>Enter</kbd> to start the pairing process.
13-
5. **Enter the Code**: A popup in Anytype Desktop will display a 4-digit code. Input this code in the extension’s `Verification Code` field. Press <kbd>Command</kbd> + <kbd>Enter</kbd> to confirm.
13+
5. **Enter the Code**: A popup in Anytype Desktop will display a 4-digit code. Input this code in the extension’s `Code` field. Press <kbd>Command</kbd> + <kbd>Enter</kbd> to confirm.
1414
6. **Confirmation**: Once successfully paired, the extension is ready to use.
1515

16-
![Authenticate](./metadata/anytype-5.png)
16+
![Authenticate](./metadata/anytype-7.png)
1717

1818
## Commands
1919

@@ -37,6 +37,7 @@ Navigate through your spaces and explore their contents.
3737

3838
![Browse Spaces](./metadata/anytype-1.png)
3939
![Browse Objects](./metadata/anytype-2.png)
40+
![Browse Types](./metadata/anytype-6.png)
4041

4142
### Search Anytype
4243

@@ -47,6 +48,7 @@ Perform a global search across all spaces in your vault.
4748
- **Interact**: Press <kbd>Enter</kbd> to view the object in Raycast or <kbd>Command</kbd> + <kbd>Enter</kbd> to open it in Anytype.
4849

4950
![Search](./metadata/anytype-4.png)
51+
![Show Details](./metadata/anytype-5.png)
5052

5153
## Tips
5254

assets/icons/dataview/calendar.svg

Lines changed: 18 additions & 0 deletions
Loading
Lines changed: 18 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)