Skip to content

Commit

Permalink
Merge branch 'main' into feature/migrate-to-generalized-bigtext
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny-chung committed Feb 1, 2025
2 parents 8c01188 + a09bbc5 commit 2c5dac4
Show file tree
Hide file tree
Showing 20 changed files with 1,670 additions and 23 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
Nothing yet.


## [1.7.1] -- 2025-01-10

_Changes since 1.7.0_

### Changed
- After clicking "Copy All" in the response viewer, the copied text now uses the Heading 2 style (`-------`) instead of the Heading 1 style (`=======`). This facilitates embedding multiple requests and responses in the same Markdown document.

### Fixed
- Crash during project import if a file is not selected or there is an error (#2)
- Double hit the enter key in Code Editor would incorrectly add an extra blank line and reset cursor to the start of the line
- Line number of text fields incorrectly appeared and was bouncing if the line is long and partially left the screen


## [1.7.0] -- 2024-12-05

_Changes since 1.6.0_
Expand Down
30 changes: 15 additions & 15 deletions doc/features/viewing-responses.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The copied text is in a markdown-like format for readability.
Sample of copied text of a simple HTTP call:
``````markdown
Request
=======
-------
Start Time: 2024-02-18 23:33:31.426 (+08:00)

HTTP/2.0
Expand All @@ -88,7 +88,7 @@ Body:
`````

Response
========
--------
Completion Time: 2024-02-18 23:33:32.545 (+08:00)

Duration: 1.119s
Expand Down Expand Up @@ -137,7 +137,7 @@ Body:
Sample of copied text of a GraphQL subscription call:
``````markdown
Request
=======
-------
Start Time: 2024-02-18 23:35:03.259 (+08:00)

HTTP/1.1
Expand All @@ -155,7 +155,7 @@ User-Agent: Hello-HTTP/1.5.0-SNAPSHOT
`````

Response
========
--------
Status Code: 101 Switching Protocols

Headers:
Expand All @@ -166,7 +166,7 @@ upgrade: websocket
`````

Incoming #1
===========
-----------
Time: 2024-02-18 23:35:03.428 (+08:00)

Body:
Expand All @@ -176,7 +176,7 @@ Body:


Incoming #2
===========
-----------
Time: 2024-02-18 23:35:04.431 (+08:00)

Body:
Expand All @@ -186,7 +186,7 @@ Body:


Incoming #3
===========
-----------
Time: 2024-02-18 23:35:05.437 (+08:00)

Body:
Expand All @@ -196,7 +196,7 @@ Body:


Incoming #4
===========
-----------
Time: 2024-02-18 23:35:06.439 (+08:00)

Body:
Expand All @@ -206,7 +206,7 @@ Body:


End
===
---
Completion Time: 2024-02-18 23:35:06.441 (+08:00)

Duration: 3.182s
Expand All @@ -218,7 +218,7 @@ Closed by us with code 1000
Sample of copied text of a gRPC bidirectional call:
``````markdown
Request
=======
-------
Start Time: 2024-02-18 23:49:43.670 (+08:00)

HTTP/2.0
Expand All @@ -238,7 +238,7 @@ grpc-accept-encoding: gzip
`````

Outgoing #1
===========
-----------
Time: 2024-02-18 23:49:44.882 (+08:00)

Body:
Expand All @@ -250,7 +250,7 @@ Body:


Incoming #1
===========
-----------
Time: 2024-02-18 23:49:44.884 (+08:00)

Body:
Expand All @@ -262,7 +262,7 @@ Body:


Outgoing #2
===========
-----------
Time: 2024-02-18 23:49:46.415 (+08:00)

Body:
Expand All @@ -274,7 +274,7 @@ Body:


Incoming #2
===========
-----------
Time: 2024-02-18 23:49:46.417 (+08:00)

Body:
Expand All @@ -286,7 +286,7 @@ Body:


End
===
---
Completion Time: 2024-02-18 23:49:47.105 (+08:00)

Duration: 3.435s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ fun UserResponse.describeApplicationLayer() =
when {
payloadExchanges == null -> """
Request
=======
-------
Start Time: ${startAt?.atZoneOffset(KZoneOffset.local())?.format(TIME_FORMAT) ?: "-"}
${protocol?.toString().orEmpty()}
Expand Down Expand Up @@ -225,7 +225,7 @@ $BODY_BLOCK_DELIMITER${
""" } else ""
}Response
========
--------
${
if (endAt != null) {
"""Completion Time: ${endAt?.atZoneOffset(KZoneOffset.local())?.format(TIME_FORMAT) ?: "-"}
Expand Down Expand Up @@ -255,7 +255,7 @@ $BODY_BLOCK_DELIMITER
payloadExchanges != null -> buildString {
append("""
Request
=======
-------
Start Time: ${startAt?.atZoneOffset(KZoneOffset.local())?.format(TIME_FORMAT) ?: "-"}
${protocol?.toString().orEmpty()}
Expand All @@ -278,7 +278,7 @@ $BODY_BLOCK_DELIMITER
append("\n\n")
append("""
Response
========
--------
Status Code: ${statusCode ?: "-"}${statusText?.let { " $it" } ?: ""}
Headers:
Expand All @@ -298,7 +298,7 @@ $BODY_BLOCK_DELIMITER
"Outgoing #${++outgoingCount}"
}
append("\n\n", title, "\n")
append("=".repeat(title.length), "\n")
append("-".repeat(title.length), "\n")
append("Time: ${it.instant.atZoneOffset(KZoneOffset.local()).format(TIME_FORMAT)}\n\n")
append("Body:\n$BODY_BLOCK_DELIMITER\n")
append(it.data?.decodeToString()?.endWithNewLine().orEmpty())
Expand All @@ -309,7 +309,7 @@ $BODY_BLOCK_DELIMITER
if (endAt != null) {
append("\n\n", """
End
===
---
Completion Time: ${endAt?.atZoneOffset(KZoneOffset.local())?.format(TIME_FORMAT) ?: "-"}
Duration: ${String.format("%.3f", (endAt!! - startAt!!).millis / 1000.0)}s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,10 @@ private fun CoreLineNumbersView(
) {
var ii: Int = firstRow
var lastLineIndex = -1
if (firstRow > 0) {
val lineBeforeFirstRow = rowToLineIndex(firstRow - 1)
lastLineIndex = lineBeforeFirstRow
}
while (ii < lastRow) {
val i: Int = ii // `ii` is passed by ref
val lineIndex = rowToLineIndex(i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ class JsonSyntaxHighlightLinearDecorator(colours: AppColor) : CacheableBigTextDe
// }

timeAndLog(Severity.Info, "parse linear json 3") {
val bytes = ByteArray(text.length)
text.forEachIndexed { i, c -> bytes[i] = c.code.coerceIn(0, 126).toByte() }
val bytes = ByteArray(text.length) { i ->
text[i].code.coerceIn(0, 126).toByte()
}
try {
val reader = parser.newReader().process(bytes, bytes.size)
reader.nextToken
Expand Down
1,518 changes: 1,518 additions & 0 deletions test-data-archive/1.7.1/app-data-backup.dump

Large diffs are not rendered by default.

Binary file not shown.
1 change: 1 addition & 0 deletions test-data-archive/1.7.1/app-data/operational.db
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello-http;1;�bid�dtypekOperational�ddata�jappVersione1.7.1ninstallationIdx$bcdf8d9a-55fb-416b-8820-7a114746dddc��
1 change: 1 addition & 0 deletions test-data-archive/1.7.1/app-data/preference.db
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello-http;1;�bid�dtypenUserPreference�jpreference�kcolourThemedDarksbackupRetentionDays�x"preferredRenderingApi_Experimental���
35 changes: 35 additions & 0 deletions test-data-archive/1.7.1/app-data/projects.db
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
hello-http;1;�bid�dtypevProjectAndEnvironments�hprojects��bidx$9b4b1a0b-a781-425f-b8ed-0ecdf17bb4a7dnamekTest Serverksubprojects��bidx$c8a34a83-3bc2-4eeb-ad45-07617f74db61dnameiHTTP onlyktreeObjects��gRequest�bidx$0b6eecf3-32a1-4d31-9e8a-d4ab2778217e���gRequest�bidx$f5317636-09cf-4a29-b86e-65aa509f9e66���gRequest�bidx$aa002684-7dd0-4a4c-b4b4-1402f0f035bc���gRequest�bidx$7cab69e4-2da2-4ffb-8952-0d5e8830c048���gRequest�bidx$969879c7-8e29-4e1b-954a-aae5c7683f11���gRequest�bidx$b84272cd-dc1f-4fa2-9fdc-2f93c7f7aa9f���gRequest�bidx$9a187398-2e7a-41d8-a76c-2daaeecaf54f���lenvironments��bidx$6723d734-66b2-461e-8f4b-0ee63dffdcf9dnamenHTTP Cleartextivariables��bidx$c25bdc36-84f0-47dd-aa83-71cc1b879ad7ckeyfprefixevaluexhttp://testserver.net:18081ivalueTypefStringiisEnabled���bidx$e0af8a2f-1d06-4086-a429-94bff31f6c3eckeyflengthevaluec455ivalueTypefStringiisEnabled���bidx$cb24b215-646f-4725-a5b5-95fe171abbc0ckeyfmethodevaluecGETivalueTypefStringiisEnabled���jhttpConfig�oprotocolVersion��isslConfig�jisInsecure�utrustedCaCertificates��xisDisableSystemCaCertificates�xclientCertificateKeyPairs���iuserFiles����bidx$7a087652-0a96-4645-b3c7-ae6df40a79cednamepHTTP/2 Cleartextivariables��bidx$a6bfca64-f94c-482a-8a48-2c07a46d3354ckeygprefix2evaluexhttp://testserver.net:18081ivalueTypefStringiisEnabled���jhttpConfig�oprotocolVersioniHttp2Only�isslConfig�jisInsecure�utrustedCaCertificates��xisDisableSystemCaCertificates�xclientCertificateKeyPairs���iuserFiles����bidx$8eaccd36-1ffd-4ef4-805f-8eb38ade7274dnamesHTTP/1 SSL Insecureivariables��bidx$a3116e1d-cf86-486e-bbd8-4cd72b931a8eckeyfprefixevaluexhttps://testserver.net:18084ivalueTypefStringiisEnabled���bidx$af0d2ab9-ced8-47dc-adfd-244a19c0bb81ckeyclenevaluec872ivalueTypefStringiisEnabled���bidx$d4b829b2-d23a-4ff0-85a7-f419749f50e3ckeycmetevaluedPOSTivalueTypefStringiisEnabled���bidx$4350afb2-1497-43d5-bba9-98acc3e0c8aeckeydtypeevaluepapplication/jsonivalueTypefStringiisEnabled���jhttpConfig�oprotocolVersioniHttp1Only�isslConfig�jisInsecure�utrustedCaCertificates��xisDisableSystemCaCertificates�xclientCertificateKeyPairs���iuserFiles����bidx$d84fd98f-ddf0-432d-931c-d1631a150a8adnamepHTTP/2 SSL Trustivariables��bidx$600e0650-1454-4570-a676-62a8cca01d90ckeygprefix2evaluexhttps://testserver.net:18084ivalueTypefStringiisEnabled���jhttpConfig�oprotocolVersioniNegotiate�isslConfig�jisInsecure�utrustedCaCertificates��bidx$f81913ee-182d-4d01-8dff-bdce8a7cd06cdnamexyCN=Test Server CA, OU=CompanySectionName, O=CompanyName, L=CityName, ST=StateName, C=XX
Expiry: 2034-05-24T12:29:24+08:00poriginalFilenamepserverCACert.pemkcreatedWhenx2024-07-05T14:32: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htfgkZJnhSyp/dg4e
dlTTYvRltDidsn/c1GyCqmMu6/svH3O+ii2nUgrPy2tPFbztydb51y+SpnBWivM5
1mm0O1z8xgfdVZOsqLfK9TalImwjfBKYqplBdDiQBY+WuYuQi9Zf1m2rxcEkENEo
UfMR4fJ3dVx1Yw7miEkCAwEAAaMmMCQwEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNV
HQ8BAf8EBAMCAoQwDQYJKoZIhvcNAQELBQADggIBAB/WwuMd3zgflz6vb63YHilt
Or6pCc93Ii0e2W7x8FpI7tdhrnKmk+xxtbl6prPm/h1WbMI2XLeagLISKAnZ2GaQ
i/6JKjxp5WkFCqIZAZ6C/G8lky7adt5CYdzTYaCGTWpFbYT/VaTKBEZa7bPnthqK
iALT0hUHCJy3XqOvs+7nsi7X0w3KYbcW9Gald/Qo6cBt8NbtPZwSfe6BcesAevty
EtEv+GBXHchrIiiW/yLKi5LzV3QPPv7e7lb9PQHz0EBErpgM6ato6yd+UuHt5VS2
plY5UL5FLz2BAGMi68bPr0Jql3DFoTe+VItO63X6p671RhNNt3oCAbPlDi2VTggI
AgGla7DreRJIc7u/+eHoZJleGCfQBcyyZRCkyk0nCoFkimmooVNB4WnLrkDw0S0E
Lq6vqAZwYiOiJu0dZzZWinQC5Da/6gKyzHasLj0oO2vdcopHgBLu27iDeHr+7nc/
i+2ubSsamhG9ZeKW2asSo/FGc4ithr/xzm4cWttkhAtnaLaS/VJJ/cZIAAz4DBXs
ZLlAYnXVdH3EI4gukByJrzcFYx2k73ztvxWpZiOKUpm3LOrLBscjXP2qTs8jB+Hm
VAs6wzHxdiZzpDYxmjou9MbVWzX4/2hh5NT7Jaf6FiC289Qg4G75FVB1r8ZyQbtu
5XQHMgcQjelbCZdPSoV5
-----END CERTIFICATE-----
���xisDisableSystemCaCertificates�xclientCertificateKeyPairs���iuserFiles����mconfiguration�bidx$781c0c37-5817-4456-a882-49c59a0d61fclsubprojectIdx$188d0c73-37c8-4438-ae20-e1be0aa1cbb7xoutboundPayloadStorageLimit xinboundPayloadStorageLimit x*accumulatedOutboundDataStorageLimitPerCall x)accumulatedInboundDataStorageLimitPerCall �ngrpcApiSpecIds����bidx$e17e1dec-77c5-444c-b2c2-f8685ae8a71ednameigRPC onlyktreeObjects��gRequest�bidx$03095dbe-3c14-499b-b49f-47b6287d79c9���gRequest�bidx$166aae74-3a98-4a4d-9c77-80728ea10410���gRequest�bidx$cc9f6843-ab16-40c4-af34-cc1800a31934���gRequest�bidx$fbc3b853-1844-4b33-990b-2db367dabae6���gRequest�bidx$06b76c0c-4ff0-4ff0-b888-1123b5ac1968���gRequest�bidx$9da5d059-a743-4767-8d15-4ceffbdb4ac8���gRequest�bidx$e2136f5f-7a61-45a7-b470-b5b4a438a473���lenvironments��bidx$6afbb7bd-c03e-4518-87f0-5764539f7935dnamehInsecureivariables��bidx$850a2651-0a82-4975-9b4e-f492923ec4c6ckeydgrpcevaluexgrpc://testserver.net:18082/ivalueTypefStringiisEnabled���jhttpConfig�oprotocolVersion��isslConfig�jisInsecure�utrustedCaCertificates��xisDisableSystemCaCertificates�xclientCertificateKeyPairs���iuserFiles����mconfiguration�bidx$5bcc5365-2b62-48a5-a054-afb1298dbfb0lsubprojectIdx$42090d33-bac8-4265-9eb9-17dd5ef41f7fxoutboundPayloadStorageLimit xinboundPayloadStorageLimit x*accumulatedOutboundDataStorageLimitPerCall x)accumulatedInboundDataStorageLimitPerCall �ngrpcApiSpecIds�x$57ae4a5a-c84d-47b9-b789-947344f88c09���bidx$6ca612af-0f02-4aca-ad96-ffe75ce3ae76dnamekWithout EnvktreeObjects��gRequest�bidx$fc259d4c-9b24-4444-a440-d7d333a387fd���lenvironments��mconfiguration�bidx$589c4ef2-3953-437f-b61d-e4035a7dca09lsubprojectIdx$a0a27664-d382-4ded-9973-7da12dc83b31xoutboundPayloadStorageLimit xinboundPayloadStorageLimit x*accumulatedOutboundDataStorageLimitPerCall x)accumulatedInboundDataStorageLimitPerCall �ngrpcApiSpecIds����bidx$f9a8a433-bb89-4a9f-b93b-4e70b2f1af6cdnamepWithout RequestsktreeObjects��lenvironments��mconfiguration�bidx$853064cb-ff2e-4b8c-9c9a-e56340062af8lsubprojectIdx$9f308599-ba55-480f-a423-ccd4a81a6747xoutboundPayloadStorageLimit xinboundPayloadStorageLimit x*accumulatedOutboundDataStorageLimitPerCall x)accumulatedInboundDataStorageLimitPerCall �ngrpcApiSpecIds����bidx$ef415715-d7b9-446b-a6ea-aefa71dc0974dnamesMixed Request TypesktreeObjects��gRequest�bidx$cc945cd9-9deb-4c37-a507-3b23ae441848���gRequest�bidx$b05a990c-c23d-43cd-93ab-51b162c84669���gRequest�bidx$b089e7be-a3a3-4182-bfdf-29e4eb42c32c���gRequest�bidx$6bb5e934-aed0-458f-ae2c-e61b3bcd9646���gRequest�bidx$5352caf4-3c31-436f-9f40-42fa6cf5a103���gRequest�bidx$42427dca-914d-412b-9068-c74fc37ca4f4���gRequest�bidx$e6034bb6-37d3-46fd-be5a-25062a15c8f3���lenvironments��bidx$2fc2ba1a-dfc4-4bec-b52d-e09cb9fe1eeddnameiCleartextivariables��bidx$c84c1b3f-28ed-427f-963d-193082b11712ckeyfprefixevaluexhttp://testserver.net:18081ivalueTypefStringiisEnabled���bidx$0c1f70e5-aa6e-4083-92d5-b507d8582e3ackeybwsevaluexws://testserver.net:18081/wsivalueTypefStringiisEnabled���bidx$d4eb1b5a-1b41-4d7e-a903-15cef081aea6ckeydgrpcevaluexgrpc://testserver.net:18082ivalueTypefStringiisEnabled���jhttpConfig�oprotocolVersion��isslConfig�jisInsecure�utrustedCaCertificates��xisDisableSystemCaCertificates�xclientCertificateKeyPairs���iuserFiles����mconfiguration�bidx$d9c3e200-f729-4da0-a4e0-6d392898e5c1lsubprojectIdx$74ce4062-6fc9-493b-a520-7890849c5f2cxoutboundPayloadStorageLimit xinboundPayloadStorageLimit x*accumulatedOutboundDataStorageLimitPerCall x)accumulatedInboundDataStorageLimitPerCall �ngrpcApiSpecIds�x$2d4ccadc-c0d2-43a7-ab7e-a4e9f293f0e1�����bidx$266b1f24-ea96-4b05-beda-2d1159579434dnamemEmpty Projectksubprojects�����
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hello-http;1;�bid�dtypehRequestslsubprojectIdx$6ca612af-0f02-4aca-ad96-ffe75ce3ae76�hrequests��bidx$fc259d4c-9b24-4444-a440-d7d333a387fddnamekNew RequestkapplicationdHttpfmethoddPOSTcurlx%http://testserver.net:18081/rest/echodgrpc�hexamples��bidx$59729c2c-baca-49e9-892b-408a4322e14ednamedBasekcontentTypedJsongheaders��bidx$b322167e-bac4-42d9-ba0e-6c773256595fckeyaaevaluebvaivalueTypefStringiisEnabled���oqueryParameters��dbody�jStringBody�evalueq{
"data": 123
}��ivariables��ipreFlight�kexecuteCode`�jpostFlight�xupdateVariablesFromHeader��wupdateVariablesFromBody���ioverrides���bidx$b8936a4a-05e4-483e-b098-735ee779b12adnamehOverridekcontentTypedJsongheaders��oqueryParameters��dbody�jStringBody�evalues{
"def": "gh"
}��ivariables��ipreFlight�kexecuteCode`�jpostFlight�xupdateVariablesFromHeader��wupdateVariablesFromBody���ioverrides�qdisabledHeaderIds��xdisabledQueryParameterIds��qdisabledVariables��nisOverrideBody�uisOverrideBodyContent�wisOverrideBodyVariables�wdisabledBodyKeyValueIds��xisOverridePreFlightScript�xdisablePostFlightUpdateVarIds�����opayloadExamples����
Loading

0 comments on commit 2c5dac4

Please sign in to comment.