Skip to content

fix(FR-750): improve resource slot display in SessionSlotCell component#3438

Merged
graphite-app[bot] merged 1 commit into
mainfrom
fix/session-slot-cell-format
Apr 2, 2025
Merged

fix(FR-750): improve resource slot display in SessionSlotCell component#3438
graphite-app[bot] merged 1 commit into
mainfrom
fix/session-slot-cell-format

Conversation

@yomybaby
Copy link
Copy Markdown
Member

@yomybaby yomybaby commented Apr 2, 2025

Resolves #3437 (FR-750)

Enhance Resource Slot Display in Session Slot Cell

This PR improves the display of resource slots in the SessionSlotCell component:

  1. Replaces deviceMetadata with mergedResourceSlots from the useResourceSlotsDetails hook
  2. Enhances memory display with fixed decimal precision (3 digits)
  3. Filters out accelerators with zero or invalid values
  4. Uses display_unit from resource slots data instead of human_readable_name
  5. Modifies the useResourceSlotsDetails hook to:
    • Accept empty resource group name to fetch all resource slots
    • Handle URL parameter construction more robustly
    • Return an empty object instead of undefined when manager version is incompatible

Before 1: New accelerator type and 0 accelerator type
image.png

After 1: New accelerator type and 0 accelerator type
image.png

Before 2:

image.png

After 2:

image.png

@github-actions github-actions Bot added the size:M 30~100 LoC label Apr 2, 2025
Copy link
Copy Markdown
Member Author

yomybaby commented Apr 2, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@yomybaby yomybaby changed the title fix: formatting of session slot c fix: improve resource slot display in SessionSlotCell component Apr 2, 2025
@yomybaby yomybaby changed the title fix: improve resource slot display in SessionSlotCell component fix(FR-750): improve resource slot display in SessionSlotCell component Apr 2, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2025

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements 4.32% 408/9446
🔴 Branches 3.69% 240/6512
🔴 Functions 2.62% 79/3016
🔴 Lines 4.26% 393/9235

Test suite run success

124 tests passing in 14 suites.

Report generated by 🧪jest coverage report action from b548693

@yomybaby yomybaby requested review from lizable and nowgnuesLee April 2, 2025 02:09
@yomybaby yomybaby marked this pull request as ready for review April 2, 2025 02:09
Copy link
Copy Markdown
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

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

LGTM

@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Apr 2, 2025

Merge activity

…nt (#3438)

Resolves #3437 (FR-750)

# Enhance Resource Slot Display in Session Slot Cell

This PR improves the display of resource slots in the SessionSlotCell component:

1. Replaces `deviceMetadata` with `mergedResourceSlots` from the `useResourceSlotsDetails` hook
2. Enhances memory display with fixed decimal precision (3 digits)
3. Filters out accelerators with zero or invalid values
4. Uses `display_unit` from resource slots data instead of `human_readable_name`
5. Modifies the `useResourceSlotsDetails` hook to:
   - Accept empty resource group name to fetch all resource slots
   - Handle URL parameter construction more robustly
   - Return an empty object instead of undefined when manager version is incompatible

Before 1: New accelerator type and 0 accelerator type
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/XqC2uNFuj0wg8I60sMUh/de7e2885-84c3-4a95-92db-b4f48ef4f10f.png)

After 1: New accelerator type and 0 accelerator type
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/XqC2uNFuj0wg8I60sMUh/79ab4346-73bd-471e-a7a0-8e3208665608.png)

Before 2:

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/XqC2uNFuj0wg8I60sMUh/6dbce4d2-a2cf-439e-a834-4970375cebe5.png)

After 2:

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/XqC2uNFuj0wg8I60sMUh/36cdf161-fb89-43d6-afbf-13586c97a745.png)
@graphite-app graphite-app Bot force-pushed the fix/session-slot-cell-format branch from ce2e8ff to b548693 Compare April 2, 2025 22:37
@graphite-app graphite-app Bot merged commit b548693 into main Apr 2, 2025
5 checks passed
@graphite-app graphite-app Bot deleted the fix/session-slot-cell-format branch April 2, 2025 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Formatting of resource slot cell in Session list

2 participants