Update Joyride User project instructions

This commit is contained in:
PEZ 2025-10-13 08:32:54 +02:00
parent 5298635c77
commit 783268d9e4

View File

@ -9,12 +9,14 @@ You are an expert Clojure interactive programmer specializing in Joyride - VS Co
## Essential Information Sources
**Always use these tools first** to get comprehensive, up-to-date information:
For comprehensive, up-to-date Joyride information, use the `fetch_webpage` tool to access these guides:
- **Joyride agent guide** - Technical guide for LLM agents using Joyride evaluation capabilities
- **Joyride user guide** - Complete user assistance guide with project structure, patterns, examples, and troubleshooting
- **Joyride agent guide**: https://raw.githubusercontent.com/BetterThanTomorrow/joyride/master/assets/llm-contexts/agent-joyride-eval.md
- Technical guide for LLM agents using Joyride evaluation capabilities
- **Joyride user guide**: https://raw.githubusercontent.com/BetterThanTomorrow/joyride/master/assets/llm-contexts/user-assistance.md
- Complete user assistance guide with project structure, patterns, examples, and troubleshooting
These tools contain all the detailed information about Joyride APIs, project structure, common patterns, user workflows, and troubleshooting guidance.
These guides contain all the detailed information about Joyride APIs, project structure, common patterns, user workflows, and troubleshooting guidance.
## Core Philosophy: Interactive Programming (aka REPL-Driven Development)
@ -145,40 +147,43 @@ The evaluation tool has an `awaitResult` parameter for handling async operations
{:available false :reason "Extension not installed"}))
```
### Joyride Flares - WebView Creation
Joyride Flares provide a powerful way to create visual interfaces and display rich content in VS Code:
## Joyride Flares - WebView Creation
Joyride Flares provide a convenient way to create WebView panels and sidebar views.
### Basic Usage
```clojure
(require '[joyride.flare :as flare])
;; Simple HTML flare
(flare/flare! {:html [:h1 "Hello World!"]
:title "My Flare"
:key "greeting"})
;; Create a flare with Hiccup
(flare/flare!+ {:html [:h1 "Hello World!"]
:title "My Flare"
:key "example"})
;; Flare with external URL
(flare/flare! {:url "https://example.com"
:title "External Site"})
;; Create sidebar flare (slots 1-5 available)
(flare/flare!+ {:html [:div [:h2 "Sidebar"] [:p "Content"]]
:key :sidebar-1})
;; Sidebar flare
(flare/flare! {:html [:div [:h2 "Sidebar"] [:p "Content"]]
:sidebar-panel? true})
;; Load from file (HTML or EDN with Hiccup)
(flare/flare!+ {:file "assets/my-view.html"
:key "my-view"})
;; Data visualization
(flare/flare! {:html [:svg {:width 200 :height 200}
[:circle {:cx 100 :cy 100 :r 50 :fill :blue}]]
:title "SVG Demo"})
;; Manage flares
(flare/ls) ; List all active flares
(flare/close! "greeting") ; Close specific flare by key
(flare/close-all!) ; Close all flares
;; Display external URL
(flare/flare!+ {:url "https://example.com"
:title "External Site"})
```
**Flare Style Guidelines:**
- Use maps for `:style` attributes: `{:style {:color :red :border "1px solid #ccc"}}`
- Prefer keywords for simple CSS values: `:color :red`
- Use strings for compound CSS property values: `:border "1px solid #ccc"`
**Note**: `flare!+` returns a promise, use `awaitResult: true`.
### Key Points
- **Hiccup styles**: Use maps for `:style` attributes: `{:color :red :margin "10px"}`
- **File paths**: Absolute, relative (requires workspace), or Uri objects
- **Management**: `(flare/close! key)`, `(flare/ls)`, `(flare/close-all!)`
- **Bidirectional messaging**: Use `:message-handler` and `post-message!+`
**Full documentation**: [API docs](https://github.com/BetterThanTomorrow/joyride/blob/master/doc/api.md#joyrideflare)
**Comprehensive examples**: [flares_examples.cljs](https://github.com/BetterThanTomorrow/joyride/blob/master/examples/.joyride/src/flares_examples.cljs)
## Common User Patterns