Skip to content

Commit 7b2b6d1

Browse files
authored
Teach the shipped skills about the lexxy field (AVO-1236) (#4700)
* Add :lexxy to the gem-gated field types in the avo-fields skill (AVO-1236) * Teach the media-library skill about the lexxy editor (AVO-1236)
1 parent 75bff02 commit 7b2b6d1

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

lib/avo/skills/avo-fields/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ end
194194

195195
- **Gem-gated types break without their companion gem** (the field silently fails to render or raises). If the user asks for one, tell them to add the gem:
196196
- `:rhino``gem "avo-rhino_field"`
197+
- `:lexxy``gem "avo-lexxy_field"` (Basecamp's Lexxy editor for Action Text; needs Rails >= 8.0.2)
197198
- `:markdown``gem "marksmith"` + `gem "commonmarker"`
198199
- `:money``gem "avo-money_field"` + `gem "money-rails", "~> 1.12"` (and `monetize :price_cents` on the model)
199200
- `:location` / `:area``gem "mapkick-rb"` (**not** `mapkick`) + `MAPBOX_ACCESS_TOKEN` env var

lib/avo/skills/avo-media-library/SKILL.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: avo-media-library
3-
description: Turn on and manage Avo's Media Library — a central browser/manager for every uploaded asset, plus an asset picker inside the trix, rhino, and markdown rich-text editors — configured in config/initializers/avo.rb. Use when the user wants to "let users upload and manage images", "have one place to view and manage all our assets/uploads", "add an image or asset gallery to the admin", "insert/pick an existing image in the rich-text editor while writing content", "reuse uploaded images across records", "a digital asset manager for the admin", or "browse all the files I've uploaded" — and when they want to turn the Media Library on or off, hide or conditionally show its sidebar item, re-add it to a customized menu, or disable the gallery picker on a markdown field. Disabled by default and gated behind `defined?(Avo::MediaLibrary)`; Community license; currently in Alpha (breaking changes expected).
3+
description: Turn on and manage Avo's Media Library — a central browser/manager for every uploaded asset, plus an asset picker inside the trix, rhino, markdown, and lexxy rich-text editors — configured in config/initializers/avo.rb. Use when the user wants to "let users upload and manage images", "have one place to view and manage all our assets/uploads", "add an image or asset gallery to the admin", "insert/pick an existing image in the rich-text editor while writing content", "reuse uploaded images across records", "a digital asset manager for the admin", or "browse all the files I've uploaded" — and when they want to turn the Media Library on or off, hide or conditionally show its sidebar item, re-add it to a customized menu, or disable the gallery picker on a markdown field. Disabled by default and gated behind `defined?(Avo::MediaLibrary)`; Community license; currently in Alpha (breaking changes expected).
44
allowed-tools: Read, Edit, Write, Glob, Grep, Bash, WebFetch
55
metadata:
66
requires-gem: none — Community (Alpha)
@@ -10,14 +10,14 @@ metadata:
1010
1111
# Enable and manage the Avo Media Library
1212

13-
The Media Library is a central place to browse and manage every asset uploaded to an Avo admin, and it doubles as an asset picker inside Avo's three rich-text editors (`trix`, `rhino`, `markdown`) — a button in each editor opens a modal, and the selected asset is injected into the content. It is **not a separate gem**: it ships inside Avo, gated behind `defined?(Avo::MediaLibrary)`, and is **disabled by default**. All configuration lives in `config/initializers/avo.rb`.
13+
The Media Library is a central place to browse and manage every asset uploaded to an Avo admin, and it doubles as an asset picker inside Avo's rich-text editors (`trix`, `rhino`, `markdown`, `lexxy`) — a button in each editor opens a modal, and the selected asset is injected into the content. It is **not a separate gem**: it ships inside Avo, gated behind `defined?(Avo::MediaLibrary)`, and is **disabled by default**. All configuration lives in `config/initializers/avo.rb`.
1414

1515
**License:** Community (free). **Status:** Alpha — future releases may contain breaking changes, so tell the user this and point them at the upgrade guide when they adopt it.
1616

1717
**Docs** (fetch on demand — do not rely on memory for exact option names or defaults):
1818
- Docs map / index: https://docs.avohq.io/4.0/docs-map.md
1919
- Media Library guide: https://docs.avohq.io/4.0/media-library.md
20-
- Rich-text fields it plugs into: https://docs.avohq.io/4.0/fields/trix.md · https://docs.avohq.io/4.0/fields/rhino.md · https://docs.avohq.io/4.0/fields/markdown.md
20+
- Rich-text fields it plugs into: https://docs.avohq.io/4.0/fields/trix.md · https://docs.avohq.io/4.0/fields/rhino.md · https://docs.avohq.io/4.0/fields/markdown.md · https://docs.avohq.io/4.0/fields/lexxy.md
2121
- Menu editor (for re-adding the item): https://docs.avohq.io/4.0/menu-editor.md
2222
- Blocks / `Avo::Current` in config lambdas: https://docs.avohq.io/4.0/execution-context.md
2323

@@ -26,7 +26,7 @@ The Media Library is a central place to browse and manage every asset uploaded t
2626
Reach for this skill when the goal is either of the Media Library's two jobs:
2727

2828
1. **A central asset manager** — one screen to browse and manage all uploaded assets ("a gallery in the admin", "a digital asset manager", "see every file we've uploaded", "reuse images across records").
29-
2. **An asset picker in the editors** — inserting or reusing an existing image while writing rich-text content in a `trix`, `rhino`, or `markdown` field.
29+
2. **An asset picker in the editors** — inserting or reusing an existing image while writing rich-text content in a `trix`, `rhino`, `markdown`, or `lexxy` field.
3030

3131
Also use it for the on/off and visibility controls: enabling/disabling the whole feature, hiding or conditionally showing its sidebar item, re-adding it after the menu is customized, and toggling the picker off on a single markdown field.
3232

@@ -86,18 +86,19 @@ end
8686
end
8787
```
8888
89-
5. **Use it with the editors.** Once enabled, every `trix`, `rhino`, and `markdown` field automatically gets a Media Library button in its toolbar — no per-field opt-in. Just declare the field as usual (this is **avo-fields** territory):
89+
5. **Use it with the editors.** Once enabled, every `trix`, `rhino`, `markdown`, and `lexxy` field automatically gets a Media Library button in its toolbar — no per-field opt-in. Just declare the field as usual (this is **avo-fields** territory):
9090
```ruby
9191
field :body, as: :trix
9292
field :body, as: :rhino
9393
field :body, as: :markdown
94+
field :body, as: :lexxy
9495
```
9596
9697
6. **Disable the picker on a single markdown field (optional).** The `markdown` field accepts a `media_library` option (defaults to `true`). Set it to `false` to hide the gallery button on that one field while the Media Library stays enabled everywhere else:
9798
```ruby
9899
field :body, as: :markdown, media_library: false
99100
```
100-
This is **markdown-only** — `trix` and `rhino` have no per-field toggle. To remove the picker from those, the only lever is the global killswitch.
101+
This is **markdown-only** — `trix` and `rhino` have no per-field toggle. To remove the picker from those, the only lever is the global killswitch. The `lexxy` field hides its button when attachments are disabled (`attachments_disabled: true`, the default on plain columns).
101102
102103
7. **Report** what you changed (see below). No need to run the app; a `ruby -c` on the initializer is enough to sanity-check syntax.
103104
@@ -108,7 +109,7 @@ end
108109
- **`config.enabled` is an all-or-nothing killswitch.** Flipping it off hides the menu item, blocks the routes, *and* hides the editor icons — for everyone. There is no per-user or per-resource enable; use `config.visible` (a block) if you only want to gate who *sees the menu item*.
109110
- **`enabled` and `visible` are different levers.** `enabled` = whole feature on/off. `visible` = just the sidebar item (Boolean or block). Hiding the item with `visible = false` does not disable uploads or the editor picker.
110111
- **A customized menu drops the item.** If `config.main_menu` is defined, the Media Library sidebar item won't appear on its own — re-add it manually with `link_to "Media Library", avo.media_library_index_path`.
111-
- **`media_library: false` is markdown-only.** `trix` and `rhino` don't support per-field toggling; the killswitch is the only way to remove their buttons.
112+
- **`media_library: false` is markdown-only.** `trix` and `rhino` don't support per-field toggling; the killswitch is the only way to remove their buttons. `lexxy` follows its own `attachments_disabled` option.
112113
- **It's `Avo::MediaLibrary.configure`, not `Avo.configure`.** The enable/visible settings live on their own configuration object. Only the menu `link_to` goes inside the main `Avo.configure` block.
113114
114115
## Report

0 commit comments

Comments
 (0)