Skip to content

[inspect] Add support for :table view-mode #928

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

Merged
merged 1 commit into from
Apr 5, 2025
Merged

Conversation

alexander-yakushev
Copy link
Member

@alexander-yakushev alexander-yakushev commented Apr 4, 2025

Sister PR: clojure-emacs/orchard#331

Not a lot to be done here. We already have inspector-toggle-view-mode that does the heavy lifting. The only meaningful thing here is checking if the current object can be rendered as a table.

  • If it does, the view mode cycle goes like normal -> table -> object -> normal
  • Otherwise, it's normal -> object -> normal.

  • You've added tests to cover your change(s)
  • You've updated the CHANGELOG
  • Middleware documentation is up to date

@@ -77,7 +77,9 @@
(inspector-response msg (swap-inspector! msg #(inspect/refresh % overrides)))))

(defn- toggle-view-mode [{:keys [view-mode] :as inspector}]
(let [toggle-order {:normal :object, :object :normal}
(let [toggle-order (if (inspect/supports-table-view-mode? inspector)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a note here that depends on the underlying data, as I'm not sure it will be obvious from the name of the function alone.

@alexander-yakushev alexander-yakushev force-pushed the table-view branch 2 times, most recently from b9cc233 to 95f7c90 Compare April 5, 2025 13:42
@alexander-yakushev alexander-yakushev merged commit c3a6e9d into master Apr 5, 2025
15 of 16 checks passed
@alexander-yakushev alexander-yakushev deleted the table-view branch April 5, 2025 13:49
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

Successfully merging this pull request may close these issues.

2 participants