Skip to content

feat(Environment Picker): Simplify the environment picker UX#8005

Merged
gatzjames merged 8 commits into
Kong:developfrom
gatzjames:feat/environment-picker-ux-improvements
Sep 27, 2024
Merged

feat(Environment Picker): Simplify the environment picker UX#8005
gatzjames merged 8 commits into
Kong:developfrom
gatzjames:feat/environment-picker-ux-improvements

Conversation

@gatzjames
Copy link
Copy Markdown
Contributor

@gatzjames gatzjames commented Sep 25, 2024

Highlights:

  • Updates the environment picker to have a simpler UX and make it easier to understand the order environments are applied
Before After
image image

Closes INS-4488

Comment on lines +37 to +42
const collectionEnvironmentList = [...subEnvironments].map(({ type, ...environment }) => ({ ...environment, id: environment._id, isBase: environment._id === baseEnvironment._id }));

const selectedGlobalBaseEnvironmentId = activeGlobalEnvironment?.parentId.startsWith('wrk') ? activeGlobalEnvironment._id : activeGlobalEnvironment?.parentId;
const selectedGlobalBaseEnvironment = globalBaseEnvironments.find(e => e._id === selectedGlobalBaseEnvironmentId);

const globalEnvironmentList = selectedGlobalBaseEnvironment ? [selectedGlobalBaseEnvironment, ...globalSubEnvironments.filter(e => e.parentId === selectedGlobalBaseEnvironment._id)].map(({ type, ...subenvironment }) => ({ ...subenvironment, id: subenvironment._id, isBase: subenvironment._id === selectedGlobalBaseEnvironment._id })) : [];
const globalEnvironmentList = selectedGlobalBaseEnvironment ? [...globalSubEnvironments.filter(e => e.parentId === selectedGlobalBaseEnvironment._id)].map(({ type, ...subenvironment }) => ({ ...subenvironment, id: subenvironment._id, isBase: subenvironment._id === selectedGlobalBaseEnvironment._id })) : [];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤯

@gatzjames gatzjames force-pushed the feat/environment-picker-ux-improvements branch from c7d7491 to bd9195d Compare September 25, 2024 16:12
@gatzjames gatzjames self-assigned this Sep 25, 2024
@gatzjames gatzjames force-pushed the feat/environment-picker-ux-improvements branch from bf8da48 to 865c37a Compare September 26, 2024 13:45
Comment thread packages/insomnia/src/ui/components/environment-picker.tsx Outdated
Co-authored-by: Jack Kavanagh <jackkav@gmail.com>
Comment thread packages/insomnia/src/ui/components/environment-picker.tsx Outdated
filfreire
filfreire previously approved these changes Sep 27, 2024
@gatzjames gatzjames enabled auto-merge (squash) September 27, 2024 12:35
@gatzjames gatzjames merged commit e1cb05d into Kong:develop Sep 27, 2024
@gatzjames gatzjames deleted the feat/environment-picker-ux-improvements branch September 27, 2024 12:40
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.

3 participants