mirror of
https://github.com/penpot/penpot.git
synced 2026-08-17 18:28:41 +00:00
📚 Improve/restructure critical-info memory, adding navigation memory
This commit is contained in:
parent
65fce36898
commit
85cf3fcc3c
@ -1,21 +1,26 @@
|
|||||||
You are working on the GitHub project penpot/penpot.
|
You are working on the GitHub project penpot/penpot.
|
||||||
|
|
||||||
# Working with Penpot Designs
|
# Working with Penpot Designs via the JavaScript API
|
||||||
|
|
||||||
Before working with Penpot designs, call the `high_level_overview` tool of the Penpot MCP server.
|
Before working with Penpot designs, call the `high_level_overview` tool of the Penpot MCP server.
|
||||||
It explains the JavaScript API, which you can use to automate tasks via the `execute_code` tool.
|
It explains the API, which you can use to automate tasks via the `execute_code` tool.
|
||||||
|
|
||||||
# Critical Memories
|
# Dev Workflow
|
||||||
|
|
||||||
* Before creating a commit, read `creating-commits`.
|
Memories:
|
||||||
* When working on the Penpot frontend ...
|
- before creating a commit, read `creating-commits`.
|
||||||
- read the file `frontend/AGENTS.md` for an overview
|
- before creating a PR, read `creating-prs`.
|
||||||
- to understand the connection between the JavaScript API and the ClojureScript code, read memory `frontend/js-api-to-cljs-binding`.
|
|
||||||
- to understand how to execute ClojureScript code in the Penpot frontend, read memory `frontend/cljs-repl`.
|
|
||||||
|
|
||||||
# Detecting Frontend Crashes
|
# Frontend
|
||||||
|
|
||||||
|
Read the file `frontend/AGENTS.md` for an overview.
|
||||||
|
Memories:
|
||||||
|
- connection between the JavaScript API and the ClojureScript code: `frontend/js-api-to-cljs-binding`.
|
||||||
|
- executing ClojureScript code in the frontend: `frontend/cljs-repl`.
|
||||||
|
- programmatically navigating to a file in the workspace: `frontend/navigation`.
|
||||||
|
|
||||||
|
## Detecting Crashes
|
||||||
|
|
||||||
The Penpot frontend can crash silently from the JS API's perspective: `execute_code` calls return successfully, but 1-2s later the workspace becomes unusable (Internal Error page).
|
The Penpot frontend can crash silently from the JS API's perspective: `execute_code` calls return successfully, but 1-2s later the workspace becomes unusable (Internal Error page).
|
||||||
The `execute_code` tool then stops working, but `cljs_repl` still works. Use it to detect a crash via `(some? (:exception @app.main.store/state))`.
|
The `execute_code` tool then stops working, but `cljs_repl` still works. Use it to detect a crash via `(some? (:exception @app.main.store/state))`.
|
||||||
For details on handling crashes, read memory `frontend/handling-crashes`.
|
For details on handling crashes, read memory `frontend/handling-crashes`.
|
||||||
|
|
||||||
|
|||||||
14
.serena/memories/frontend/navigation.md
Normal file
14
.serena/memories/frontend/navigation.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Navigating to a File in the Workspace
|
||||||
|
|
||||||
|
To programmatically open a file in the workspace, use `cljs_repl` with:
|
||||||
|
```clojure
|
||||||
|
(do (require '[app.main.data.common :as dcm])
|
||||||
|
(app.main.store/emit! (dcm/go-to-workspace
|
||||||
|
:team-id (parse-uuid "<team-id>")
|
||||||
|
:file-id (parse-uuid "<file-id>")
|
||||||
|
:page-id (parse-uuid "<page-id>"))))
|
||||||
|
```
|
||||||
|
**All three IDs are required.** You can get:
|
||||||
|
- `team-id` from `(:current-team-id @app.main.store/state)`
|
||||||
|
- `file-id` from the dashboard files: `(vals (:files @app.main.store/state))`
|
||||||
|
- `page-id` by fetching the file: `(get-in file-data [:data :pages])` via `(rp/cmd! :get-file {:id file-id :features (get @app.main.store/state :features)})`
|
||||||
Loading…
x
Reference in New Issue
Block a user