Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

refactor(tags): remove tags + tags-search feature flags (GA) (#5097)

gbirman157a32f2857f
diff --git a/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx b/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx
index f3562939fe..0392a4b1f7 100644
--- a/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx
+++ b/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx
@@ -1,4 +1,3 @@
-import { useRowTagsVisible } from '@app/features/next-soup/soup-view/filters-bar/search/search-tags-flag';
import { useMaybeSoupView } from '@app/features/next-soup/soup-view/soup-view-context';
import { formatCallDuration } from '@block-call/utils';
import { EntityRowTags } from '@property/tags';
@@ -61,7 +60,6 @@ function RowTags(props: {
export function WideLayout(props: LayoutProps) {
const soupView = useMaybeSoupView();
- const rowTagsVisible = useRowTagsVisible();
// When a thread resolves to one of the user's inboxes the inbox chip already
// conveys ownership, so the generic "shared" badge would be redundant.
const owningInbox = useOwningInboxForEntity(() => props.entity);
@@ -161,11 +159,7 @@ export function WideLayout(props: LayoutProps) {
</Switch>
</Entity.Slot>
<Entity.Slot placement="meta" class="flex items-center gap-2">
- <Show
- when={
- rowTagsVisible() && isProjectEntity(props.entity) && props.entity
- }
- >
+ <Show when={isProjectEntity(props.entity) && props.entity}>
{(entity) => (
<RowTags
entityId={entity().id}
@@ -175,11 +169,7 @@ export function WideLayout(props: LayoutProps) {
/>
)}
</Show>
- <Show
- when={
- rowTagsVisible() && isDocumentEntity(props.entity) && props.entity
- }
- >
+ <Show when={isDocumentEntity(props.entity) && props.entity}>
{(entity) => {
const properties = () => {
const doc = entity();
@@ -197,9 +187,7 @@ export function WideLayout(props: LayoutProps) {
);
}}
</Show>
- <Show
- when={rowTagsVisible() && isEmailEntity(props.entity) && props.entity}
- >
+ <Show when={isEmailEntity(props.entity) && props.entity}>
{(entity) => (
// No filter-by-tag affordance. The soup email path does not apply
// tag filters, so filtering would leave email rows unfiltered.
@@ -210,9 +198,7 @@ export function WideLayout(props: LayoutProps) {
/>
)}
</Show>
- <Show
- when={rowTagsVisible() && isChatEntity(props.entity) && props.entity}
- >
+ <Show when={isChatEntity(props.entity) && props.entity}>
{(entity) => (
<RowTags
entityId={entity().id}
@@ -222,9 +208,7 @@ export function WideLayout(props: LayoutProps) {
/>
)}
</Show>
- <Show
- when={rowTagsVisible() && isCallEntity(props.entity) && props.entity}
- >
+ <Show when={isCallEntity(props.entity) && props.entity}>
{(entity) => (
<RowTags
entityId={entity().id}
diff --git a/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-facets.tsx b/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-facets.tsx
index 9302c0314e..965747fe3a 100644
--- a/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-facets.tsx
+++ b/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-facets.tsx
@@ -19,7 +19,6 @@ import type {
SearchIndexId,
SearchTypeValue,
} from './search-filters-state';
-import { useSearchTagsFlag } from './search-tags-flag';
export const SEARCH_INDEX_OPTIONS: {
value: SearchIndexId;
@@ -300,7 +299,6 @@ export function useSearchFacets(
});
const tagSource = useTagOptions();
- const searchTags = useSearchTagsFlag();
const type = singleFacet({
id: 'type',
@@ -484,10 +482,8 @@ export function useSearchFacets(
};
// Tags show only where tagging applies (all/documents/tasks/emails/agents/
- // folders), gated behind both the broad tags flag and the search-view
- // rollout flag, and hidden when the caller has no tags defined.
- const tagFacets = (): SearchFacetVM[] =>
- searchTags() && tagSource.enabled() && tagSource.hasTags() ? [tags] : [];
+ // folders), and hidden when the caller has no tags defined.
+ const tagFacets = (): SearchFacetVM[] => (tagSource.hasTags() ? [tags] : []);
return createMemo(() => {
switch (controller.type()) {
diff --git a/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-tags-flag.ts b/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-tags-flag.ts
deleted file mode 100644
index d2dfe6d96f..0000000000
--- a/apps/web/src/features/next-soup/soup-view/filters-bar/search/search-tags-flag.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { useFeatureFlag } from '@app/lib/analytics/posthog';
-import { useSplitPanel } from '@components/app/split-layout/layoutUtils';
-import {
- ENABLE_TAGS_SEARCH_FE_FLAG,
- ENABLE_TAGS_SEARCH_FE_OVERRIDE,
-} from '@core/constant/featureFlags';
-import type { Accessor } from 'solid-js';
-
-/**
- * Rollout gate for the search-view tag surfaces (tag facet + row chips),
- * layered on top of enable-tags-fe so tagging elsewhere can ship while the
- * search view stays dark until its index backfills complete.
- */
-export function useSearchTagsFlag(): Accessor<boolean> {
- const flag = useFeatureFlag(ENABLE_TAGS_SEARCH_FE_FLAG, {
- enabledOverride: ENABLE_TAGS_SEARCH_FE_OVERRIDE,
- });
- return () => flag().enabled;
-}
-
-/**
- * Whether tag chips may render on list rows in the current split. Rows in
- * the search view follow the rollout gate, rows everywhere else always may.
- */
-export function useRowTagsVisible(): Accessor<boolean> {
- const panel = useSplitPanel();
- const searchTags = useSearchTagsFlag();
- return () => {
- const content = panel?.handle.content();
- const inSearchView =
- content?.type === 'component' && content.id === 'search';
- return !inSearchView || searchTags();
- };
-}
diff --git a/apps/web/src/features/next-soup/soup-view/filters-bar/tag-filter-state.tsx b/apps/web/src/features/next-soup/soup-view/filters-bar/tag-filter-state.tsx
index 7188c430cb..c2f4cb0122 100644
--- a/apps/web/src/features/next-soup/soup-view/filters-bar/tag-filter-state.tsx
+++ b/apps/web/src/features/next-soup/soup-view/filters-bar/tag-filter-state.tsx
@@ -1,10 +1,5 @@
import type { PropertyFilter } from '@app/features/next-soup/filters/filter-store';
import type { QueryStore } from '@app/features/next-soup/filters/filter-store/query-store';
-import { useFeatureFlag } from '@app/lib/analytics/posthog';
-import {
- ENABLE_TAGS_FE_FLAG,
- ENABLE_TAGS_FE_OVERRIDE,
-} from '@core/constant/featureFlags';
import { TagDot } from '@property/tags/TagDot';
import { useTagsQuery } from '@queries/properties/tags';
import type { TagSetResponse } from '@service-properties/generated/schemas/tagSetResponse';
@@ -17,9 +12,6 @@ import type { SearchableOption } from './searchable-multi-select';
* from attaching another observer to the same TanStack query.
*/
export function createTagFilter(queryFilters: QueryStore) {
- const tagsFlag = useFeatureFlag(ENABLE_TAGS_FE_FLAG, {
- enabledOverride: ENABLE_TAGS_FE_OVERRIDE,
- });
const tagsQuery = useTagsQuery();
const tagSets = (): TagSetResponse[] => tagsQuery.data ?? [];
@@ -81,7 +73,6 @@ export function createTagFilter(queryFilters: QueryStore) {
};
return {
- enabled: () => tagsFlag().enabled,
hasTags: () => options().length > 0,
tagSets,
options,
diff --git a/apps/web/src/features/next-soup/soup-view/filters-bar/tag-filter.tsx b/apps/web/src/features/next-soup/soup-view/filters-bar/tag-filter.tsx
index 19711240e6..be4f589be1 100644
--- a/apps/web/src/features/next-soup/soup-view/filters-bar/tag-filter.tsx
+++ b/apps/web/src/features/next-soup/soup-view/filters-bar/tag-filter.tsx
@@ -1,7 +1,7 @@
import { useSoupView } from '@app/features/next-soup/soup-view/soup-view-context';
/**
- * The caller's tags as pickable options, plus the flag/availability gating.
+ * The caller's tags as pickable options, plus availability gating.
* Shared by every tag-filter surface (search facet, filter dropdown, chip bar)
* so option labels, colors, and the owning-definition mapping stay in sync.
*/
diff --git a/apps/web/src/features/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx b/apps/web/src/features/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
index d443f437cc..fef223405f 100644
--- a/apps/web/src/features/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
+++ b/apps/web/src/features/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
@@ -820,9 +820,7 @@ export const UnifiedFilterDropdown = (
const tagFilter = useTagFilter();
const showTagsFilter = () =>
- tagFilter.enabled() &&
- tagFilter.hasTags() &&
- (isTasksView() || isDocumentsView());
+ tagFilter.hasTags() && (isTasksView() || isDocumentsView());
registerHotkey({
hotkey: 'f',
diff --git a/apps/web/src/features/next-soup/soup-view/filters-bar/use-filter-refinements.tsx b/apps/web/src/features/next-soup/soup-view/filters-bar/use-filter-refinements.tsx
index 22033737a2..a142f0ad67 100644
--- a/apps/web/src/features/next-soup/soup-view/filters-bar/use-filter-refinements.tsx
+++ b/apps/web/src/features/next-soup/soup-view/filters-bar/use-filter-refinements.tsx
@@ -686,7 +686,7 @@ export function useFilterRefinements() {
// Tags chip (consolidated, searchable) for the documents/tasks views.
const pushTagsConsolidatedChip = () => {
if (view !== 'tasks' && view !== 'documents') return;
- if (!tagFilter.enabled() || !tagFilter.hasTags()) return;
+ if (!tagFilter.hasTags()) return;
const key = 'tags';
const popupOpen =
diff --git a/apps/web/src/features/next-soup/soup-view/soup-entity-context-menu.tsx b/apps/web/src/features/next-soup/soup-view/soup-entity-context-menu.tsx
index c2fa7e1baf..4f22e7a0c2 100644
--- a/apps/web/src/features/next-soup/soup-view/soup-entity-context-menu.tsx
+++ b/apps/web/src/features/next-soup/soup-view/soup-entity-context-menu.tsx
@@ -15,7 +15,6 @@ import {
Switch,
} from 'solid-js';
import { match } from 'ts-pattern';
-import { useRowTagsVisible } from './filters-bar/search/search-tags-flag';
import { useSoupEntityActionDrawer } from './soup-entity-action-drawer-context';
import { SoupEntityActionsMenu } from './soup-entity-actions-menu';
import { useSoupView } from './soup-view-context';
@@ -67,7 +66,6 @@ export const SoupEntityContextMenu: FlowComponent<
> = (props) => {
const { soup } = useSoupView();
const drawerManager = useSoupEntityActionDrawer();
- const rowTagsVisible = useRowTagsVisible();
const [tagPickerOpen, setTagPickerOpen] = createSignal(false);
const [menuPosition, setMenuPosition] = createSignal<{
@@ -85,8 +83,7 @@ export const SoupEntityContextMenu: FlowComponent<
return [props.entity];
};
- const canEditTags = () =>
- rowTagsVisible() && tagEntityType(props.entity) !== undefined;
+ const canEditTags = () => tagEntityType(props.entity) !== undefined;
return (
<Switch>
diff --git a/apps/web/src/features/next-soup/soup-view/soup-view.tsx b/apps/web/src/features/next-soup/soup-view/soup-view.tsx
index ba81f52896..58818c468d 100644
--- a/apps/web/src/features/next-soup/soup-view/soup-view.tsx
+++ b/apps/web/src/features/next-soup/soup-view/soup-view.tsx
@@ -145,7 +145,6 @@ import {
import { Dynamic } from 'solid-js/web';
import { Virtualizer, type VirtualizerHandle } from 'virtua/solid';
import type { CacheSnapshot } from 'virtua/unstable_core';
-import { useSearchTagsFlag } from './filters-bar/search/search-tags-flag';
import { SoupEntitySelectionToolbar } from './soup-entity-selection-toolbar';
import { useSoupNavigationHotkeys } from './use-soup-navigation-hotkeys';
import { useSoupViewHotkeys } from './use-soup-view-hotkeys';
@@ -361,23 +360,6 @@ export const SoupView = (props: SoupViewProps) => {
| boolean
| undefined;
- const searchTags = useSearchTagsFlag();
-
- // The search view must not initialize with tag filters while the rollout
- // flag is off. Raw readers (soup AST body, search request, WS insert guard)
- // consume queryFilters directly, so restored or param-provided tag filters
- // have to be stripped at the source, not scrubbed after the fact.
- const stripGatedTagFilters = (
- query: Query | undefined
- ): Query | undefined => {
- if (contentId !== 'search' || searchTags()) return query;
- if (!query?.include?.tagFilters?.length) return query;
- const include = { ...query.include };
- delete include.tagFilters;
- delete include.tagFilterMode;
- return { ...query, include };
- };
-
const persistedFilters = entryState?.['search.filters'] as Query | undefined;
const persistedPredicates = entryState?.['search.predicates'] as
@@ -439,11 +421,9 @@ export const SoupView = (props: SoupViewProps) => {
);
soupView.initialize({
- initialQuery: stripGatedTagFilters(
- initialCrmView
- ? (initialCrmView.filters as Query | undefined)
- : (persistedFilters ?? props.initialFilters)
- ),
+ initialQuery: initialCrmView
+ ? (initialCrmView.filters as Query | undefined)
+ : (persistedFilters ?? props.initialFilters),
initialClientFilters: initialCrmView
? (initialCrmView.clientFilters ?? {})
: (persistedPredicates ?? props.initialClientFilters),
diff --git a/apps/web/src/features/property/side-panel/properties/EntityPropertiesSection.tsx b/apps/web/src/features/property/side-panel/properties/EntityPropertiesSection.tsx
index 6bf3507834..fc68d8dcb3 100644
--- a/apps/web/src/features/property/side-panel/properties/EntityPropertiesSection.tsx
+++ b/apps/web/src/features/property/side-panel/properties/EntityPropertiesSection.tsx
@@ -1,14 +1,9 @@
-import { useFeatureFlag } from '@app/lib/analytics/posthog';
import { SidePanel } from '@components/app/side-panel/SidePanel';
import type { BlockAlias, BlockName } from '@core/block';
import { PopupPreview } from '@core/component/DocumentPreview';
import { HoverCard } from '@core/component/HoverCard';
import { openDocument } from '@core/component/LexicalMarkdown/component/core/BlockLink';
import { itemToBlockName } from '@core/constant/allBlocks';
-import {
- ENABLE_TAGS_FE_FLAG,
- ENABLE_TAGS_FE_OVERRIDE,
-} from '@core/constant/featureFlags';
import { useSplitNavigationHandler } from '@core/util/useSplitNavigationHandler';
import Plus from '@phosphor/plus.svg';
import DeleteIcon from '@phosphor/x.svg';
@@ -88,15 +83,10 @@ const TAGGABLE_ENTITY_TYPES: ReadonlySet<EntityType> = new Set<EntityType>([
]);
export function EntityTagsSection(props: EntityTagsSectionProps) {
- const tagsFlag = useFeatureFlag(ENABLE_TAGS_FE_FLAG, {
- enabledOverride: ENABLE_TAGS_FE_OVERRIDE,
- });
const tagsQuery = useTagsQuery();
return (
- <Show
- when={tagsFlag().enabled && TAGGABLE_ENTITY_TYPES.has(props.entityType)}
- >
+ <Show when={TAGGABLE_ENTITY_TYPES.has(props.entityType)}>
<SidePanel.Section id="tags" title="Tags" defaultOpen order={props.order}>
<Show
when={!tagsQuery.isError}
@@ -127,10 +117,6 @@ export function EntityPropertiesSection(props: EntityPropertiesSectionProps) {
props.includeMetadata ?? false
);
- const tagsFlag = useFeatureFlag(ENABLE_TAGS_FE_FLAG, {
- enabledOverride: ENABLE_TAGS_FE_OVERRIDE,
- });
-
const tagsQuery = useTagsQuery();
const tagDefinitionIds = createMemo(
() =>
@@ -280,7 +266,6 @@ export function EntityPropertiesSection(props: EntityPropertiesSectionProps) {
<Show
when={
- tagsFlag().enabled &&
props.showTags !== false &&
TAGGABLE_ENTITY_TYPES.has(props.entityType)
}
diff --git a/apps/web/src/lib/core/constant/featureFlags.ts b/apps/web/src/lib/core/constant/featureFlags.ts
index 2f3543cfaf..c4745ba1b4 100644
--- a/apps/web/src/lib/core/constant/featureFlags.ts
+++ b/apps/web/src/lib/core/constant/featureFlags.ts
@@ -530,18 +530,6 @@ export function ENABLE_NEW_INBOX() {
return analytics.posthog.isFeatureEnabled(ENABLE_NEW_INBOX_FLAG) ?? false;
}
-export const ENABLE_TAGS_FE_FLAG = 'enable-tags-fe';
-export const ENABLE_TAGS_FE_OVERRIDE =
- resolveFeatureFlag('ENABLE_TAGS_FE', DEV_MODE_ENV) || undefined;
-
-// Narrow rollout gate for the search-view tag surfaces (facet row + row
-// chips), layered on top of enable-tags-fe. PostHog-controlled per
-// environment with a dev-mode default. Override with
-// VITE_ENABLE_TAGS_SEARCH_FE.
-export const ENABLE_TAGS_SEARCH_FE_FLAG = 'enable-tags-search-fe';
-export const ENABLE_TAGS_SEARCH_FE_OVERRIDE =
- resolveFeatureFlag('ENABLE_TAGS_SEARCH_FE', DEV_MODE_ENV) || undefined;
-
// Channel mode where replying and editing do not happen inline, but in a single unified input instead.
export const UNIFIED_CHANNEL_INPUT = resolveFeatureFlag(
'UNIFIED_CHANNEL_INPUT',