Improve dashboard charts, category tree selects, and product AI name fill.

Fix RTL chart ordering with Y-axis and hover values; aggregate website views; refine category picker tree borders and spacing; add one-click FA→EN name translation on add product.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-28 20:39:43 +03:30
co-authored by Cursor
parent 7b2ed7c7b0
commit a412cb82fc
31 changed files with 1222 additions and 226 deletions
+17
View File
@@ -0,0 +1,17 @@
/** Nice Y-axis ticks from 0 through a ceiling of `max`. */
export function buildYAxisTicks(max: number, segments = 4): number[] {
if (max <= 0) return [0, 1]
const step = Math.max(1, Math.ceil(max / segments))
const top = Math.ceil(max / step) * step
const ticks: number[] = []
for (let value = 0; value <= top; value += step) {
ticks.push(value)
}
return ticks
}
export function formatChartCount(value: number, locale: string): string {
return value.toLocaleString(locale === 'fa' ? 'fa-IR' : 'en-US', {
numberingSystem: 'latn',
})
}