mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-10-08 22:41:38 +00:00
🔧 chore: Update ESLint config, Import Sorting script, Test Sharding, Bump @librechat/agents (#13552)
* 🔧 chore: Update ESLint config, add import sorting script, Test Sharding, Bump `@librechat/agents`
* Change 'no-nested-ternary' rule from 'warn' to 'error' in ESLint config
* Add new scripts for sorting imports in the project
* Update lint-staged configuration to include import sorting
* Modify GitHub Actions workflows to support sharding for unit tests
* chore: remove nested ternary expressions
* refactor: Extract scale multiplier logic into a separate function in CircleRender component
* refactor: Simplify auto-refill rendering logic in Balance component for better readability
* refactor: Improve width style handling in DataTable components for clarity and maintainability
* chore: remove CircleRender component
* delete: Remove CircleRender component as it is no longer needed in the project
* chore: Bump @librechat/agents to version 3.2.31 and update Node.js engine requirement
* Update @librechat/agents dependency from 3.2.2 to 3.2.31 in package-lock.json, api/package.json, and packages/api/package.json
* Change Node.js engine requirement from >=20.0.0 to >=24.0.0 in @librechat/agents
* chore: Add import sorting check to ESLint CI workflow
* Implement a new job in the GitHub Actions workflow to verify import ordering on changed files.
* The job checks for changes in specific file types and reports any import order drift, providing instructions for local fixes.
This commit is contained in:
parent
21607ba3d7
commit
bfb6b224d2
16 changed files with 396 additions and 114 deletions
|
|
@ -1,36 +0,0 @@
|
|||
import React from 'react';
|
||||
import { ECallState } from 'librechat-data-provider';
|
||||
import { CircleIcon, CircleDotsIcon } from '@librechat/client';
|
||||
|
||||
const CircleRender = ({ rmsLevel, isCameraOn, state }) => {
|
||||
const getIconComponent = (state) => {
|
||||
switch (state) {
|
||||
case ECallState.Thinking:
|
||||
return <CircleDotsIcon />;
|
||||
default:
|
||||
return (
|
||||
<div className="smooth-transition" style={{ transform: `scale(${transformScale})` }}>
|
||||
<CircleIcon state={state} size="256" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const baseScale = isCameraOn ? 0.5 : 1;
|
||||
const scaleMultiplier =
|
||||
rmsLevel > 0.08
|
||||
? 1.8
|
||||
: rmsLevel > 0.07
|
||||
? 1.6
|
||||
: rmsLevel > 0.05
|
||||
? 1.4
|
||||
: rmsLevel > 0.01
|
||||
? 1.2
|
||||
: 1;
|
||||
|
||||
const transformScale = baseScale * scaleMultiplier;
|
||||
|
||||
return getIconComponent(state);
|
||||
};
|
||||
|
||||
export default CircleRender;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import React from 'react';
|
||||
import { useGetStartupConfig, useGetUserBalance } from '~/data-provider';
|
||||
import { useAuthContext, useLocalize } from '~/hooks';
|
||||
import TokenCreditsItem from './TokenCreditsItem';
|
||||
import AutoRefillSettings from './AutoRefillSettings';
|
||||
import TokenCreditsItem from './TokenCreditsItem';
|
||||
|
||||
function Balance() {
|
||||
const localize = useLocalize();
|
||||
|
|
@ -31,30 +31,36 @@ function Balance() {
|
|||
refillIntervalUnit !== undefined &&
|
||||
refillIntervalValue !== undefined;
|
||||
|
||||
const renderAutoRefill = () => {
|
||||
if (!autoRefillEnabled) {
|
||||
return (
|
||||
<div className="text-sm text-gray-600">
|
||||
{localize('com_nav_balance_auto_refill_disabled')}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (!hasValidRefillSettings) {
|
||||
return (
|
||||
<div className="text-sm text-red-600">{localize('com_nav_balance_auto_refill_error')}</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<AutoRefillSettings
|
||||
lastRefill={lastRefill}
|
||||
refillAmount={refillAmount}
|
||||
refillIntervalUnit={refillIntervalUnit}
|
||||
refillIntervalValue={refillIntervalValue}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-4 p-4 text-sm text-text-primary">
|
||||
{/* Token credits display */}
|
||||
<TokenCreditsItem tokenCredits={tokenCredits} />
|
||||
|
||||
{/* Auto-refill display */}
|
||||
{autoRefillEnabled ? (
|
||||
hasValidRefillSettings ? (
|
||||
<AutoRefillSettings
|
||||
lastRefill={lastRefill}
|
||||
refillAmount={refillAmount}
|
||||
refillIntervalUnit={refillIntervalUnit}
|
||||
refillIntervalValue={refillIntervalValue}
|
||||
/>
|
||||
) : (
|
||||
<div className="text-sm text-red-600">
|
||||
{localize('com_nav_balance_auto_refill_error')}
|
||||
</div>
|
||||
)
|
||||
) : (
|
||||
<div className="text-sm text-gray-600">
|
||||
{localize('com_nav_balance_auto_refill_disabled')}
|
||||
</div>
|
||||
)}
|
||||
{renderAutoRefill()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue