···794794 state.currentTag = tag;
795795 state.searchQuery = '';
796796797797+ // Set group mode context for this window when viewing a real group
798798+ // (not the special untagged pseudo-group). Mode persists per-window and
799799+ // is used by HUD, child page inheritance, and other consumers.
800800+ if (api.context && tag && !tag.isSpecial) {
801801+ try {
802802+ await api.context.setMode('group', {
803803+ metadata: {
804804+ groupId: tag.id,
805805+ groupName: tag.name,
806806+ color: tag.color
807807+ }
808808+ });
809809+ debug && console.log('[groups] Set group mode for:', tag.name);
810810+ } catch (err) {
811811+ console.error('[groups] Failed to set group mode:', err);
812812+ }
813813+ }
797814798815 // Load URL items - handle special untagged group (only http/https URLs)
799816 if (tag.isSpecial && tag.id === '__untagged__') {