Skip to content

feat(keys): enhance filters, export tracking, and key generation#261

Merged
jorgecuesta merged 2 commits intostagingfrom
feature/enhace-filter-for-keys
Mar 29, 2026
Merged

feat(keys): enhance filters, export tracking, and key generation#261
jorgecuesta merged 2 commits intostagingfrom
feature/enhace-filter-for-keys

Conversation

@Alann27
Copy link
Copy Markdown
Collaborator

@Alann27 Alann27 commented Mar 27, 2026

  • Add owner address and delegator filters to the keys table, including "None" options for unassigned keys; fix FilterDropdown to support combinable filters across all columns
  • Add global search input to the keys table (searches by key address, owner address, and delegator name/identity); show a live filtered key count
  • Redesign the export form with expanded filters (address group, multi-state, owner, delegator, date range, export status); add exportedAt / exportCount tracking columns with a DB migration
  • Add a key generation flow: select an address group and quantity, generate keys server-side, and download the JSON file immediately
  • Apply avatar + getShortAddress formatting to the Owner column in the keys table and key detail panel, with copy support via showAvatar prop on Address
  • Fix OverrideSidebar scroll by switching from absolute to fixed positioning

Closes #225
Closes #227

Keys Page

Includes new Generate button, search input and new filters.

image

Export Keys page

With new filter options.

image

Generate Keys page

image

@Alann27 Alann27 requested a review from jorgecuesta March 27, 2026 23:33
@Alann27 Alann27 self-assigned this Mar 27, 2026
@Alann27 Alann27 added the enhancement New feature or request label Mar 27, 2026
@Alann27 Alann27 changed the base branch from main to staging March 27, 2026 23:35
Copy link
Copy Markdown
Contributor

@jorgecuesta jorgecuesta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work Alan! The filters redesign, key generation, and export tracking are solid additions. The combinable filter fix in FilterDropdown is a nice improvement.

A few things to address before merge:

  1. ExportForm useEffect stormselectedStates array in the deps causes the effect to fire on every render. Needs debounce or serialized comparison.
  2. Server action validationExportKeys and CountKeysForExport should validate filters with zod like GenerateKeys does.
  3. Owner address querylistDistinctOwnerAddresses should also exclude empty strings at the DB level.
  4. Migration collision — PR #262 also creates migration 0014, so whichever merges second needs to re-sequence.

The Key type override in the schema is optional to fix but would simplify things.

Everything else looks clean — the Address avatar, the generate flow, and the FilterDropdown rewrite are all well done.

Comment thread apps/provider/src/app/admin/(internal)/keys/export/ExportForm.tsx
Comment thread apps/provider/src/actions/Keys.ts
Comment thread apps/provider/src/lib/dal/keys.ts Outdated
Comment thread packages/db/src/provider/schema/keys.ts
Comment thread apps/provider/drizzle/0016_slim_warlock.sql
Alann27 and others added 2 commits March 28, 2026 23:44
- Add owner/delegator filters to keys table with "None" option and combinable filter support
- Fix FilterDropdown to upsert per-column filters instead of replacing all
- Add search input across key address, owner, and delegator fields
- Show filtered key count in table header
- Redesign export form with multi-filter support (states, owner, delegator, date range, export status)
- Add exportedAt/exportCount columns to keys table with migration
- Add key generation flow (select address group + count, download JSON)
- Add showAvatar prop to Address component; apply to Owner column and key detail
- Fix OverrideSidebar scroll by switching from absolute to fixed positioning
…modals

- Add zod validation on CountKeysForExport/ExportKeys server actions
- Fix useEffect infinite loop: debounce + serialize selectedStates in ExportForm
- Filter empty ownerAddress strings in listDistinctOwnerAddresses query
- Simplify Key type (remove unnecessary Omit hack), fix fixture
- Convert Import/Export/Generate from route-based OverrideSidebar to true Dialog modals
- 2-column layout (label left, input right) across all 3 forms
- Import: redesigned dropzone with state feedback (blue=loaded, red=error)
- Export: collapsible example output, summary card with green/yellow border state
- Generate: collapsible example output with syntax-highlighted JSON
- Remove toast notifications from ImportProcess, show errors inline
- Disable Import Keys button until address group and file are selected
- Client-side data fetching in modals (no more route navigation)
@jorgecuesta jorgecuesta force-pushed the feature/enhace-filter-for-keys branch from 9067762 to 4215192 Compare March 29, 2026 04:57
@jorgecuesta jorgecuesta added the release Trigger staging deploy on merge to staging label Mar 29, 2026
@jorgecuesta jorgecuesta merged commit 2c90d8f into staging Mar 29, 2026
6 checks passed
@jorgecuesta jorgecuesta deleted the feature/enhace-filter-for-keys branch March 29, 2026 05:09
jorgecuesta added a commit that referenced this pull request Mar 29, 2026
* feat: comprehensive DevX audit — UI overhaul, transactions system, GovernanceSync, localnet, auth & wallet fixes (#262)

* feat: comprehensive DevX audit — UI overhaul, transactions system, GovernanceSync, localnet, auth & wallet fixes

Transactions System (Provider)
- New transactions DB table with enums (tx_type, tx_status, tx_trigger)
- Workflow wiring: remediateSupplier inserts tx records, clears remediation on success
- /admin/transactions page with DataTable, search, count chip, +N new polling
- Migrate History button for legacy remediationHistory entries
- Request Remediation progress dialog with polling

Workflow Fixes
- upsertSupplierStatus clears stale ServiceMismatch entries when services match
- remediateSupplier no longer writes txResult to remediationHistory — transactions table is source of truth
- SupplierRemediation child workflow ID includes reasons to prevent collision
- AutoStakeToggle invalidates React Query cache on toggle

GovernanceSync Workflows
- New GovernanceSync Temporal workflow in both provider-workflows (delegators) and middleman-workflows (providers)
- Scheduled every 5 minutes via bootstrap, new entries enabled/visible by default
- Reload button triggers workflow manually via Temporal schedule trigger
- Replaced inline CDN fetch logic in server actions with workflow delegation
- Tiltfile patches CDN URL from governance-nginx for workflow pods

UI Polish (Provider — All Pages)
- Consistent headers: title + subtitle + border-b separator across all admin pages
- Sidebar: reordered routes, active state uses bg-sidebar-active-bg/text-sidebar-active-text
- ThemeToggle added to provider topbar
- All tables: search input with clear X button, count chip (countLabel), searchableColumns
- DataTable: new props headerLeft, countLabel, clear button, array/object search in globalFilterFn
- Buttons: all "Add New" → descriptive labels, blue filled CTA
- Keys page: Import/Export/Request Remediation/Clear Remediation/Auto Stake pill layout
- Delegators: Switch toggle instead of Button for enable/disable
- Services table: added Service ID column, protocol chips restyled

UI Polish (Middleman — All Pages)
- Consistent page headers with border-b, title, subtitle across admin pages
- Settings form fully redesigned: sections (General, Gateway, Blockchain, Indexer), fixed-width labels, dividers, read-only derived fields as spans, debounced live validation for RPC/Indexer
- Suppliers route renamed from /app/nodes to /app/suppliers, sidebar active state fixed
- New /admin/suppliers page showing all suppliers across all providers with filters, search, +N new polling
- DataTable props added to providers and transactions tables
- Buttons: New Stake (blue) | Import Suppliers (mint) | Unstake (red outline)

+N New Count Polling
- Added to: provider keys, provider delegators, provider transactions, middleman providers, middleman transactions, middleman admin suppliers
- Count query every 10s, blue pulsing "+N new" button to refresh

Address Group Dialog Redesign (Provider)
- Two-panel layout (10/14 cols), 1100px wide, border separator, fixed footer
- Endpoint overrides: editable inputs per endpoint per service, template interpolation, unresolved variable warnings
- endpointOverrides field added to address_group_services table (JSON), wired through DAL, domain handler, form
- Service cards: collapsible with chevron animation, flash effect on new service
- Live validation: address format, duplicates, total <= 100%, URL schemes
- Default propagation: changing default supplier share/rev shares propagates to uncustomized services
- Dirty detection: JSON compare (not react-hook-form isDirty which misses array changes)

Settings Form Redesign (Provider)
- Sections: General, Reward Addresses, Operational Funds, Blockchain, Indexer
- New fields: ownerEmail (editable), ownerIdentity (read-only), initialOperationalFunds, minimumOperationalFunds
- Reward addresses: individual inputs with live validation, add/remove
- Blockchain derived: Chain ID, Min Stake, App Identity, Height as read-only text
- Save button disabled when no changes or has errors

Auth & Security
- Provider auth: only owner can signIn
- Middleman auth: anyone can signIn (public app UI), removed signIn check
- Provider CurrentUser: shows "Access denied" toast when non-owner tries to sign in
- WalletConnection: reconnect calls onDisconnect when reconnect fails, 15s/60s timeouts
- PocketWalletConnection: getBalance now uses app RPC proxy instead of wallet extension

Localnet Setup
- Validator, account-init, owner-fund infrastructure in k8s/tools/localnet/
- Genesis with 15 staked suppliers, 4 services, min_stake 10 POKT
- 50 generated keys, import files for UI upload
- LOCALNET_ENABLED toggle, conditional Tiltfile includes
- /api/rpc proxy route in both apps for client-side RPC calls
- PostgreSQL memory bumped to 1Gi, pool.on('error') for PG disconnect resilience
- Governance nginx serves local delegator.json and provider.json

Shared (packages/ui)
- Sidebar width reduced from 16rem to 13rem, mobile from 18rem to 16rem
- Gradient borders replaced with solid borders throughout
- Service chips: single neutral style
- Connect Wallet button: secondary → default (blue filled)
- AppTopBar gap reduced, hydration fix for roundAndSeparate locale
- OverrideSidebar: h-[100vh] overflow-auto for scroll fix, offset updated for new sidebar width
- ServerSummary: DB data always overrides indexer data, rewards show N/A when indexer unavailable

* fix(ci): branch-gate always passes for non-main PRs, remove standalone workflow

* chore(deploy): update staging image to ee5acec

* feat(keys): enhance filters, export tracking, key generation, and UI overhaul (#261)

* feat(keys): enhance filters, export tracking, and key generation

- Add owner/delegator filters to keys table with "None" option and combinable filter support
- Fix FilterDropdown to upsert per-column filters instead of replacing all
- Add search input across key address, owner, and delegator fields
- Show filtered key count in table header
- Redesign export form with multi-filter support (states, owner, delegator, date range, export status)
- Add exportedAt/exportCount columns to keys table with migration
- Add key generation flow (select address group + count, download JSON)
- Add showAvatar prop to Address component; apply to Owner column and key detail
- Fix OverrideSidebar scroll by switching from absolute to fixed positioning

* fix(keys): code review fixes, UI overhaul for import/export/generate modals

- Add zod validation on CountKeysForExport/ExportKeys server actions
- Fix useEffect infinite loop: debounce + serialize selectedStates in ExportForm
- Filter empty ownerAddress strings in listDistinctOwnerAddresses query
- Simplify Key type (remove unnecessary Omit hack), fix fixture
- Convert Import/Export/Generate from route-based OverrideSidebar to true Dialog modals
- 2-column layout (label left, input right) across all 3 forms
- Import: redesigned dropzone with state feedback (blue=loaded, red=error)
- Export: collapsible example output, summary card with green/yellow border state
- Generate: collapsible example output with syntax-highlighted JSON
- Remove toast notifications from ImportProcess, show errors inline
- Disable Import Keys button until address group and file are selected
- Client-side data fetching in modals (no more route navigation)

---------

Co-authored-by: Jorge Cuesta <jorge.s.cuesta@gmail.com>

* chore(deploy): update staging image to 2c90d8f

* chore(release): prepare v0.8.0 mainnet overlays [skip ci]

---------

Co-authored-by: Jorge S. Cuesta <jorge.s.cuesta@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alan Rojas <alan2rm7@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request release Trigger staging deploy on merge to staging

Projects

None yet

2 participants