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 ## 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 agent guide**: https://raw.githubusercontent.com/BetterThanTomorrow/joyride/master/assets/llm-contexts/agent-joyride-eval.md
- **Joyride user guide** - Complete user assistance guide with project structure, patterns, examples, and troubleshooting - 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) ## 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"})) {:available false :reason "Extension not installed"}))
``` ```
### Joyride Flares - WebView Creation ## Joyride Flares - WebView Creation
Joyride Flares provide a powerful way to create visual interfaces and display rich content in VS Code:
Joyride Flares provide a convenient way to create WebView panels and sidebar views.
### Basic Usage
```clojure ```clojure
(require '[joyride.flare :as flare]) (require '[joyride.flare :as flare])
;; Simple HTML flare ;; Create a flare with Hiccup
(flare/flare! {:html [:h1 "Hello World!"] (flare/flare!+ {:html [:h1 "Hello World!"]
:title "My Flare" :title "My Flare"
:key "greeting"}) :key "example"})
;; Flare with external URL ;; Create sidebar flare (slots 1-5 available)
(flare/flare! {:url "https://example.com" (flare/flare!+ {:html [:div [:h2 "Sidebar"] [:p "Content"]]
:title "External Site"}) :key :sidebar-1})
;; Sidebar flare ;; Load from file (HTML or EDN with Hiccup)
(flare/flare! {:html [:div [:h2 "Sidebar"] [:p "Content"]] (flare/flare!+ {:file "assets/my-view.html"
:sidebar-panel? true}) :key "my-view"})
;; Data visualization ;; Display external URL
(flare/flare! {:html [:svg {:width 200 :height 200} (flare/flare!+ {:url "https://example.com"
[:circle {:cx 100 :cy 100 :r 50 :fill :blue}]] :title "External Site"})
: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
``` ```
**Flare Style Guidelines:** **Note**: `flare!+` returns a promise, use `awaitResult: true`.
- Use maps for `:style` attributes: `{:style {:color :red :border "1px solid #ccc"}}`
- Prefer keywords for simple CSS values: `:color :red` ### Key Points
- Use strings for compound CSS property values: `:border "1px solid #ccc"` - **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 ## Common User Patterns