Skip to content

fix(activity): hide unsupported visualizations instead of showing warning - #919

Merged
ErikBjare merged 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:feat/904-hide-unsupported-vis
Jul 26, 2026
Merged

fix(activity): hide unsupported visualizations instead of showing warning#919
ErikBjare merged 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:feat/904-hide-unsupported-vis

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Contributor

Closes #904.

What this does

Replaces the per-devicetype view-set approach from #903 (which returned hardcoded androidViews for Android devices) with a simpler model: one view layout for all devices, with individual visualizations hidden when they have no backing data.

Erik's direction from #904:

"let's stick with hiding unsupported visualizations for now. That way visualizations can also 'automatically' start showing once the requisites are there."

Changes

src/components/SelectableVisualization.vue — add v-if on the root div:

-div
+div(v-if="editable || !activityStore.buckets.loaded || has_prerequisites")
  • In view mode: if has_prerequisites is false (no backing data for this device type), the widget disappears entirely instead of showing a warning
  • In edit mode: still shown (including the existing "missing data" warning), so users can manage their layout
  • While buckets are loading: still shown (to prevent a flash of missing widgets)

src/stores/views.ts — simplify viewsForHost:

-viewsForHost(host: string): View[] {
-  const bucketsStore = useBucketsStore();
-  const available = bucketsStore.available(host);
-  if (available.android && !available.window) {
-    return androidViews;
-  }
+viewsForHost(_host: string): View[] {
   return this.views;
 },

The Android-specific view selection is no longer needed — the visibility guard handles it automatically.

Behaviour

For an Android device viewed from desktop (no window buckets):

  • Summary tab: top_apps visible, top_titles hidden, rest visible
  • Visualizations reappear automatically if a watcher is later installed

For the multi-device view: no change (aggregation view uses whatever's available).

…ning

Replace the per-devicetype view-set approach (PR ActivityWatch#903's androidViews
switching) with a simpler model: keep one view layout for all devices,
but hide individual visualizations that have no backing data.

Changes:
- SelectableVisualization: add v-if on root div so widgets with missing
  prerequisites disappear in view mode (still shown in edit mode, where
  the existing "missing data" warning remains useful)
- viewsForHost: remove Android-specific branching; always return
  this.views. The visibility guard in SelectableVisualization handles
  device-type differences automatically.

Benefit: visualizations appear automatically once the required watcher
data is present, with no need for separate per-device view configs.

Closes ActivityWatch#904
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 38.67%. Comparing base (cefc618) to head (ebbfc38).

Files with missing lines Patch % Lines
src/stores/views.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #919      +/-   ##
==========================================
+ Coverage   38.63%   38.67%   +0.04%     
==========================================
  Files          42       42              
  Lines        2278     2273       -5     
  Branches      435      434       -1     
==========================================
- Hits          880      879       -1     
+ Misses       1377     1373       -4     
  Partials       21       21              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces Android-specific view selection with prerequisite-based visualization visibility.

  • Hides unsupported visualizations in view mode after bucket metadata loads.
  • Preserves unsupported visualizations and their warnings while editing layouts.
  • Uses the persisted/default view layout for every host instead of substituting androidViews.

Confidence Score: 5/5

The PR appears safe to merge, with unsupported widgets consistently filtered by their existing prerequisite metadata.

The unified layout preserves supported Android visualizations, hides desktop-only elements after bucket availability is established, and keeps all elements accessible during layout editing.

Important Files Changed

Filename Overview
src/components/SelectableVisualization.vue Adds a root visibility guard that hides unsupported widgets in view mode while retaining initial-loading and edit-mode behavior.
src/stores/views.ts Removes host-specific Android layout substitution so all hosts use the configured view layout.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Render visualization] --> B{Edit mode?}
  B -->|Yes| C[Show widget]
  B -->|No| D{Buckets loaded?}
  D -->|No| C
  D -->|Yes| E{Prerequisites available?}
  E -->|Yes| C
  E -->|No| F[Hide widget]
Loading

Reviews (1): Last reviewed commit: "fix(activity): hide unsupported visualiz..." | Re-trigger Greptile

@ErikBjare

Copy link
Copy Markdown
Member

@TimeToBuildBob but when should the user get notified about it? Will it still be hidden during edit? Should probably show then, right?

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

Good questions — let me clarify both:

Edit mode: Yes, hidden visualizations still show in edit mode. The v-if condition is:

v-if="editable || !activityStore.buckets.loaded || has_prerequisites"

The editable term is first — so any widget that would be hidden in view mode is still visible (with its existing "missing data" warning) when the user is editing their layout. That way they can still reorganize or remove unsupported widgets.

View mode notifications: Currently there's no explicit notification when a widget disappears — it just silently hides once buckets finish loading. The reasoning was that this is the "positive" version of the behavior (no red warning, just a clean layout with whatever's supported). But I could see the argument for a one-time toast or an info banner like "N visualizations hidden because they're not supported on this device."

If you want a notification mechanism, I can add something — e.g. a dismissible info banner at the top of the view listing the hidden widget names. Or we could keep it silent as-is and rely on edit mode for discovery. What's your preference?

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

CI-green and mergeable — waiting only on a maintainer click.

This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted.

@ErikBjare

Copy link
Copy Markdown
Member

@TimeToBuildBob add an option in settings to disable this hiding behavior, have it disabled by default so I can test it.

…tions

Adds `hideUnsupportedVisualizations` setting (default: false) so the
hiding behavior can be tested without it being the default experience.

- settings.ts: new boolean field, default false
- SelectableVisualization.vue: guard short-circuits when setting is off
- DeveloperSettings.vue: toggle added under Developer settings
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

Done — added hideUnsupportedVisualizations (default: false) in the latest commit.

How to test: go to Settings → Developer → "Hide unsupported visualizations" and toggle it on. The v-if in SelectableVisualization.vue now short-circuits when the setting is off, so the default experience is unchanged (shows the warning as before). Enabling the setting activates the hiding behavior from this PR.

@ErikBjare
ErikBjare merged commit e304925 into ActivityWatch:master Jul 26, 2026
8 checks passed
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.

feat(views): per-devicetype views set — make Android views editable and persistent

2 participants