mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-15 04:19:08 +00:00
fix(ui): prevent usage indicator from covering sidebar items
This commit is contained in:
parent
aa49568059
commit
7a79b3e301
2 changed files with 9 additions and 2 deletions
|
|
@ -40,6 +40,14 @@ describe("UsageIndicator", () => {
|
|||
expect(screen.getByText("Usage")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("should not use fixed positioning that can cover sidebar items", async () => {
|
||||
render(<UsageIndicator accessToken="token" width={220} />);
|
||||
|
||||
const usageLabel = await screen.findByText("Usage");
|
||||
|
||||
expect(usageLabel.closest(".fixed")).toBeNull();
|
||||
});
|
||||
|
||||
it("should not show Near limit when users usage is below 80% (1/100 -> 1%)", async () => {
|
||||
render(<UsageIndicator accessToken="token" width={220} />);
|
||||
|
||||
|
|
|
|||
|
|
@ -687,9 +687,8 @@ export default function UsageIndicator({ accessToken, width = 220 }: UsageIndica
|
|||
return null;
|
||||
}
|
||||
|
||||
// Fixed positioning with proper spacing from edges
|
||||
return (
|
||||
<div className="fixed bottom-4 left-4 z-50" style={{ width: `${Math.min(width, 220)}px` }}>
|
||||
<div className="px-4 py-2" style={{ boxSizing: "border-box", width: `${Math.min(width, 220)}px` }}>
|
||||
<CardStyleView />
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue