Skip to content

Add notes to hosts, instances, users and other resources - #1000

Open
bbassie wants to merge 2 commits into
clusterio:masterfrom
bbassie:feature/resource-notes
Open

bbassie wants to merge 2 commits into
clusterio:masterfrom
bbassie:feature/resource-notes

Conversation

@bbassie

@bbassie bbassie commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Implements #903, also covers #599.

Every resource can now carry a free text note that is visible to everyone with access to the resource. Notes live in a new notes.json datastore on the controller, keyed by resource type and id (host/4, user/player, mod/name_1.0.0, save/4/world.zip). I went with a separate store instead of a field on each data class because mods and saves are not controller records, and it lets plugins attach notes to their own resource types with no core changes.

What is in here:

  • Note data class, NoteListRequest, NoteSetRequest and NoteUpdatesEvent, with core.note.list, core.note.subscribe (both granted by default) and core.note.update permissions. Setting an empty note deletes it. Notes record who last edited them.
  • Deleting an instance, user, role, mod pack or mod removes its note. Saves are not cleaned up since they are only mirrored from the host, so a note survives a save being re-uploaded.
  • Web UI: a ResourceNotes component (exported for plugins) with an inline textarea editor, shown as a section on the host, instance, user, role and mod pack pages, and in compact form inside mod details and the expanded row of the saves list. Ctrl+Enter saves, Escape cancels, and edits from other clients show up live through the subscription.
  • ctl: note list [--type], note get, note set and note delete, documented in managing-a-cluster.md.

Tested with new unit tests for the data class, the request handlers and the cleanup on delete, plus a playwright click-through of the host, role and user pages (spec not committed since playwright is not a repo dependency).

Changelog

### Features
- Added notes that can be attached to hosts, instances, users, roles, mod packs, mods and saves in the web interface and through ctl. #903

🤖 Generated with Claude Code

Free text notes can be attached to any resource in the cluster. They are
stored on the controller in a notes datastore keyed by resource type and
id, so mods and saves that are not records on the controller can carry
notes too, and plugins can use their own resource types.

Adds Note data class, NoteListRequest, NoteSetRequest and
NoteUpdatesEvent with core.note.list, core.note.subscribe and
core.note.update permissions. Setting an empty note removes it, and
deleting an instance, user, role, mod pack or mod removes its note.

The web interface gets a notes section on the host, instance, user, role
and mod pack pages, and a compact editor in mod details and the saves
list. ctl gets note list, get, set and delete commands.

Closes clusterio#903
Closes clusterio#599

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.31933% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.34%. Comparing base (7987a5d) to head (fff0a4a).
⚠️ Report is 43 commits behind head on master.

Files with missing lines Patch % Lines
packages/controller/src/Controller.ts 91.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1000      +/-   ##
==========================================
+ Coverage   81.20%   81.34%   +0.14%     
==========================================
  Files         140      143       +3     
  Lines       12879    12998     +119     
  Branches     2236     2252      +16     
==========================================
+ Hits        10458    10573     +115     
- Misses       2245     2248       +3     
- Partials      176      177       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Cooldude2606 Cooldude2606 added the Release: Next To complete for next release label Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Release: Next To complete for next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants