Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dashboard buttons only work if they have not been opened previously #40

Open
rmmanseau opened this issue Jul 14, 2022 · 2 comments
Open

Comments

@rmmanseau
Copy link

steps to reproduce:

  1. open gerrit dashboard
  2. click on one of the repo buttons, ie abc ( opens buffer called gerrit:project:abc)
  3. click on one of the owner buttons, ie xyz (open buffer called gerrit:owner:xyz)
  4. click on a button pointing to repo abc

expected behavior:
gerrit:project:abc buffer opens and the contents reflect the abc repo

actual behavior:
gerrit:project:abc buffer opens but the contents never update, they still reflect the contest of gerrit:owner:xyz

the only way to get the proper contents of gerrit:project:abc to show is to delete the buffer that already exists before clicking on the button again.

its not a huge issue but its kind of inconvenient to have to be aware of which gerrit dashboards are open. itd be nice to be able to click the buttons and have them work as expected regardless of which buffers are currently open.

thanks for the project btw! upload & such work perfectly and have been very helpful : )

@rmmanseau
Copy link
Author

rmmanseau commented Jul 14, 2022

ive fixed this issue for myself by overwriting gerrit-query in my config.

(defun gerrit-query (query)
  "Perform a query QUERY and display it in a dashboard buffer."
  ;; TODO offer completion in interactive ...
  ;; TODO offer a list of candidates (history)
  (interactive "sEnter a query string: ")
  (let* ((buffer (format "gerrit:%s" query))
         (is-new (not (get-buffer buffer))))
    (switch-to-buffer buffer)
    (if is-new
        (progn
          (setq gerrit-dashboard-query-alist
              ;; if car is nil gerrit.el will not display a section line
                `((nil . ,(concat query " limit:50"))))
          (gerrit-dashboard-mode)))))

@twmr
Copy link
Owner

twmr commented Jul 31, 2022

Thx for the bug report @rmmanseau. I can reproduce the issue. There seems to be an issue with the buffer local variable gerrit-dasbhoard-query-alist, which is not always correctly set. Let me check if I can provide a proper fix.

twmr added a commit that referenced this issue Aug 1, 2022
Change-Id: I71b98b2705af4ba2f3096c3bf26f4b59bb6a1901
twmr added a commit that referenced this issue Aug 4, 2022
Change-Id: I71b98b2705af4ba2f3096c3bf26f4b59bb6a1901
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

No branches or pull requests

2 participants