Skip to content

feat(afc): Enhance Spoolman integration in AFC widgets#1860

Open
paxx12 wants to merge 3 commits into
fluidd-core:developfrom
paxx12:feat/afc-spoolman-lane-details
Open

feat(afc): Enhance Spoolman integration in AFC widgets#1860
paxx12 wants to merge 3 commits into
fluidd-core:developfrom
paxx12:feat/afc-spoolman-lane-details

Conversation

@paxx12
Copy link
Copy Markdown
Contributor

@paxx12 paxx12 commented Jun 1, 2026

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.

Screenshots

1. No Spoolman, No Weight (null returned by AFC_lane), No Filament Name

1_basic_no_weight

2. No Spoolman, Weight (X returned by AFC_lane), No Filament Name

2_basic_weight

3. No Spoolman, Weight (X returned by AFC_lane), Filament Name (new parameter filament_name returned by AFC_lane)

Since the AFC_lane does not return initial_weight (previously it was always 1000) the spool percantage is 100%. Once AFC_lane would return this value, the spool percentage will be calculated accordingly.

3_basic_name

4. Spoolman, all information available

The Filament Name is clickable and redirects to Spoolman UI.

4_spoolman_full

5. Spoolman, all information available, extended tooltip

4_spoolman_tooltip

Next steps

Once approved and validated will open another one to Mainsail to align implementation.

@paxx12
Copy link
Copy Markdown
Contributor Author

paxx12 commented Jun 1, 2026

@jimmyjon711 This is fully backward compatible. Modifies the code to provide consistency between Spoolman and AFC lane and avoids deducing the information.

@paxx12 paxx12 force-pushed the feat/afc-spoolman-lane-details branch 4 times, most recently from 30a2491 to ac58e15 Compare June 1, 2026 08:36
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>
@paxx12 paxx12 force-pushed the feat/afc-spoolman-lane-details branch from ac58e15 to fbed6a9 Compare June 1, 2026 08:40
@paxx12 paxx12 changed the title Improve Spoolman integration in AFC lane components feat(afc): Enhance Spoolman integration in AFC widgets Jun 1, 2026
@pedrolamas pedrolamas requested a review from Copilot June 1, 2026 09:58
@pedrolamas pedrolamas added the FR - Enhancement New feature or request label Jun 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AfcLaneState typing with initial_weight and filament_name to 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.Unknown string from en.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.

Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue
Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue
Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue Outdated
Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue
Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue
Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue Outdated
Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue
Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue Outdated
- 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>
@paxx12 paxx12 force-pushed the feat/afc-spoolman-lane-details branch from 67d0dd2 to b441fec Compare June 1, 2026 10:19
@pedrolamas pedrolamas requested a review from Copilot June 1, 2026 12:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 6 comments.

Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue Outdated
Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue Outdated
Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue
Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue Outdated
Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue Outdated
Comment thread src/components/widgets/afc/AfcCardUnitLaneBody.vue
…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>
Copy link
Copy Markdown
Contributor

@jimmyjon711 jimmyjon711 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, @paxx12 could you please add an issue to AFC so I don't forget to add the filament_name parameter.

@paxx12
Copy link
Copy Markdown
Contributor Author

paxx12 commented Jun 2, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FR - Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants