Skip to content

Feature/villager privacy#15

Open
Capitao117 wants to merge 4 commits into
DHEBP:devfrom
Capitao117:feature/villager-privacy
Open

Feature/villager privacy#15
Capitao117 wants to merge 4 commits into
DHEBP:devfrom
Capitao117:feature/villager-privacy

Conversation

@Capitao117
Copy link
Copy Markdown

Implement Villager Privacy Controls (5s Hover-Lock & Click-Unlock)

This PR introduces a sophisticated, time-triggered privacy layer for the sidebar avatar. It allows users to quickly mask sensitive information (Address, Funds, and Avatar) using a "Global Privacy Mode" that persists across sessions.

Key Features

  • Time-Triggered Lock Mechanism:
    • Hovering over the villager avatar for 5 seconds reveals a vibrant blue Privacy Icon (Shield).
    • Clicking the shield enables Global Privacy Mode, instantly hiding the avatar, masking the DERO address with bullets, and obscuring the wallet balance.
  • Secure Unlock Flow:
    • When hidden, the avatar is replaced by a Lock icon placeholder.
    • Visibility can be restored with a single click on the Lock icon, preventing accidental visibility leaks.
  • Persistent State: Uses the new privacy_mode and avatar_hidden settings keys to ensure the privacy state is remembered when the application is restarted.
  • Rail & Expanded Support:
    • Full support for both Expanded and Collapsed sidebar views.
    • In the collapsed view, a mini-lock icon allows for quick unlocking without needing to expand the sidebar.
  • UI Consistency: Replaced "Address Private" text with standard blue bullet points to match the existing wallet design language.

Technical Implementation

  • Backend Persistence: Registered privacy_mode and avatar_hidden in app_settings.go and app.go for disk storage.
  • Reactive Store: Expanded the settingsState in appState.js to manage the new privacy properties reactively.
  • Sidebar Refactor:
    • Converted the wallet-anchor from a <button> to a <div> to fix invalid HTML nesting (nested interactive elements). This resolves "gray-out" UI glitches caused by hit-testing issues.
    • Implemented 5-second hover logic and reactive visibility masks in Sidebar.svelte.
    • Added scoped CSS for the blue glow shield and the lock placeholders.

Verification Steps

  1. Hover the villager avatar for 5 seconds -> Shield appears.
  2. Click shield -> UI masks sensitive info.
  3. Click the Lock icon -> UI restores visibility.
  4. Switch between collapsed/expanded modes -> Privacy state remains consistent.
  5. Restart app -> Privacy state is persisted.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants