Skip to content

feat(flags): hide flags from context and add feedback button #77488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion static/app/components/events/contexts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export function getOrderedContextItems(event: Event): ContextItem[] {
const {user, contexts} = event;
const {data: customUserData, ...userContext} = user ?? {};

const {feedback, response, ...otherContexts} = contexts ?? {};
// don't show `flags` in the contexts section
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const {feedback, response, flags, ...otherContexts} = contexts ?? {};
const orderedContext: [ContextItem['alias'], ContextValue][] = [
['response', response],
['feedback', feedback],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ import useDrawer from 'sentry/components/globalDrawer';
import KeyValueData, {
type KeyValueDataContentProps,
} from 'sentry/components/keyValueData';
import {IconSort} from 'sentry/icons';
import {IconMegaphone, IconSort} from 'sentry/icons';
import {t} from 'sentry/locale';
import type {Event, FeatureFlag} from 'sentry/types/event';
import type {Group} from 'sentry/types/group';
import type {Project} from 'sentry/types/project';
import {useFeedbackForm} from 'sentry/utils/useFeedbackForm';
import {InterimSection} from 'sentry/views/issueDetails/streamline/interimSection';

export function EventFeatureFlagList({
Expand All @@ -32,6 +33,26 @@ export function EventFeatureFlagList({
group: Group;
project: Project;
}) {
const openForm = useFeedbackForm();
const feedbackButton = openForm ? (
<Button
aria-label={t('Give feedback on this component')}
icon={<IconMegaphone />}
size={'xs'}
onClick={() =>
openForm({
messagePlaceholder: t('How can we make feature flags work better for you?'),
tags: {
['feedback.source']: 'issue_details_feature_flags',
['feedback.owner']: 'replay',
},
})
}
>
{t('Give Feedback')}
Copy link
Member

Choose a reason for hiding this comment

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

Hmm I find all this text clutters and takes away focus from the other buttons, but this is what we do for breadcrumbs so ¯_(ツ)_/¯

Copy link
Member Author

Choose a reason for hiding this comment

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

would it help if the button was on the far right?🤔
SCR-20240913-kjmy

Copy link
Member

Choose a reason for hiding this comment

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

Hmm I think on left is better and aligns with what we have for breadcrumb

Copy link
Member Author

Choose a reason for hiding this comment

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

cool, i kept it that way!

</Button>
) : null;

const [sortMethod, setSortMethod] = useState<FlagSort>(FlagSort.EVAL);
const {closeDrawer, isDrawerOpen, openDrawer} = useDrawer();
const viewAllButtonRef = useRef<HTMLButtonElement>(null);
Expand Down Expand Up @@ -96,6 +117,7 @@ export function EventFeatureFlagList({

const actions = (
<ButtonBar gap={1}>
{feedbackButton}
<Button
size="xs"
aria-label={t('View All')}
Expand Down
Loading