Code Monkey home page Code Monkey logo

everything-okjson's People

Contributors

francisfeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

everything-okjson's Issues

Change tab name

Is your feature request related to a problem? Please describe.
I have up to 10 tabs open and need look to each to know witch one it is

Describe the solution you'd like
be able to a double clic on the tab to change name

thanks in advance I love your app

修改数据后, Command+F 搜索还是会定位到上次数据的位置

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Please add editing support

Hi! Saw the other bug i filed was closed (and that main issue was fixed) and you're right... my tone may not have been the best tact to bring this up. As promised, I went ahead and reworded it to the below while also raising it from two to four stars, and I specifically called out how fast you were in addressing the needs. I also reworded the bulk in a more 'helpful' manner.

Since I wasn't sure you'd get notified on 'closed' issues here, I'm opening this new one with the revised/updated text. Same issues but I hope you agree a major improvement in its tone. That and I do hope you consider implementing some of the functionality I describe.

== Updated Review ==

TITLE: Impressive start, albeit missing a few key features that just keep it from being perfect five stars.

For quite a while., I've been looking for a simple, native JSON editor. Not one that was integrated into something like VS Code or other tools, but a true, native macOS app.

I came across this one in my search and it has the potential to fit that need perfectly! Easily one of the best-looking ones I've seen to date. It's clean, seems very performant, and has the ability to run custom scripts against the JSON, something not seen in most others.

However, there are a few nagging issues that keep it from receiving the five-star review that it's quite capable of becoming.

The first, and by far the biggest is when I installed it, the text editor was not working. It was simply blank. You could see the tree on the left as expected, but there is no 'raw JSON' view on the right.

However, if you noticed, I said 'was' not 'is' because I reached out to the developer and a new fix was posted literally in a couple days, which is a testament to good product support.

That said, there are still a few other things that would go a long way to making this truly great.

  1. It wasn't clear by the presentation, but this actually appears to be more of a viewer/formatter, but not an actual editor. What this means is while you can view the JSON in both tree and raw-formatted-text, the tree is read-only, and any changes you make in the raw text portion dont actually update the JSON. There's no way to save it back to the current document. (Note: There is a 'Save as' button although it appears to be non-functional. Perhaps this is behind the paywall since I'm using the free trial.) Still, being able to edit JSON files is the primary thing I need so perhaps it's unfair of me to judge this considering it's not actually touted as an 'editor.')

  2. An extension of the above point, there doesn't seem to be a way to simply create a new, blank JSON document. There's no 'File->New' support. You can only start from the pasteboard, a URL, a cURL response or by opening an existing file. I hope this capability is revisited, but it would again have to go hand-in-hand with true editing capabilities.

  3. Being that it appears to be designed primarily as a viewer/formatter-only app, it's not quite clear what the difference between 'Viewer' mode vs non-viewer mode is. Both are in the 'File' menu, and when activated appear to do the same thing (although the non-viewer ones are only enabled when the start-screen is shown. Perhaps these could be combined since they appear to do the same thing.

  4. The 'Zoom In Node' is a brilliant idea. It lets you 're-anchor' the 'tree view' to a child node so you're only seeing that node's contents both there, and in the plain JSON view. However, there's no way to 'un-zoom' outside of using the Undo command. This seems to imply it's actually destructively editing its internal representation of the JSON file itself although that is speculation on my part. I'm hoping this can be addressed in a future version that lets you 'delve down' as often as you want, while also letting you 'navigate back out' again whenever you want as well, not confined to the sequential nature of 'Zoom-then-undo'.

So again, in summary, this really has the potential to be the de-facto standard in native JSON editor. Gorgeous and simple UI, well-displayed highlighting and the scripting feature is briliant. But without even basic editing features like being able to save your changes, or even perform a file-new limits its usefulness. And again, clearing up somewhat-confusing viewer-vs-non-viewer views.

But if those things were addressed, few apps can touch the potential of this one. Let's hope the developer considers making these changes as quickly as they addressed the missing text editor. I for one would welcome the chance to revisit this app, and even actively promote it amongst my development peers.

4/5 Stars

Save function not working property

Describe the bug
Click the "save as" menu did nothing.

To Reproduce
Steps to reproduce the behavior:

  1. Get a JSON string, and open it in "OK JSON.app"
  2. Choose the top JSON object and click on "Save as" menu or press ⇧ ⌘ S
  3. See bug(Nothing happends)

Expected behavior
Present a windows query where to save the json file

Screenshots
截屏2021-09-09 17 15 02

Desktop (please complete the following information):

  • OS: macOS 12.0 beta5 21A5506j
  • App Version: version 1.3 (8)

Additional context
No

Opening a file with: File -> Open replaces current window content causing loss of data

Describe the bug
After loading content into an OK JSON window, when using "File -> Open" from the menu-bar to open another JSON document, the content I've already loaded is replaced with the opened document. This causes an unexpected loss of data.

To Reproduce
Steps to reproduce the behavior:

  1. Open OK JSON
  2. Paste content into the window
  3. Click "File" -> "Open", and select a different JSON document to open
  4. See that the previous un-saved content was replaced unexpectedly by the newly opened file with no way to get the previous data back.

Expected behavior
One of two things should happen instead of replacing the unsaved data

  1. The new document should be opened in a new tab
  2. The user should be notified that the existing window content is about to be replaced, and options should be given to either continue, or cancel.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS 13.2.1 (22D68)
  • Browser: N/A - using the OK JSON macOS app
  • Version: Version 1.9.0 (26)

while editing subsection view of json doc, cursor always moves to the end of doc

Describe the bug

While editing subsection view of json doc, cursor always moves to the end of doc.

To Reproduce

Create doc/window with json that has sub-objects/dict, ie:

{
    "a": {
        "s": {
            "hello": 2
        }
    }
}

On the left side (in the above JSON example) click the > { } s part.

Then on the right start editing the "hello" part of the subview (ie: only a part of the json is visible due to clicking the > { } s part.

The cursor jumps to bottom of document after every time you type a single character.

Expected behavior
Cursor stays where it is at so you can continue typing.

Screenshots

Place cursor in middle of "hello":

Screenshot 2023-02-23 at 8 50 50 PM

I typed a capital T and cursor the moved to bottom of document:

Screenshot 2023-02-23 at 8 49 58 PM

Desktop (please complete the following information):

  • OS: MacOS 13.2.1
  • Browser Safari
  • Version 1.9.0 (25)

Support Adding and Removing Fields in the Tree View

Is your feature request related to a problem? Please describe.
Currently, it's only possible to add or remove fields in the editor panel on the right side. Sometimes, when the json is large, it's hard to manage fields by directly editing raw texts. It can be very error-prone.

Describe the solution you'd like
Right-click on a field in the tree view panel, then give an option to "remove node" or "add child node" then prompt for key and value.

Describe alternatives you've considered
Edit directly on the right side as raw text.

Additional context
Add any other context or screenshots about the feature request here.

[Feature request] Sort Properties

Is your feature request related to a problem? Please describe.
This isn't a problem but I would love to have the ability to sort the JSON that I paste into the app. I never find myself concerned with the order of the properties but often scan the properties for a specific key.

Describe the solution you'd like
Personally, if there was a preference to "always sort properties when pasting" I would be very happy but another, and potentially more popular with most users, is a keyboard shortcut to sort after pasting.

Another option might be a keyboard shortcut/text box similar to "Find" that can "Filter" properties.

Describe alternatives you've considered
CMD+F for find is helpful for general searches since it will also search the contents of the values but for my use-case, easily scanning the properties for a specific key, it would be easier if they were sorted alphabetically.

Thanks for your consideration and for the great app 😄

Restore the JSON diff feature

I remember the old version of OK JSON has such feature.

But it is missing in the current version(2.4 build 111).

Is there any reason to remove it and can we add it back?

Tab names are broken when adding a new tab in the middle of existing tabs

Describe the bug
When you have two or more tabs open and each is named, creating a new tab while focused on any but the last tab causes the new tab to take on an existing tab's name.

To Reproduce
Steps to reproduce the behavior:

  1. From a new OK JSON window, paste JSON content, or open a JSON file to populate the window
  2. Use the "Rename tab" button to name the current window (e.g. "Test Tab 1")
  3. Use cmd + t to open a new tab, and populate this window with JSON that is distinct from the first window
  4. Use the "Rename tab" button to name this second window (e.g. "Test Tab 2")
  5. Switch to the first window ("Test Tab 1")
  6. Press cmd + to to create a new tab
  7. Notice that the new tab's title is now "Test Tab 2", and the content you had in "Test Tab 2" before is now in a tab named "Today at {TIME}"

Expected behavior
Would expect the tab names to stick with the content that was placed in them, rather than changing content when the new tab is created.

Desktop (please complete the following information):

  • OS: macOS 13.2.1 (22D68)
  • Browser: N/A - using the macOS "OK JSON" app
  • Version: Version 1.9.0 (26)

Feature request: Single left click to follow hyperlink

Hi,

The app (or is it macOS) clearly understands what a URL is, as it can be followed when right clicking on the link.

Could you please make it so that single left clicking on the link can follow it? Perhaps with an option to enable / disable this behaviour. With an underline in the formatting would be even nicer.

Thanks

[Bug report] Time UI not refresh

Describe the bug
第二天到来时昨天创建的OKJSON 窗口标签仍为"今天 XX:YY"

会导致无法分辨昨天"XX:YY"时刻和今天"XX:YY"时刻创建的窗口

因为调查一个前端数据流问题可能一天无法解决,一般都是问题未解决前长期把这个OKJSON窗口留着

To Reproduce
Steps to reproduce the behavior:

  1. 在某天的XX:YY时刻创建OKJSON窗口
  2. 等待第二天到来
  3. UI显示仍为"今天 XX:YY"

Expected behavior
UI显示为"昨天 XX:YY"或者具体的日期
建议昨天和今天为特殊case,其他时间段直接显示具体的日期即可

Screenshots

11:02分截屏
截屏2021-12-08 11 02 10

Additional context

  1. 感觉代码上肯定是用的"Date()",确实记录了日期,但是没有一个好的时机来刷新窗口,不知道macOS有没有这样一个日期变化的通知
  2. 遍历所有窗口更新时间标签的代价感觉不是很大,可否考虑在新建窗口/标签页时刷新时间标签UI(Model仍为原有记录时间)

Left pane breaks when using disclosure triangles with large object

When using the disclosure triangles to hide or reveal nodes in a large JSON object, eventually the left pane gets into a bad state where the disclosure triangles stop functioning. In some cases, the app will crash.

Steps to reproduce the behavior:

  1. Download the example JSON
  2. Copy its contents into the clipboard so you can paste it into OK JSON (NB: this bug also appears when loading this example from an API endpoint)
  3. Start collapsing sections of content by either clicking the disclosure triangles, or by using the keyboard (ex: click a node to select it, press the left-arrow on your keyboard to collapse it. Continue to press left-arrow to collapse the node's parents.)
  4. What appears to happen is an error in rendering the view. At some point either the app will crash or you will no longer be able to reveal a collapsed node.

Expected behavior
I expected the nodes would collapse or expand freely using either keyboard or mouse.

Example Video 1
https://user-images.githubusercontent.com/4280/226183891-157fe70a-84ef-4c36-9c4b-67b53dd24a65.mp4

Example Video 2 /
https://user-images.githubusercontent.com/4280/226183998-fc26fe32-7f96-493a-98a3-8e4f0f84d872.mp4

Desktop

  • OS: macOS 13.2.1 (22D68)
  • OK JSON Version 1.9.0 (26)

Thank you for a great app!

Persist JSON data when app is quit and reload JSONs which were open from previous session when app relaunched

Is your feature request related to a problem? Please describe.
I had to quit the app due to some unexpected reasons and i generally work with multiple json tabs and reopening all tabs is a tedious task

Describe the solution you'd like
App should prompt users to whether save the opened JSON tabs or not. When app is re-launched, the persisted JSONs tabs should recover

Describe alternatives you've considered
tedious but able to manage it. I have saved all json data in a location temporarily managing it. I purchased the app expecting this feature but this feature is missing.

[Feature request] Tab name should reflect the file name after "Save As..."

Is your feature request related to a problem? Please describe.
When I "Save As..." the json for the tab in focus, the tab name does not change.

Describe the solution you'd like
I would like the tab name to reflect the name of the file I just saved.

Describe alternatives you've considered
None

Additional context
None

JSONPath expressions modify the structure being queried.

Describe the bug
If you query a JSON structure using the "Query with JSONPath" feature of OK JSON, and use a single = rather than a double == to test equivalence, an assignment occurs behind the scenes and subsequent queries in the same window become inaccurate.

To Reproduce
Given the JSON list:

[
  {
    "foo": "Bar",
    "baz": 3
  }
]

If you "Query with JSONPath" starting from the root node with the following query, the result is expectedly undefined:

$.[?(@.foo == "bing")]

But if you first run this query (without knowing what your'e doing), an assignment takes place and the structure being queried is modified:

$.[?(@.foo = "bing")]

You can confirm that something was modified when you run the first query again in the same window and find that it surprisingly yields results:

$.[?(@.foo == "bing")]

RESULTS

[
  {
    "foo": "bing",
    "baz": 3
  }
]

Expected behavior
The queried structure should not be mutated by a query expression

Screenshots
image

Additional context
Using OK JSON Version 2.4 (111)

Pasting new content into already named tab, resets the tab name

Describe the bug
When pasting new JSON content into an already named OK JSON window, the previously given name is removed, and is replaced with "Today at {TIME}"
(this may be related to #17)

To Reproduce
Steps to reproduce the behavior:

  1. Open the OK JSON app
  2. Click the "Rename tab" button to name the initial tab (e.g. "My First Tab")
  3. Paste JSON content into the window
  4. Note that the Tab name changed from "My First Tab" to "Today at {TIME}"

This occurs on any open tab, whether you have one tab open, or many. When you paste new content, the name is changed from what you named it to.

Expected behavior
The tab name that was given to the tab by the user should be preserved

Desktop (please complete the following information):

  • OS: macOS 13.2.1 (22D68)
  • Browser: N/A - using the OK JSON macOS app
  • Version 1.9.0 (26)

Crashes when opening from Finder

Describe the bug

OK JSON crashes when opening a JSON file from Finder

從 Finder 選擇用 OK JSON 打開 JSON 文件時,OK JSON 會崩潰。

To Reproduce
Steps to reproduce the behavior:

  1. In Finder, right click on any JSON file
  2. Choose Open With -> OK JSON from the menu (if not present, choose 'Others...' and select OK JSON app)
  3. OK JSON app crashes

Expected behavior

OK JSON should open the JSON File I selected on Finder

Screenshots

N/A

Desktop (please complete the following information):

  • OS: macOS 13.2
  • Browser N/A
  • Version 1.9.0 (26)

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

[Feature request] Support common encode string

Is your feature request related to a problem? Please describe.
支持对string进行百分号解码和/解码
比如"http://%22%3A""{\"cell_type\":304,\"data_type\":1}"
前者可以帮助更好的理解string,在一个工具中集成
后者可以帮助还原string为正确的JSON格式,方便使用OK JSON阅读

Describe the solution you'd like
右键点击后的菜单中增加percent decode和string into JSON选项
截屏2021-09-09 16 56 03

Describe alternatives you've considered
不耦合主App,使用Plug-In设计支持上述feature

Additional context
希望OK JSON越来越好♥️

Support for loading ndjson content from clipboard

First of all, thanks for the great app! I use it every-day and I find it to be reasonably priced, user friendly, and more performant than other tools I've tried. I've been recommending it to all my coworkers.

Is your feature request related to a problem? Please describe.
I appreciate the ability to open *.ndjson files, but I find myself more often trying to paste ndjson content into a new OK JSON tab or window. Whenever I do this OK JSON doesn't recognize the content as valid. I get the following message:
image

Describe the solution you'd like
I'd appreciate being able to paste ndjson content (cmd+v) into an OK JSON window just as I can paste normal JSON content.

Describe alternatives you've considered
My workaround for this right now is basically the following:

pbpaste > foo.ndjson
jq -s '.' foo.ndjson | pbcopy
rm foo.ndjson

# -- go to OK JSON and paste what was copied

Additionally, there have been regular cases for me where I have been unable to open files with ndjson content seemingly due to logic around the file extension. For example, I'll get files with well-formed ndjson content in any of the following extensions: .jl, .json, .txt. When I try to open these with OK JSON I get a "failed to parse string" message. In order to open these files I have to rename them to have the .ndjson, or .jsonl extension. Enabling this proposed feature to be able to paste ndjson content into OK JSON would help to alleviate this inconvenience.

Add support for duplication

现在当某个数据需要duplicate时,需要手动在右侧编辑窗口中找到位置并复制粘贴,被复制项小时还问题不大,被复制项较大时就比较麻烦了,可以参考这个 App 的smart duplication功能,用户选择某些项进行duplicate时自动插入到该项的下面并保持JSON语法

https://apps.apple.com/cn/app/smart-json-editor/id1268962404?mt=12

  • key: "data"
  • value: [gaint_item1, gaint_item2] -> [gaint_item1, gaint_item2, gaint_item2]

[Bug report] 行号显示异常

Describe the bug
在数据过多时,行号显示异常

To Reproduce

  1. 复制附件的JSON数据,或者自行找到一条200行+的JSON数据
  2. 使用OKJSON打开
  3. 下滑到100行左右
  4. 发现部分行号被隐藏

注:可通过移动行号左侧的分割线,来使得UI刷新临时解决局部行号显示,但继续上滑或下滑问题仍然存在

Expected behavior
行数全部显示或者按其他可预期的规则显示部分

Screenshots
截屏2021-09-10 15 53 53

Desktop (please complete the following information):

OS: macOS 12.0 beta5 21A5506j
App Version: version 1.3 (8)

Additional context
附件📎👇
test.txt

添加一个打开文件后,修改同步到此文件的功能。每次改完后,还要在另外保存,有点多余

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

[Feature request] Menu String Suggestion

Is your feature request related to a problem? Please describe.
I always feel a little strange when I see "JSONPath" and "JSON Patch" appear in the same place 😂
截屏2021-09-10 10 59 26

Describe the solution you'd like
Change "JSONPath" into "JSON Path" to unify the string format

Describe alternatives you've considered
Change "JSON Patch" into "JSONPatch" (Personal I prefer the former)

Additional context
I know JSONPath is the Library's Name. But I think that's how it is used in an API (no space in between, Camel-Case Rule).
When we use it in another context, maybe a space is more proper. ♥️

Not OK Json! The Editor Fails to display any text!

This image explains it all.

image

image

The rest I'm copying from my review on the app store which I just left so I don't have to re-type it.

--Original Review - 2/5 Stars--

This had the potential to be a perfect, simple JSON editor. Easily one of the best-looking ones I've seen to date. But usability issues knock it off-course, and the incomprehensible fact that it fails to display actual JSON doesn't just make this version trip out of the gate, it makes it flat-out DOA. How the heck did this get through QA?!

Ok, the details...

The first, and by far the biggest... it fails to display the actual JSON in the editor. It simply doesn't work! Specifically, when you open a JSON file in the latest version, you can see the tree on the left, filled in as expected, but there is no raw text JSON on the right. You can see the line numbers so it did try to load something, but there's nothing after them. I even wondered if maybe it was a misconfigured font color (i.e. white font on a white background) where selecting it would reveal the 'hidden' text, but nope... there was simply nothing there!

I even thought 'Ok... maybe it's the app-store version. Surely they have a newer version on their own web site!' so I deleted the app store one, went to their site and grabbed that one.

Same broken issue. Such a shame.

Even if that weren't the case, other things that keep this from a perfect app...

One. There doesn't seem to be a way to simply create a new, blank JSON document that you can type in yourself! Yes, you heard that right... there's no 'File-New!' in a JSON editor! What!?!! You can only start from the pasteboard, a URL, a cURL response or by opening an existing file. Sure, there's a 'new' button on the toolbar, but it's not for creating a new document. Because of that, it should not be the 'new document' icon. It should be a new viewer icon. But again, sometimes I want to create a file and I shouldn't have to go somewhere else to create it first. Really... how is such a basic feature missing?

Two. Why is there a separate 'Viewer' mode vs non-viewer mode? There should only be one mode... view/edit. It should handle read-only files of course, and perhaps you may want to toggle editing/lock the view so you don't accidentally change something, but what if you do want to and you're in the 'viewer' mode? You have to copy/paste it to a completely different viewer... sorry... editor... meaning you most likely will also completely lose where you were in that file! Again, why?!

Three. The 'Zoom In Node' is brilliant! Or rather should have been. It too falters. 'Zoom in node' is when you basically 're-anchor' the 'tree view' to a specific child node so you're only seeing that node as the root. This lets you focus on only what you're interested in at that moment. Or rather apparently permanently because the only way to go back out is to CTRL-Z! That's 'undo'! What exactly are you undoing?! Undo is for when you change something but nothing about the document changed, only how it's being viewed!

...or so I thought. What appears to be happening is the developer is literally discarding everything else and creating a new JSON document of just that node.

But why?

Again, you have the document, you know where you are in the tree because you already know how to render the breadcrumb down below. Why not allow us to navigate back up the tree, like any other navigating with the breadcrumb? Maybe even 'gray out' the portions 'above' the root as a visual indicator of where you're rooted, but still allow us to click back out of it. But nope... it's a one-way trip unless you immediately CTRL-Z to get back out of it. Like I said, missed opportunity here.

So again, this could have been a perfect JSON viewer. It's gorgeously rendered, seems very performant, and is dead-simple. Add in the scripting support and it should've been game-over. But the above usability issues keep this from being five-star, and the downright broken editor keeps it from being usable at all. And at $20 after two weeks, Apple customers really deserve better.

Hopefully, the developer is listening, and if so and these get addressed, I'll happily adjust my review, possibly up to the hoped-for five-stars I thought it was when I first found it. But for now, I'm only saying two, not one, because they clearly care about the appearance which is more than most can say. But it just doesn't work! So close, yet so, so far.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.