feat(afc): Enhance Spoolman integration in AFC widgets#1860
Open
paxx12 wants to merge 3 commits into
Open
Conversation
Contributor
Author
|
@jimmyjon711 This is fully backward compatible. Modifies the code to provide consistency between Spoolman and AFC lane and avoids deducing the information. |
30a2491 to
ac58e15
Compare
Align AFC lane body with Spoolman data: use information from Spoolman
or directly from the AFC component instead of deducing values or
hardcoding defaults such as `initial_weight` of 1000.
Expand the spool reel tooltip to show ID, vendor, filament name,
material with extruder/bed temps, and remaining/used weight from
Spoolman when available.
Make the filament name row a clickable link to `/spool/show/{id}`
on the Spoolman UI when configured; falls back to plain text otherwise.
Add `initial_weight` and `filament_name` to `AfcLaneState` typings.
Signed-off-by: paxx12 <245230251+paxx12@users.noreply.github.com>
ac58e15 to
fbed6a9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Enhances the AFC lane UI to better reflect Spoolman (or AFC-provided) spool data, removing hard-coded assumptions (like a default initial_weight) and expanding the filament reel tooltip/details.
Changes:
- Extend
AfcLaneStatetyping withinitial_weightandfilament_nameto support richer AFC lane data. - Update AFC lane body display/tooltip to prefer Spoolman fields (vendor/material/temps/weights) and add an optional outbound link to the Spoolman UI.
- Remove the now-unused
app.afc.Unknownstring fromen.yaml.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| src/typings/klipper.d.ts | Adds initial_weight and filament_name to AFC lane typings for better spool calculations/display. |
| src/locales/en.yaml | Removes unused app.afc.Unknown translation key. |
| src/components/widgets/afc/AfcCardUnitLaneBody.vue | Updates lane UI/tooltip to use Spoolman/AFC data, adds optional Spoolman link, and adjusts weight/percent logic. |
- Add `rel="noopener noreferrer"` to external Spoolman link to prevent reverse-tabnabbing via `target="_blank"` - Keep `!this.spoolId` guard in `spoolUrl` — spool ID `0` is invalid in Spoolman so the falsy check is correct and consistent with `spool` getter - Replace hard-coded English strings in tooltip with i18n keys (`app.afc.WeightRemaining`, `app.afc.WeightUsed`); fix `spoolUsedWeight` guard from truthy to `!= null` so `0 g used` is displayed correctly Signed-off-by: paxx12 <245230251+paxx12@users.noreply.github.com>
67d0dd2 to
b441fec
Compare
…aneBody` - Fix `v-if="spoolExtruderTemp"` / `v-if="spoolBedTemp"` to use `!= null` so `0°C` renders correctly instead of being hidden by falsy check - Show `--` when `spoolMaterial` is empty to match AFC UI conventions - Add hover/focus underline and `cursor: pointer` to `.filament-link` so the Spoolman link is discoverable and keyboard-accessible Signed-off-by: paxx12 <245230251+paxx12@users.noreply.github.com>
jimmyjon711
approved these changes
Jun 2, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Align AFC lane body with Spoolman data: use information from Spoolman or directly from the AFC component instead of deducing values or hardcoding defaults such as
initial_weightof 1000.Expand the spool reel tooltip to show ID, vendor, filament name, material with extruder/bed temps, and remaining/used weight from Spoolman when available.
Make the filament name row a clickable link to
/spool/show/{id}on the Spoolman UI when configured; falls back to plain text otherwise.Add
initial_weightandfilament_nametoAfcLaneStatetypings.Screenshots
1. No Spoolman, No Weight (
nullreturned byAFC_lane), No Filament Name2. No Spoolman, Weight (
Xreturned byAFC_lane), No Filament Name3. No Spoolman, Weight (
Xreturned byAFC_lane), Filament Name (new parameterfilament_namereturned byAFC_lane)Since the
AFC_lanedoes not returninitial_weight(previously it was always1000) the spool percantage is 100%. OnceAFC_lanewould return this value, the spool percentage will be calculated accordingly.4. Spoolman, all information available
The
Filament Nameis clickable and redirects to Spoolman UI.5. Spoolman, all information available, extended tooltip
Next steps
Once approved and validated will open another one to Mainsail to align implementation.