Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-usage-indicator-icons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@perstack/tui-components": patch
---

fix: correct context window usage pie chart icon thresholds to match visual representation
2 changes: 1 addition & 1 deletion packages/tui-components/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const KEY_BINDINGS = {

export const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"] as const

export const USAGE_INDICATORS = { LOW: "◔", MEDIUM: "◑", HIGH: "◕", FULL: "●" } as const
export const USAGE_INDICATORS = { EMPTY: "○", LOW: "◔", MEDIUM: "◑", HIGH: "◕", FULL: "●" } as const

export const KEY_HINTS = {
NAVIGATE: `${KEY_BINDINGS.NAVIGATE_UP}${KEY_BINDINGS.NAVIGATE_DOWN}:Navigate`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import { flattenTree } from "../hooks/use-delegation-tree.js"
import { useSpinner } from "../hooks/use-spinner.js"

function getUsageIcon(percent: number): string {
if (percent <= 25) return USAGE_INDICATORS.LOW
if (percent <= 50) return USAGE_INDICATORS.MEDIUM
if (percent <= 75) return USAGE_INDICATORS.HIGH
return USAGE_INDICATORS.FULL
if (percent >= 75) return USAGE_INDICATORS.FULL
if (percent >= 50) return USAGE_INDICATORS.HIGH
if (percent >= 25) return USAGE_INDICATORS.MEDIUM
if (percent >= 5) return USAGE_INDICATORS.LOW
return USAGE_INDICATORS.EMPTY
}

function buildPrefix(flatNode: FlatTreeNode): string {
Expand Down