From 7b7a82f191ea99884c591ed17ec9747197647817 Mon Sep 17 00:00:00 2001 From: somebody1234 Date: Thu, 9 Jan 2025 23:21:20 +1000 Subject: [PATCH 1/9] Respect number order when sorting assets by title --- app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx b/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx index 7dad7f7826b9..79f920350981 100644 --- a/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx +++ b/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx @@ -218,7 +218,8 @@ export function useAssetsTableItems(options: UseAssetsTableOptions) { let compare: (a: AnyAssetTreeNode, b: AnyAssetTreeNode) => number switch (sortInfo.field) { case Column.name: { - compare = (a, b) => multiplier * a.item.title.localeCompare(b.item.title, 'en') + compare = (a, b) => + multiplier * a.item.title.localeCompare(b.item.title, 'en', { numeric: true }) break } case Column.modified: { From 34a4cfe0d6be8b5fd248ee4ae69ab2f8184c3ff7 Mon Sep 17 00:00:00 2001 From: somebody1234 Date: Thu, 9 Jan 2025 23:25:03 +1000 Subject: [PATCH 2/9] Use user's preferred locale --- .../src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx b/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx index 79f920350981..5e21fc467d18 100644 --- a/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx +++ b/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx @@ -5,6 +5,7 @@ import type { AnyAsset, AssetId } from 'enso-common/src/services/Backend' import { AssetType, getAssetPermissionName } from 'enso-common/src/services/Backend' import { PermissionAction } from 'enso-common/src/utilities/permissions' +import { useLocale } from '#/components/aria' import type { SortableColumn } from '#/components/dashboard/column/columnUtils' import { Column } from '#/components/dashboard/column/columnUtils' import type { DirectoryId } from '#/services/ProjectManager' @@ -63,6 +64,7 @@ export function useAssetStrict(id: AssetId) { export function useAssetsTableItems(options: UseAssetsTableOptions) { const { assetTree, sortInfo, query, expandedDirectoryIds } = options + const locale = useLocale() const setAssetItems = useStore(ASSET_ITEMS_STORE, (store) => store.setItems) const filter = useMemo(() => { @@ -219,7 +221,7 @@ export function useAssetsTableItems(options: UseAssetsTableOptions) { switch (sortInfo.field) { case Column.name: { compare = (a, b) => - multiplier * a.item.title.localeCompare(b.item.title, 'en', { numeric: true }) + multiplier * a.item.title.localeCompare(b.item.title, locale.locale, { numeric: true }) break } case Column.modified: { @@ -239,7 +241,7 @@ export function useAssetsTableItems(options: UseAssetsTableOptions) { return flatTree } - }, [sortInfo, assetTree, expandedDirectoryIds]) + }, [sortInfo, assetTree, expandedDirectoryIds, locale.locale]) setAssetItems(displayItems.map((item) => item.item)) From 952437bb5f7acc2234c86a232093858a6658135e Mon Sep 17 00:00:00 2001 From: somebody1234 Date: Thu, 9 Jan 2025 23:28:31 +1000 Subject: [PATCH 3/9] Use locale from correct hook --- .../src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx b/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx index 5e21fc467d18..c102d01d71b7 100644 --- a/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx +++ b/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx @@ -5,9 +5,9 @@ import type { AnyAsset, AssetId } from 'enso-common/src/services/Backend' import { AssetType, getAssetPermissionName } from 'enso-common/src/services/Backend' import { PermissionAction } from 'enso-common/src/utilities/permissions' -import { useLocale } from '#/components/aria' import type { SortableColumn } from '#/components/dashboard/column/columnUtils' import { Column } from '#/components/dashboard/column/columnUtils' +import { useText } from '#/providers/TextProvider' import type { DirectoryId } from '#/services/ProjectManager' import type AssetQuery from '#/utilities/AssetQuery' import type { AnyAssetTreeNode } from '#/utilities/AssetTreeNode' @@ -64,7 +64,7 @@ export function useAssetStrict(id: AssetId) { export function useAssetsTableItems(options: UseAssetsTableOptions) { const { assetTree, sortInfo, query, expandedDirectoryIds } = options - const locale = useLocale() + const { locale } = useText() const setAssetItems = useStore(ASSET_ITEMS_STORE, (store) => store.setItems) const filter = useMemo(() => { @@ -221,7 +221,7 @@ export function useAssetsTableItems(options: UseAssetsTableOptions) { switch (sortInfo.field) { case Column.name: { compare = (a, b) => - multiplier * a.item.title.localeCompare(b.item.title, locale.locale, { numeric: true }) + multiplier * a.item.title.localeCompare(b.item.title, locale, { numeric: true }) break } case Column.modified: { @@ -241,7 +241,7 @@ export function useAssetsTableItems(options: UseAssetsTableOptions) { return flatTree } - }, [sortInfo, assetTree, expandedDirectoryIds, locale.locale]) + }, [sortInfo, assetTree, expandedDirectoryIds, locale]) setAssetItems(displayItems.map((item) => item.item)) From 0f9356b274dfe6eb6b9041978a4fa5e4c5c661c0 Mon Sep 17 00:00:00 2001 From: somebody1234 Date: Thu, 9 Jan 2025 23:38:10 +1000 Subject: [PATCH 4/9] Rename non-TSX files to `.ts` --- .../layouts/Drive/{assetTreeHooks.tsx => assetTreeHooks.ts} | 0 .../Drive/{assetsTableItemsHooks.tsx => assetsTableItemsHooks.ts} | 0 .../layouts/Drive/{directoryIdsHooks.tsx => directoryIdsHooks.ts} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename app/gui/src/dashboard/layouts/Drive/{assetTreeHooks.tsx => assetTreeHooks.ts} (100%) rename app/gui/src/dashboard/layouts/Drive/{assetsTableItemsHooks.tsx => assetsTableItemsHooks.ts} (100%) rename app/gui/src/dashboard/layouts/Drive/{directoryIdsHooks.tsx => directoryIdsHooks.ts} (100%) diff --git a/app/gui/src/dashboard/layouts/Drive/assetTreeHooks.tsx b/app/gui/src/dashboard/layouts/Drive/assetTreeHooks.ts similarity index 100% rename from app/gui/src/dashboard/layouts/Drive/assetTreeHooks.tsx rename to app/gui/src/dashboard/layouts/Drive/assetTreeHooks.ts diff --git a/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx b/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.ts similarity index 100% rename from app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.tsx rename to app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.ts diff --git a/app/gui/src/dashboard/layouts/Drive/directoryIdsHooks.tsx b/app/gui/src/dashboard/layouts/Drive/directoryIdsHooks.ts similarity index 100% rename from app/gui/src/dashboard/layouts/Drive/directoryIdsHooks.tsx rename to app/gui/src/dashboard/layouts/Drive/directoryIdsHooks.ts From 7c5090d7b637dec2b03e40e036845c5091a8c031 Mon Sep 17 00:00:00 2001 From: somebody1234 Date: Thu, 9 Jan 2025 23:47:43 +1000 Subject: [PATCH 5/9] Extract `assetCompareFunction` to new function --- .../layouts/Drive/assetsTableItemsHooks.ts | 21 ++------------ .../dashboard/layouts/Drive/compareAssets.ts | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 19 deletions(-) create mode 100644 app/gui/src/dashboard/layouts/Drive/compareAssets.ts diff --git a/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.ts b/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.ts index c102d01d71b7..e1b7080ffd33 100644 --- a/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.ts +++ b/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.ts @@ -6,7 +6,7 @@ import { AssetType, getAssetPermissionName } from 'enso-common/src/services/Back import { PermissionAction } from 'enso-common/src/utilities/permissions' import type { SortableColumn } from '#/components/dashboard/column/columnUtils' -import { Column } from '#/components/dashboard/column/columnUtils' +import { assetCompareFunction } from '#/layouts/Drive/compareAssets' import { useText } from '#/providers/TextProvider' import type { DirectoryId } from '#/services/ProjectManager' import type AssetQuery from '#/utilities/AssetQuery' @@ -14,7 +14,6 @@ import type { AnyAssetTreeNode } from '#/utilities/AssetTreeNode' import Visibility from '#/utilities/Visibility' import { fileExtension } from '#/utilities/fileInfo' import type { SortInfo } from '#/utilities/sorting' -import { SortDirection } from '#/utilities/sorting' import { regexEscape } from '#/utilities/string' import { createStore, useStore } from '#/utilities/zustand.ts' import invariant from 'tiny-invariant' @@ -216,23 +215,7 @@ export function useAssetsTableItems(options: UseAssetsTableOptions) { return flatTree } else { - const multiplier = sortInfo.direction === SortDirection.ascending ? 1 : -1 - let compare: (a: AnyAssetTreeNode, b: AnyAssetTreeNode) => number - switch (sortInfo.field) { - case Column.name: { - compare = (a, b) => - multiplier * a.item.title.localeCompare(b.item.title, locale, { numeric: true }) - break - } - case Column.modified: { - compare = (a, b) => { - const aOrder = Number(new Date(a.item.modifiedAt)) - const bOrder = Number(new Date(b.item.modifiedAt)) - return multiplier * (aOrder - bOrder) - } - break - } - } + const compare = assetCompareFunction(sortInfo, locale) const flatTree = assetTree.preorderTraversal((tree) => [...tree] .filter((child) => expandedDirectoryIds.includes(child.item.parentId)) diff --git a/app/gui/src/dashboard/layouts/Drive/compareAssets.ts b/app/gui/src/dashboard/layouts/Drive/compareAssets.ts new file mode 100644 index 000000000000..1e31aff2f3ad --- /dev/null +++ b/app/gui/src/dashboard/layouts/Drive/compareAssets.ts @@ -0,0 +1,29 @@ +/** @file Functions related to comparing assets. */ +import { Column, type SortableColumn } from '#/components/dashboard/column/columnUtils' +import type { AnyAssetTreeNode } from '#/utilities/AssetTreeNode' +import { SortDirection, type SortInfo } from '#/utilities/sorting' + +/** Return a function to compare two assets. */ +export function assetCompareFunction( + sortInfo: SortInfo, + locale: string | undefined, +) { + const multiplier = sortInfo.direction === SortDirection.ascending ? 1 : -1 + let compare: (a: AnyAssetTreeNode, b: AnyAssetTreeNode) => number + switch (sortInfo.field) { + case Column.name: { + compare = (a, b) => + multiplier * a.item.title.localeCompare(b.item.title, locale, { numeric: true }) + break + } + case Column.modified: { + compare = (a, b) => { + const aOrder = Number(new Date(a.item.modifiedAt)) + const bOrder = Number(new Date(b.item.modifiedAt)) + return multiplier * (aOrder - bOrder) + } + break + } + } + return compare +} From efcf1148ea4644a459bb77b832a27ea8267f04d9 Mon Sep 17 00:00:00 2001 From: somebody1234 Date: Fri, 10 Jan 2025 18:00:49 +1000 Subject: [PATCH 6/9] Add tests --- .../integration-test/dashboard/sort.spec.ts | 47 ++++++++-- .../Drive/__test__/compareAssets.test.ts | 94 +++++++++++++++++++ .../layouts/Drive/assetsTableItemsHooks.ts | 3 +- .../dashboard/layouts/Drive/compareAssets.ts | 11 +-- 4 files changed, 140 insertions(+), 15 deletions(-) create mode 100644 app/gui/src/dashboard/layouts/Drive/__test__/compareAssets.test.ts diff --git a/app/gui/integration-test/dashboard/sort.spec.ts b/app/gui/integration-test/dashboard/sort.spec.ts index 16483dcb6672..9e270a6a7aff 100644 --- a/app/gui/integration-test/dashboard/sort.spec.ts +++ b/app/gui/integration-test/dashboard/sort.spec.ts @@ -45,11 +45,17 @@ test('sort', ({ page }) => const date2 = toRfc3339(new Date(START_DATE_EPOCH_MS + 1 * MIN_MS)) const date3 = toRfc3339(new Date(START_DATE_EPOCH_MS + 2 * MIN_MS)) const date4 = toRfc3339(new Date(START_DATE_EPOCH_MS + 3 * MIN_MS)) + const date4a = toRfc3339(new Date(START_DATE_EPOCH_MS + 3 * MIN_MS + 1)) + const date4b = toRfc3339(new Date(START_DATE_EPOCH_MS + 3 * MIN_MS + 2)) const date5 = toRfc3339(new Date(START_DATE_EPOCH_MS + 4 * MIN_MS)) + const date5a = toRfc3339(new Date(START_DATE_EPOCH_MS + 3 * MIN_MS + 3)) const date6 = toRfc3339(new Date(START_DATE_EPOCH_MS + 5 * MIN_MS)) const date7 = toRfc3339(new Date(START_DATE_EPOCH_MS + 6 * MIN_MS)) const date8 = toRfc3339(new Date(START_DATE_EPOCH_MS + 7 * MIN_MS)) - api.addDirectory({ modifiedAt: date4, title: 'a directory' }) + api.addDirectory({ modifiedAt: date4, title: 'a directory 1' }) + api.addDirectory({ modifiedAt: date4a, title: 'a directory 10' }) + api.addDirectory({ modifiedAt: date4b, title: 'a directory 2' }) + api.addDirectory({ modifiedAt: date5a, title: 'a directory 11' }) api.addDirectory({ modifiedAt: date6, title: 'G directory' }) api.addProject({ modifiedAt: date7, title: 'C project' }) api.addSecret({ modifiedAt: date2, title: 'H secret' }) @@ -61,8 +67,11 @@ test('sort', ({ page }) => // b project // h secret // f secret - // a directory + // a directory 1 + // a directory 10 + // a directory 2 // e file + // a directory 11 // g directory // c project // d file @@ -81,7 +90,10 @@ test('sort', ({ page }) => // Assets in each group are ordered by insertion order. await expect(rows).toHaveText([ /^G directory/, - /^a directory/, + /^a directory 11/, + /^a directory 2/, + /^a directory 10/, + /^a directory 1/, /^C project/, /^b project/, /^d file/, @@ -97,7 +109,10 @@ test('sort', ({ page }) => }) .driveTable.withRows(async (rows) => { await expect(rows).toHaveText([ - /^a directory/, + /^a directory 1/, + /^a directory 2/, + /^a directory 10/, + /^a directory 11/, /^b project/, /^C project/, /^d file/, @@ -121,7 +136,10 @@ test('sort', ({ page }) => /^d file/, /^C project/, /^b project/, - /^a directory/, + /^a directory 11/, + /^a directory 10/, + /^a directory 2/, + /^a directory 1/, ]) }) // Sorting should be unset. @@ -136,7 +154,10 @@ test('sort', ({ page }) => .driveTable.withRows(async (rows) => { await expect(rows).toHaveText([ /^G directory/, - /^a directory/, + /^a directory 11/, + /^a directory 2/, + /^a directory 10/, + /^a directory 1/, /^C project/, /^b project/, /^d file/, @@ -155,8 +176,11 @@ test('sort', ({ page }) => /^b project/, /^H secret/, /^f secret/, - /^a directory/, + /^a directory 1/, + /^a directory 10/, + /^a directory 2/, /^e file/, + /^a directory 11/, /^G directory/, /^C project/, /^d file/, @@ -172,8 +196,11 @@ test('sort', ({ page }) => /^d file/, /^C project/, /^G directory/, + /^a directory 11/, /^e file/, - /^a directory/, + /^a directory 2/, + /^a directory 10/, + /^a directory 1/, /^f secret/, /^H secret/, /^b project/, @@ -191,6 +218,10 @@ test('sort', ({ page }) => .driveTable.withRows(async (rows) => { await expect(rows).toHaveText([ /^G directory/, + /^a directory 11/, + /^a directory 2/, + /^a directory 10/, + /^a directory 1/, /^a directory/, /^C project/, /^b project/, diff --git a/app/gui/src/dashboard/layouts/Drive/__test__/compareAssets.test.ts b/app/gui/src/dashboard/layouts/Drive/__test__/compareAssets.test.ts new file mode 100644 index 000000000000..9936264643a2 --- /dev/null +++ b/app/gui/src/dashboard/layouts/Drive/__test__/compareAssets.test.ts @@ -0,0 +1,94 @@ +/** @file Tests for comparing assets. */ +import { Column, type SortableColumn } from '#/components/dashboard/column/columnUtils' +import { assetCompareFunction } from '#/layouts/Drive/compareAssets' +import { SortDirection, type SortInfo } from '#/utilities/sorting' +import * as fc from '@fast-check/vitest' +import { DirectoryId, createPlaceholderFileAsset } from 'enso-common/src/services/Backend' +import { toRfc3339 } from 'enso-common/src/utilities/data/dateTime' +import { merge } from 'enso-common/src/utilities/data/object' +import { expect } from 'vitest' + +const SORT_BY_NAME_ASCENDING: SortInfo = { + field: Column.name, + direction: SortDirection.ascending, +} + +const SORT_BY_NAME_DESCENDING: SortInfo = { + field: Column.name, + direction: SortDirection.descending, +} + +const SORT_BY_MODIFIED_ASCENDING: SortInfo = { + field: Column.modified, + direction: SortDirection.ascending, +} + +const SORT_BY_MODIFIED_DESCENDING: SortInfo = { + field: Column.modified, + direction: SortDirection.descending, +} + +fc.test.prop({ + prefix: fc.fc.string(), + numbers: fc.fc.array(fc.fc.integer({ min: 0 })), +})('numbers should be sorted with dictionary sort', ({ prefix, numbers }) => { + const names = numbers.map((number) => `${prefix} ${number}`) + const assets = names.map((name) => + createPlaceholderFileAsset(name, DirectoryId('directory-'), []), + ) + const compareByNameAscending = assetCompareFunction(SORT_BY_NAME_ASCENDING, 'en') + const sorted = assets.sort(compareByNameAscending) + const sortedNames = sorted.map((asset) => asset.title) + const expectedNames = numbers.sort((a, b) => a - b).map((number) => `${prefix} ${number}`) + expect(sortedNames).toStrictEqual(expectedNames) + + const compareByNameDescending = assetCompareFunction(SORT_BY_NAME_DESCENDING, 'en') + const sortedDescending = assets.sort(compareByNameDescending) + const sortedDescendingNames = sortedDescending.map((asset) => asset.title) + const expectedDescendingNames = numbers + .sort((a, b) => b - a) + .map((number) => `${prefix} ${number}`) + expect(sortedDescendingNames).toStrictEqual(expectedDescendingNames) +}) + +fc.test.prop({ + names: fc.fc.array(fc.fc.string().map((s) => s.replace(/\d+/g, ''))), +})('sort by name', ({ names }) => { + const assets = names.map((name) => + createPlaceholderFileAsset(name, DirectoryId('directory-'), []), + ) + + const compareByModifiedAscending = assetCompareFunction(SORT_BY_NAME_ASCENDING, 'en') + const sorted = assets.sort(compareByModifiedAscending) + const sortedNames = sorted.map((asset) => asset.title) + const expectedNames = names.sort((a, b) => a.localeCompare(b, 'en')) + expect(sortedNames).toStrictEqual(expectedNames) + + const compareByModifiedDescending = assetCompareFunction(SORT_BY_NAME_DESCENDING, 'en') + const sortedDescending = assets.sort(compareByModifiedDescending) + const sortedDescendingNames = sortedDescending.map((asset) => asset.title) + const expectedDescendingNames = names.sort((a, b) => -a.localeCompare(b, 'en')) + expect(sortedDescendingNames).toStrictEqual(expectedDescendingNames) +}) + +fc.test.prop({ + dates: fc.fc.array(fc.fc.integer({ min: 0 })).map((numbers) => numbers.map((n) => new Date(n))), +})('sort by modified', ({ dates }) => { + const assets = dates.map((date) => + merge(createPlaceholderFileAsset('', DirectoryId('directory-'), []), { + modifiedAt: toRfc3339(date), + }), + ) + + const compareByModifiedAscending = assetCompareFunction(SORT_BY_MODIFIED_ASCENDING, 'en') + const sorted = assets.sort(compareByModifiedAscending) + const sortedDates = sorted.map((asset) => new Date(asset.modifiedAt)) + const expectedDates = dates.sort((a, b) => Number(a) - Number(b)) + expect(sortedDates).toStrictEqual(expectedDates) + + const compareByModifiedDescending = assetCompareFunction(SORT_BY_MODIFIED_DESCENDING, 'en') + const sortedDescending = assets.sort(compareByModifiedDescending) + const sortedDescendingDates = sortedDescending.map((asset) => new Date(asset.modifiedAt)) + const expectedDescendingDates = dates.sort((a, b) => Number(b) - Number(a)) + expect(sortedDescendingDates).toStrictEqual(expectedDescendingDates) +}) diff --git a/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.ts b/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.ts index e1b7080ffd33..442184bb9b79 100644 --- a/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.ts +++ b/app/gui/src/dashboard/layouts/Drive/assetsTableItemsHooks.ts @@ -215,7 +215,8 @@ export function useAssetsTableItems(options: UseAssetsTableOptions) { return flatTree } else { - const compare = assetCompareFunction(sortInfo, locale) + const compareAssets = assetCompareFunction(sortInfo, locale) + const compare = (a: AnyAssetTreeNode, b: AnyAssetTreeNode) => compareAssets(a.item, b.item) const flatTree = assetTree.preorderTraversal((tree) => [...tree] .filter((child) => expandedDirectoryIds.includes(child.item.parentId)) diff --git a/app/gui/src/dashboard/layouts/Drive/compareAssets.ts b/app/gui/src/dashboard/layouts/Drive/compareAssets.ts index 1e31aff2f3ad..ec4ea3de7bb1 100644 --- a/app/gui/src/dashboard/layouts/Drive/compareAssets.ts +++ b/app/gui/src/dashboard/layouts/Drive/compareAssets.ts @@ -1,7 +1,7 @@ /** @file Functions related to comparing assets. */ import { Column, type SortableColumn } from '#/components/dashboard/column/columnUtils' -import type { AnyAssetTreeNode } from '#/utilities/AssetTreeNode' import { SortDirection, type SortInfo } from '#/utilities/sorting' +import type { AnyAsset } from 'enso-common/src/services/Backend' /** Return a function to compare two assets. */ export function assetCompareFunction( @@ -9,17 +9,16 @@ export function assetCompareFunction( locale: string | undefined, ) { const multiplier = sortInfo.direction === SortDirection.ascending ? 1 : -1 - let compare: (a: AnyAssetTreeNode, b: AnyAssetTreeNode) => number + let compare: (a: AnyAsset, b: AnyAsset) => number switch (sortInfo.field) { case Column.name: { - compare = (a, b) => - multiplier * a.item.title.localeCompare(b.item.title, locale, { numeric: true }) + compare = (a, b) => multiplier * a.title.localeCompare(b.title, locale, { numeric: true }) break } case Column.modified: { compare = (a, b) => { - const aOrder = Number(new Date(a.item.modifiedAt)) - const bOrder = Number(new Date(b.item.modifiedAt)) + const aOrder = Number(new Date(a.modifiedAt)) + const bOrder = Number(new Date(b.modifiedAt)) return multiplier * (aOrder - bOrder) } break From 6c8f4edd9ec6a6e19d5bdf73c1b875931fa388fa Mon Sep 17 00:00:00 2001 From: somebody1234 Date: Fri, 10 Jan 2025 18:25:35 +1000 Subject: [PATCH 7/9] Fix integration tests --- app/gui/integration-test/dashboard/sort.spec.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/gui/integration-test/dashboard/sort.spec.ts b/app/gui/integration-test/dashboard/sort.spec.ts index 9e270a6a7aff..c84711e904d9 100644 --- a/app/gui/integration-test/dashboard/sort.spec.ts +++ b/app/gui/integration-test/dashboard/sort.spec.ts @@ -48,7 +48,7 @@ test('sort', ({ page }) => const date4a = toRfc3339(new Date(START_DATE_EPOCH_MS + 3 * MIN_MS + 1)) const date4b = toRfc3339(new Date(START_DATE_EPOCH_MS + 3 * MIN_MS + 2)) const date5 = toRfc3339(new Date(START_DATE_EPOCH_MS + 4 * MIN_MS)) - const date5a = toRfc3339(new Date(START_DATE_EPOCH_MS + 3 * MIN_MS + 3)) + const date5a = toRfc3339(new Date(START_DATE_EPOCH_MS + 4 * MIN_MS + 1)) const date6 = toRfc3339(new Date(START_DATE_EPOCH_MS + 5 * MIN_MS)) const date7 = toRfc3339(new Date(START_DATE_EPOCH_MS + 6 * MIN_MS)) const date8 = toRfc3339(new Date(START_DATE_EPOCH_MS + 7 * MIN_MS)) @@ -222,7 +222,6 @@ test('sort', ({ page }) => /^a directory 2/, /^a directory 10/, /^a directory 1/, - /^a directory/, /^C project/, /^b project/, /^d file/, From 74d2968577dded63ae266b4a7841c7d51ef231e2 Mon Sep 17 00:00:00 2001 From: somebody1234 Date: Fri, 10 Jan 2025 18:30:47 +1000 Subject: [PATCH 8/9] Prettier --- .../src/project-view/assets/font-dejavu.css | 8 +-- .../project-view/assets/font-enso-naming.css | 36 +++++----- .../project-view/assets/font-enso-prose.css | 72 +++++++++---------- app/gui/src/project-view/assets/font-enso.css | 36 +++++----- .../src/project-view/assets/font-mplus1.css | 4 +- 5 files changed, 78 insertions(+), 78 deletions(-) diff --git a/app/gui/src/project-view/assets/font-dejavu.css b/app/gui/src/project-view/assets/font-dejavu.css index a4acbe007856..3d54feb70faf 100644 --- a/app/gui/src/project-view/assets/font-dejavu.css +++ b/app/gui/src/project-view/assets/font-dejavu.css @@ -1,11 +1,11 @@ @font-face { - font-family: 'DejaVu Sans Mono'; - src: url('/font-dejavu/DejaVuSansMono.ttf'); + font-family: "DejaVu Sans Mono"; + src: url("/font-dejavu/DejaVuSansMono.ttf"); font-weight: 400; } @font-face { - font-family: 'DejaVu Sans Mono'; - src: url('/font-dejavu/DejaVuSansMono-Bold.ttf'); + font-family: "DejaVu Sans Mono"; + src: url("/font-dejavu/DejaVuSansMono-Bold.ttf"); font-weight: 700; } diff --git a/app/gui/src/project-view/assets/font-enso-naming.css b/app/gui/src/project-view/assets/font-enso-naming.css index 0a1c7fc87221..7be53310799a 100644 --- a/app/gui/src/project-view/assets/font-enso-naming.css +++ b/app/gui/src/project-view/assets/font-enso-naming.css @@ -1,70 +1,70 @@ @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-Thin.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-Thin.woff2") format("woff2"); font-weight: 100; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-ExtraLight.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-ExtraLight.woff2") format("woff2"); font-weight: 200; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-Light.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-Regular.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-Medium.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-SemiBold.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-Bold.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-ExtraBold.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-Black.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-Black.woff2") format("woff2"); font-weight: 900; font-display: swap; unicode-range: U+0020, U+002D; diff --git a/app/gui/src/project-view/assets/font-enso-prose.css b/app/gui/src/project-view/assets/font-enso-prose.css index 3d6ab4fdbb47..8461ba375487 100644 --- a/app/gui/src/project-view/assets/font-enso-prose.css +++ b/app/gui/src/project-view/assets/font-enso-prose.css @@ -1,142 +1,142 @@ @font-face { - font-family: 'Enso Prose'; - src: url('/font-enso-prose/Enso-Prose-Thin.woff2') format('woff2'); + font-family: "Enso Prose"; + src: url("/font-enso-prose/Enso-Prose-Thin.woff2") format("woff2"); font-weight: 100; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: 'Enso Prose'; - src: url('/font-enso-prose/Enso-Prose-ExtraLight.woff2') format('woff2'); + font-family: "Enso Prose"; + src: url("/font-enso-prose/Enso-Prose-ExtraLight.woff2") format("woff2"); font-weight: 200; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: 'Enso Prose'; - src: url('/font-enso-prose/Enso-Prose-Light.woff2') format('woff2'); + font-family: "Enso Prose"; + src: url("/font-enso-prose/Enso-Prose-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: 'Enso Prose'; - src: url('/font-enso-prose/Enso-Prose-Regular.woff2') format('woff2'); + font-family: "Enso Prose"; + src: url("/font-enso-prose/Enso-Prose-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: 'Enso Prose'; - src: url('/font-enso-prose/Enso-Prose-Medium.woff2') format('woff2'); + font-family: "Enso Prose"; + src: url("/font-enso-prose/Enso-Prose-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: 'Enso Prose'; - src: url('/font-enso-prose/Enso-Prose-SemiBold.woff2') format('woff2'); + font-family: "Enso Prose"; + src: url("/font-enso-prose/Enso-Prose-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: 'Enso Prose'; - src: url('/font-enso-prose/Enso-Prose-Bold.woff2') format('woff2'); + font-family: "Enso Prose"; + src: url("/font-enso-prose/Enso-Prose-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: 'Enso Prose'; - src: url('/font-enso-prose/Enso-Prose-ExtraBold.woff2') format('woff2'); + font-family: "Enso Prose"; + src: url("/font-enso-prose/Enso-Prose-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: 'Enso Prose'; - src: url('/font-enso-prose/Enso-Prose-Black.woff2') format('woff2'); + font-family: "Enso Prose"; + src: url("/font-enso-prose/Enso-Prose-Black.woff2") format("woff2"); font-weight: 900; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-Thin.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-Thin.woff2") format("woff2"); font-weight: 100; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-ExtraLight.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-ExtraLight.woff2") format("woff2"); font-weight: 200; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-Light.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-Regular.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-Medium.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-SemiBold.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-Bold.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-ExtraBold.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: 'Enso Naming'; - src: url('/font-enso-naming/Enso-Naming-Black.woff2') format('woff2'); + font-family: "Enso Naming"; + src: url("/font-enso-naming/Enso-Naming-Black.woff2") format("woff2"); font-weight: 900; font-display: swap; unicode-range: U+0020, U+002D; diff --git a/app/gui/src/project-view/assets/font-enso.css b/app/gui/src/project-view/assets/font-enso.css index 0a9a259eda9d..7cd1c5910e3f 100644 --- a/app/gui/src/project-view/assets/font-enso.css +++ b/app/gui/src/project-view/assets/font-enso.css @@ -1,53 +1,53 @@ @font-face { - font-family: 'Enso'; - src: url('/font-enso/Enso-Thin.ttf'); + font-family: "Enso"; + src: url("/font-enso/Enso-Thin.ttf"); font-weight: 100; } @font-face { - font-family: 'Enso'; - src: url('/font-enso/Enso-ExtraLight.ttf'); + font-family: "Enso"; + src: url("/font-enso/Enso-ExtraLight.ttf"); font-weight: 200; } @font-face { - font-family: 'Enso'; - src: url('/font-enso/Enso-Light.ttf'); + font-family: "Enso"; + src: url("/font-enso/Enso-Light.ttf"); font-weight: 300; } @font-face { - font-family: 'Enso'; - src: url('/font-enso/Enso-Regular.ttf'); + font-family: "Enso"; + src: url("/font-enso/Enso-Regular.ttf"); font-weight: 400; } @font-face { - font-family: 'Enso'; - src: url('/font-enso/Enso-Medium.ttf'); + font-family: "Enso"; + src: url("/font-enso/Enso-Medium.ttf"); font-weight: 500; } @font-face { - font-family: 'Enso'; - src: url('/font-enso/Enso-SemiBold.ttf'); + font-family: "Enso"; + src: url("/font-enso/Enso-SemiBold.ttf"); font-weight: 600; } @font-face { - font-family: 'Enso'; - src: url('/font-enso/Enso-Bold.ttf'); + font-family: "Enso"; + src: url("/font-enso/Enso-Bold.ttf"); font-weight: 700; } @font-face { - font-family: 'Enso'; - src: url('/font-enso/Enso-ExtraBold.ttf'); + font-family: "Enso"; + src: url("/font-enso/Enso-ExtraBold.ttf"); font-weight: 800; } @font-face { - font-family: 'Enso'; - src: url('/font-enso/Enso-Black.ttf'); + font-family: "Enso"; + src: url("/font-enso/Enso-Black.ttf"); font-weight: 900; } diff --git a/app/gui/src/project-view/assets/font-mplus1.css b/app/gui/src/project-view/assets/font-mplus1.css index 253d7e638f37..673fbb68af8f 100644 --- a/app/gui/src/project-view/assets/font-mplus1.css +++ b/app/gui/src/project-view/assets/font-mplus1.css @@ -1,4 +1,4 @@ @font-face { - font-family: 'M PLUS 1'; - src: url('/font-mplus1/MPLUS1[wght].ttf'); + font-family: "M PLUS 1"; + src: url("/font-mplus1/MPLUS1[wght].ttf"); } From e60438658e689e7fdbbeb39ced2ad9734c5d4fb1 Mon Sep 17 00:00:00 2001 From: somebody1234 Date: Fri, 10 Jan 2025 18:51:49 +1000 Subject: [PATCH 9/9] Revert GUI changes --- .../src/project-view/assets/font-dejavu.css | 8 +-- .../project-view/assets/font-enso-naming.css | 36 +++++----- .../project-view/assets/font-enso-prose.css | 72 +++++++++---------- app/gui/src/project-view/assets/font-enso.css | 36 +++++----- .../src/project-view/assets/font-mplus1.css | 4 +- 5 files changed, 78 insertions(+), 78 deletions(-) diff --git a/app/gui/src/project-view/assets/font-dejavu.css b/app/gui/src/project-view/assets/font-dejavu.css index 3d54feb70faf..a4acbe007856 100644 --- a/app/gui/src/project-view/assets/font-dejavu.css +++ b/app/gui/src/project-view/assets/font-dejavu.css @@ -1,11 +1,11 @@ @font-face { - font-family: "DejaVu Sans Mono"; - src: url("/font-dejavu/DejaVuSansMono.ttf"); + font-family: 'DejaVu Sans Mono'; + src: url('/font-dejavu/DejaVuSansMono.ttf'); font-weight: 400; } @font-face { - font-family: "DejaVu Sans Mono"; - src: url("/font-dejavu/DejaVuSansMono-Bold.ttf"); + font-family: 'DejaVu Sans Mono'; + src: url('/font-dejavu/DejaVuSansMono-Bold.ttf'); font-weight: 700; } diff --git a/app/gui/src/project-view/assets/font-enso-naming.css b/app/gui/src/project-view/assets/font-enso-naming.css index 7be53310799a..0a1c7fc87221 100644 --- a/app/gui/src/project-view/assets/font-enso-naming.css +++ b/app/gui/src/project-view/assets/font-enso-naming.css @@ -1,70 +1,70 @@ @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-Thin.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-Thin.woff2') format('woff2'); font-weight: 100; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-ExtraLight.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-ExtraLight.woff2') format('woff2'); font-weight: 200; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-Light.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-Light.woff2') format('woff2'); font-weight: 300; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-Regular.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-Medium.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-SemiBold.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-Bold.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-ExtraBold.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-Black.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-Black.woff2') format('woff2'); font-weight: 900; font-display: swap; unicode-range: U+0020, U+002D; diff --git a/app/gui/src/project-view/assets/font-enso-prose.css b/app/gui/src/project-view/assets/font-enso-prose.css index 8461ba375487..3d6ab4fdbb47 100644 --- a/app/gui/src/project-view/assets/font-enso-prose.css +++ b/app/gui/src/project-view/assets/font-enso-prose.css @@ -1,142 +1,142 @@ @font-face { - font-family: "Enso Prose"; - src: url("/font-enso-prose/Enso-Prose-Thin.woff2") format("woff2"); + font-family: 'Enso Prose'; + src: url('/font-enso-prose/Enso-Prose-Thin.woff2') format('woff2'); font-weight: 100; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: "Enso Prose"; - src: url("/font-enso-prose/Enso-Prose-ExtraLight.woff2") format("woff2"); + font-family: 'Enso Prose'; + src: url('/font-enso-prose/Enso-Prose-ExtraLight.woff2') format('woff2'); font-weight: 200; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: "Enso Prose"; - src: url("/font-enso-prose/Enso-Prose-Light.woff2") format("woff2"); + font-family: 'Enso Prose'; + src: url('/font-enso-prose/Enso-Prose-Light.woff2') format('woff2'); font-weight: 300; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: "Enso Prose"; - src: url("/font-enso-prose/Enso-Prose-Regular.woff2") format("woff2"); + font-family: 'Enso Prose'; + src: url('/font-enso-prose/Enso-Prose-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: "Enso Prose"; - src: url("/font-enso-prose/Enso-Prose-Medium.woff2") format("woff2"); + font-family: 'Enso Prose'; + src: url('/font-enso-prose/Enso-Prose-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: "Enso Prose"; - src: url("/font-enso-prose/Enso-Prose-SemiBold.woff2") format("woff2"); + font-family: 'Enso Prose'; + src: url('/font-enso-prose/Enso-Prose-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: "Enso Prose"; - src: url("/font-enso-prose/Enso-Prose-Bold.woff2") format("woff2"); + font-family: 'Enso Prose'; + src: url('/font-enso-prose/Enso-Prose-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: "Enso Prose"; - src: url("/font-enso-prose/Enso-Prose-ExtraBold.woff2") format("woff2"); + font-family: 'Enso Prose'; + src: url('/font-enso-prose/Enso-Prose-ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: "Enso Prose"; - src: url("/font-enso-prose/Enso-Prose-Black.woff2") format("woff2"); + font-family: 'Enso Prose'; + src: url('/font-enso-prose/Enso-Prose-Black.woff2') format('woff2'); font-weight: 900; font-display: swap; unicode-range: U+0020, U+002D, U+002E; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-Thin.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-Thin.woff2') format('woff2'); font-weight: 100; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-ExtraLight.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-ExtraLight.woff2') format('woff2'); font-weight: 200; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-Light.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-Light.woff2') format('woff2'); font-weight: 300; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-Regular.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-Medium.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-SemiBold.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-Bold.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-ExtraBold.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; unicode-range: U+0020, U+002D; } @font-face { - font-family: "Enso Naming"; - src: url("/font-enso-naming/Enso-Naming-Black.woff2") format("woff2"); + font-family: 'Enso Naming'; + src: url('/font-enso-naming/Enso-Naming-Black.woff2') format('woff2'); font-weight: 900; font-display: swap; unicode-range: U+0020, U+002D; diff --git a/app/gui/src/project-view/assets/font-enso.css b/app/gui/src/project-view/assets/font-enso.css index 7cd1c5910e3f..0a9a259eda9d 100644 --- a/app/gui/src/project-view/assets/font-enso.css +++ b/app/gui/src/project-view/assets/font-enso.css @@ -1,53 +1,53 @@ @font-face { - font-family: "Enso"; - src: url("/font-enso/Enso-Thin.ttf"); + font-family: 'Enso'; + src: url('/font-enso/Enso-Thin.ttf'); font-weight: 100; } @font-face { - font-family: "Enso"; - src: url("/font-enso/Enso-ExtraLight.ttf"); + font-family: 'Enso'; + src: url('/font-enso/Enso-ExtraLight.ttf'); font-weight: 200; } @font-face { - font-family: "Enso"; - src: url("/font-enso/Enso-Light.ttf"); + font-family: 'Enso'; + src: url('/font-enso/Enso-Light.ttf'); font-weight: 300; } @font-face { - font-family: "Enso"; - src: url("/font-enso/Enso-Regular.ttf"); + font-family: 'Enso'; + src: url('/font-enso/Enso-Regular.ttf'); font-weight: 400; } @font-face { - font-family: "Enso"; - src: url("/font-enso/Enso-Medium.ttf"); + font-family: 'Enso'; + src: url('/font-enso/Enso-Medium.ttf'); font-weight: 500; } @font-face { - font-family: "Enso"; - src: url("/font-enso/Enso-SemiBold.ttf"); + font-family: 'Enso'; + src: url('/font-enso/Enso-SemiBold.ttf'); font-weight: 600; } @font-face { - font-family: "Enso"; - src: url("/font-enso/Enso-Bold.ttf"); + font-family: 'Enso'; + src: url('/font-enso/Enso-Bold.ttf'); font-weight: 700; } @font-face { - font-family: "Enso"; - src: url("/font-enso/Enso-ExtraBold.ttf"); + font-family: 'Enso'; + src: url('/font-enso/Enso-ExtraBold.ttf'); font-weight: 800; } @font-face { - font-family: "Enso"; - src: url("/font-enso/Enso-Black.ttf"); + font-family: 'Enso'; + src: url('/font-enso/Enso-Black.ttf'); font-weight: 900; } diff --git a/app/gui/src/project-view/assets/font-mplus1.css b/app/gui/src/project-view/assets/font-mplus1.css index 673fbb68af8f..253d7e638f37 100644 --- a/app/gui/src/project-view/assets/font-mplus1.css +++ b/app/gui/src/project-view/assets/font-mplus1.css @@ -1,4 +1,4 @@ @font-face { - font-family: "M PLUS 1"; - src: url("/font-mplus1/MPLUS1[wght].ttf"); + font-family: 'M PLUS 1'; + src: url('/font-mplus1/MPLUS1[wght].ttf'); }