Skip to content

Give IconLibrary a name, and the server a way to report it (#111) - #113

Merged
ctgnz merged 1 commit into
masterfrom
feat/111-icon-library-name
Sep 26, 2026
Merged

ctgnz merged 1 commit into
masterfrom
feat/111-icon-library-name

Conversation

@ctgnz

@ctgnz ctgnz commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Closes #111.

Since #93 the server names no library — it runs against whichever one is on its classpath, which is what lets one build serve any of them. That left nothing able to say which one it actually got. With an instance per library planned, each on its own subdomain (#93, #112), "which library is this one running" needs to be answerable from outside rather than inferred from which symbol sets happen to turn up in a listing.

What's here

  • IconLibrary.getName() — declared on the interface. Returns the library's own name: Standard, Hallux, BattleOrder.
  • IconLibrary.ftl — emits it from the libraryPrefix the library was generated with, which is what names the class too, so a new library gets a correct name for free rather than having one to remember to set.
  • /info/library on IconGeneratorController, returning a new LibrarySummary record — the name plus the symbol set count.
  • DynamicIconLibrary (editor) and the test fixture answer Dynamic and Fake.

Deliberately not getVersion(). getVersions() already means something else on this interface — an APP-6 edition, SIDC positions 1–2 — and the singular/plural pair would read as one concept split in two. Noted in the javadoc so it doesn't get "tidied" later.

Verification

Both generated libraries were regenerated rather than hand-patched (per CLAUDE.md). git diff confirmed the only change in either was the new method, returning "Standard" and "Hallux" respectively.

Against the packaged server:

$ curl http://localhost:8081/info/library
{"name":"Standard","symbolSets":23}

mvn verify green across all seven modules — 84 tests, Spotless clean, both fragment checks clean (6,258 fragments, 0 off the shape).

🤖 Generated with Claude Code

Since #93 the server names no library: it runs against whichever one is
on its classpath, which is what lets one build serve Standard, Hallux or
BattleOrder. That left nothing able to say which one it got. With an
instance per library planned, each on its own subdomain, "which library
is this" has to be answerable from outside rather than inferred from
which symbol sets happen to turn up in a listing.

So IconLibrary declares getName(), the generator's template emits it
from the library prefix it was generated with, and a new /info/library
endpoint returns it alongside the symbol set count.

Deliberately not getVersion(): getVersions() already means something
else on this interface - an APP-6 edition, SIDC positions 1-2 - and the
two would read as a pair.

The generated libraries were regenerated rather than hand-patched; the
only change in either was the new method.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ctgnz
ctgnz merged commit ada56eb into master Sep 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An IconLibrary cannot say which library it is

1 participant