n0v1c3 / vira

Create and update your Jira issues while inside Vim!
MIT License
94 stars 12 forks source link

VIRA-282: Make the vira_report and vira_menu readonly #47

Open chinwobble opened 3 years ago

chinwobble commented 3 years ago

The vira_report and vira_menu are readonly.

Based on my usage, you have created vira_prompt so that you can edit each section of a jira individually.

Like in fugitive in the git status screen you aren't allowed to edit text.

n0v1c3 commented 3 years ago

We do have issues to edit them in place but for now you can use the <cr> to edit and select fields.

The report is the place for editing and menus for selecting. I do have an issue for editing and bulk editing in the menus.

n0v1c3 commented 3 years ago

Async updates will now be applied to menus and reports bit this may not be 100% easy.

n0v1c3 commented 3 years ago

Once the update of async next step is to send info without an extra window then have the fake read only work. I am sure there is a way to toggle the read only once I actually look for it.

n0v1c3 commented 3 years ago

A note for myself:

set nomodifiable
set modifiable
n0v1c3 commented 3 years ago

@chinwobble I have done a merge one my VIRA-69 for this issue NOT the proper way, right away onto dev and risk onto master and that also made me remember this was not too much fun. There will be a proper way to do it especially now that I can multitask in vim and nvim. I will just need to turn it on and off while hide it from the display. This will also solve another one of your issues to be able to hide to the report titles. I am sure this will become upgrade them into these report titles but that will be the next great step after this.

n0v1c3 commented 3 years ago

@chinwobble VIRA-213 should now how a readonly as needed. I shill needed to make it pretty but that can also be merged into the hiding of the entire "tab's" ugliness.

Let me know how it goes for you.

chinwobble commented 3 years ago

should this be nomodifable instead? https://github.com/n0v1c3/vira/commit/5c1a3aad80c7f289807daea4e13a54bbf083b686#diff-93336de9847f9c412020ad62cdbfe420c7f41ce036616722624750f64b44c28eR48

n0v1c3 commented 3 years ago

Yup, I just need to hide the message.

Edit

In case you were confused that is what I needed to do to make those ones nomodifiable, I know it looks wrong.

n0v1c3 commented 3 years ago

I added one line of code to make make it a bit better but something is wrong deeper down. It is no longer styling the REPORT the way it was.

n0v1c3 commented 3 years ago

@chinwobble that VIRA-213 push should definitely pass for this now.

chinwobble commented 3 years ago

The UI is very slow for me now.

Here's how you can profile the python code.

python3 << EOF
import vim
import cProfile
with cProfile.Profile() as pr:
  Vira.api.connect(vim.eval('g:vira_serv'))
pr.dump_stats('/tmp/vira_connect_stats.log')
EOF

Note you must not have any white space before / indents.

For me it takes 4-5 seconds just to finish the Vira.api.connect

image

n0v1c3 commented 3 years ago

This one is working for me. Only difference I will make is move it into python but you can do a quick push into it so I don't forget.

chinwobble commented 3 years ago

see also https://thoughtbot.com/blog/profiling-vim

n0v1c3 commented 3 years ago

I will take a closer look at it for sure.

n0v1c3 commented 3 years ago

@chinwobble I believe the issue here is closed and only remains with the async issue.

n0v1c3 commented 3 years ago

What I did broken more than it fixed so I removed a line and need to reopen this issue.

n0v1c3 commented 3 years ago

Updated the issued number to break it free from the general open the doors and README issue.

n0v1c3 commented 3 years ago

I did a push that covers the start if this one again and the small stuff starts to appear on me. VIRA-282 branch exists for now. I am sure more will come but here is a list for now:

- [x] Deleted `ONE` line when the OTHER window was opened.
    - Open `report` back to `menu` delete a row.
- [x] Reload the same Report with no changes.
- [x] Reload the same `window` is missing.
    - `menu` or `report` does this to you
    - Any menu regardless of different data.
n0v1c3 commented 3 years ago

Mostly into true code cleanup and hunt for bugs then it should be all good.

n0v1c3 commented 3 years ago

@chinwobble this is on the dev branch for a test now if you want to give it a run. I am bug hunting and checking my other small issues before I will just get it to master.

n0v1c3 commented 3 years ago
n0v1c3 commented 3 years ago

@chinwobble,

Check out the dev branch. I am sure I have gone to far with it but it should also be more than the original issue of readonly.

I will close this one and on to the other ones as long as it is working for some other people.