From 32061c06b851706c4e170210022802051edf3ff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Vi=C3=A9not?= Date: Thu, 9 Oct 2025 19:59:22 +0200 Subject: [PATCH 1/9] First prototype of Hiero Hooks support. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Viénot --- _frontend/src/AppStorage.ts | 14 ++ .../src/components/hooks/HieroHookEntry.vue | 155 ++++++++++++++++++ .../src/components/hooks/HieroHookStorage.vue | 90 ++++++++++ .../src/components/hooks/HieroHooksList.vue | 47 ++++++ .../components/hooks/HieroHooksSection.vue | 86 ++++++++++ .../src/components/values/TimestampValue.vue | 14 +- _frontend/src/pages/AccountDetails_Hooks.vue | 47 ++++++ .../src/pages/AccountDetails_Summary.vue | 39 ++++- _frontend/src/router.ts | 10 ++ _frontend/src/utils/RouteManager.ts | 6 +- .../utils/cache/HieroHookStorageByIdCache.ts | 68 ++++++++ .../utils/cache/HieroHooksByAccountIdCache.ts | 74 +++++++++ 12 files changed, 642 insertions(+), 8 deletions(-) create mode 100644 _frontend/src/components/hooks/HieroHookEntry.vue create mode 100644 _frontend/src/components/hooks/HieroHookStorage.vue create mode 100644 _frontend/src/components/hooks/HieroHooksList.vue create mode 100644 _frontend/src/components/hooks/HieroHooksSection.vue create mode 100644 _frontend/src/pages/AccountDetails_Hooks.vue create mode 100644 _frontend/src/utils/cache/HieroHookStorageByIdCache.ts create mode 100644 _frontend/src/utils/cache/HieroHooksByAccountIdCache.ts diff --git a/_frontend/src/AppStorage.ts b/_frontend/src/AppStorage.ts index b920bf268..9c39051e6 100644 --- a/_frontend/src/AppStorage.ts +++ b/_frontend/src/AppStorage.ts @@ -229,6 +229,20 @@ export class AppStorage { this.setLocalStorageItem(this.ACCOUNT_AIRDROP_TAB_KEY, newValue) } + // + // preferred tabs in account hooks section + // + + private static readonly ACCOUNT_HOOKS_TAB_KEY = 'accountHooksTab' + + static getAccountHooksTab() { + return this.getLocalStorageItem(this.ACCOUNT_HOOKS_TAB_KEY) + } + + static setAccountHooksTab(newValue: string | null) { + this.setLocalStorageItem(this.ACCOUNT_HOOKS_TAB_KEY, newValue) + } + // // preferred tab in contract bytecode section // diff --git a/_frontend/src/components/hooks/HieroHookEntry.vue b/_frontend/src/components/hooks/HieroHookEntry.vue new file mode 100644 index 000000000..190c7ec8c --- /dev/null +++ b/_frontend/src/components/hooks/HieroHookEntry.vue @@ -0,0 +1,155 @@ +// SPDX-License-Identifier: Apache-2.0 + + + + + + + + + + + + + + + + + + diff --git a/_frontend/src/components/hooks/HieroHookStorage.vue b/_frontend/src/components/hooks/HieroHookStorage.vue new file mode 100644 index 000000000..54e70d82d --- /dev/null +++ b/_frontend/src/components/hooks/HieroHookStorage.vue @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: Apache-2.0 + + + + + + + + + + + + + + + + + + diff --git a/_frontend/src/components/hooks/HieroHooksList.vue b/_frontend/src/components/hooks/HieroHooksList.vue new file mode 100644 index 000000000..7a15acd65 --- /dev/null +++ b/_frontend/src/components/hooks/HieroHooksList.vue @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 + + + + + + + + + + + + + + + + + + diff --git a/_frontend/src/components/hooks/HieroHooksSection.vue b/_frontend/src/components/hooks/HieroHooksSection.vue new file mode 100644 index 000000000..b0c887b95 --- /dev/null +++ b/_frontend/src/components/hooks/HieroHooksSection.vue @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: Apache-2.0 + + + + + + + + + + + + + + + + + + diff --git a/_frontend/src/components/values/TimestampValue.vue b/_frontend/src/components/values/TimestampValue.vue index 48bf36528..0dbd629e5 100644 --- a/_frontend/src/components/values/TimestampValue.vue +++ b/_frontend/src/components/values/TimestampValue.vue @@ -14,9 +14,10 @@ {{ timePart.hour }}:{{ timePart.minute }} - :{{ timePart.second }}.{{ + :{{ timePart.second }}.{{ timePart.fractionalSecond - }} {{ timePart.dayPeriod }} + }} +  {{ timePart.dayPeriod }} {{ datePart }} @@ -45,7 +46,7 @@ import {computed, defineComponent, inject, PropType, ref} from "vue"; import {HMSF} from "@/utils/HMSF"; import {initialLoadingKey} from "@/AppKeys"; import {infiniteDuration} from "@/schemas/MirrorNodeSchemas"; -import { TriangleAlert } from 'lucide-vue-next'; +import {TriangleAlert} from 'lucide-vue-next'; export default defineComponent({ name: "TimestampValue", @@ -68,6 +69,7 @@ export default defineComponent({ setup(props) { + const isMediumScreen = inject('isMediumScreen', ref(true)) const locale = "en-US" const seconds = computed(() => { @@ -84,8 +86,11 @@ export default defineComponent({ timeZoneName: "short", timeZone: HMSF.forceUTC ? "UTC" : undefined } - const dateFormat = new Intl.DateTimeFormat(locale, dateOptions) const datePart = computed(() => { + const options = {...dateOptions} + options.timeZoneName = isMediumScreen.value ? "short" : undefined + + const dateFormat = new Intl.DateTimeFormat(locale, options) return (seconds.value != null && !isNever.value) ? dateFormat.format(seconds.value * 1000) : "?" }) @@ -96,6 +101,7 @@ export default defineComponent({ const initialLoading = inject(initialLoadingKey, ref(false)) return { + isMediumScreen, isNever, seconds, datePart, diff --git a/_frontend/src/pages/AccountDetails_Hooks.vue b/_frontend/src/pages/AccountDetails_Hooks.vue new file mode 100644 index 000000000..e7980417f --- /dev/null +++ b/_frontend/src/pages/AccountDetails_Hooks.vue @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 + + + + + + + + + + + + + + + + + +