mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 08:45:58 +03:00
[PR #2917] [MERGED] feat: active tab no longer resets after request #4136
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#4136
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/2917
Author: @aitchnyu
Created: 2/3/2023
Status: ✅ Merged
Merged: 2/8/2023
Merged by: @AndrewBastin
Base:
main← Head:feat-2080-refactor📝 Commits (8)
463aa38feat: active tab no longer resets after requestfb038cdchore: convert modified components to setup6e6d67echore: moved to localpersistence0dc9cafrefactor: tighten the types for REST response componentsafdccffrefactor: renamed wrong name, simplified confusing logicb468414refactor: revert back tab remember mechanism to not use local storage0a1e428refactor: update name to1fb56c5chore: remove unhelpful comments📊 Changes
6 files changed (+93 additions, -74 deletions)
View changed files
📝
packages/hoppscotch-common/src/components/http/Response.vue(+14 -22)📝
packages/hoppscotch-common/src/components/http/ResponseMeta.vue(+3 -1)📝
packages/hoppscotch-common/src/components/lenses/HeadersRenderer.vue(+2 -2)📝
packages/hoppscotch-common/src/components/lenses/HeadersRendererEntry.vue(+2 -2)📝
packages/hoppscotch-common/src/components/lenses/ResponseBodyRenderer.vue(+68 -45)📝
packages/hoppscotch-common/src/helpers/types/HoppRESTResponse.ts(+4 -2)📄 Description
Closes #2080
Intended to be follow up of https://github.com/hoppscotch/hoppscotch/pull/2915
Description
[Excerpt from #2915]
When the ResponseBodyRenderer component renders for each request, the active tab (json, raw etc) is always set to the first one. Users prefer if same tab is persisted. So I moved tab preferences from ResponseBodyRenderer to parent so it loads with previously opened tab.
ResponseBodyRenderer had response props of
{ type: Object, default: () => ({}) }. Updated to{ type: Object as PropType<HoppRESTResponse> | null }instead.Which uncovered that
headersprop inHeadersRendererEntry.vueandheaderprop inHeadersRenderer.vuewere wrongly given asHoppRESTHeader(it has key, value, active properties). Updated those to theHoppRESTResponseHeaderKVtype.In
ResponseMeta.vueresponse prop was updated toHoppRESTResponse | null. Updated the code so tsc finds the null checks ok.Checks
Additional Information
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
vitest#4895