home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

10 rows where author_association = "OWNER", issue = 732798913 and user = 9599 sorted by updated_at descending

✖
✖
✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 1

  • simonw · 10 ✖

issue 1

  • Navigation menu plus plugin hook · 10 ✖

author_association 1

  • OWNER · 10 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
719117185 https://github.com/simonw/datasette/issues/1064#issuecomment-719117185 https://api.github.com/repos/simonw/datasette/issues/1064 MDEyOklzc3VlQ29tbWVudDcxOTExNzE4NQ== simonw 9599 2020-10-30T01:35:17Z 2020-10-30T01:35:17Z OWNER

I'm going to go with a list of {"label": ..., "href": ...} as the first iteration of this. The logout link will not be returned as part of the plugin output. A default plugin will provide the debug tools if the user is logged in as root.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Navigation menu plus plugin hook 732798913  
719111597 https://github.com/simonw/datasette/issues/1064#issuecomment-719111597 https://api.github.com/repos/simonw/datasette/issues/1064 MDEyOklzc3VlQ29tbWVudDcxOTExMTU5Nw== simonw 9599 2020-10-30T01:15:05Z 2020-10-30T01:15:05Z OWNER

I'm torn on this one. I think I have a very slight preference for plugins returning structured objects as opposed to HTML. Less likely to regret that choice in the future?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Navigation menu plus plugin hook 732798913  
719111373 https://github.com/simonw/datasette/issues/1064#issuecomment-719111373 https://api.github.com/repos/simonw/datasette/issues/1064 MDEyOklzc3VlQ29tbWVudDcxOTExMTM3Mw== simonw 9599 2020-10-30T01:14:13Z 2020-10-30T01:14:13Z OWNER

Plugins returning HTML makes more sense for some of the other areas that plugins will be able to inject content - e.g. injecting content on the table or row page above the table.

If I'm going to have that as a pattern though it may make sense to use HTML here, since that will be consistent with other places that plugins can inject additional content.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Navigation menu plus plugin hook 732798913  
719110808 https://github.com/simonw/datasette/issues/1064#issuecomment-719110808 https://api.github.com/repos/simonw/datasette/issues/1064 MDEyOklzc3VlQ29tbWVudDcxOTExMDgwOA== simonw 9599 2020-10-30T01:12:09Z 2020-10-30T01:12:19Z OWNER

Or... plugins could return HTML - maybe optionally using helper functions to generate common HTML such that plugins which use the helpers can have their HTML modified in the future.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Navigation menu plus plugin hook 732798913  
719110582 https://github.com/simonw/datasette/issues/1064#issuecomment-719110582 https://api.github.com/repos/simonw/datasette/issues/1064 MDEyOklzc3VlQ29tbWVudDcxOTExMDU4Mg== simonw 9599 2020-10-30T01:11:13Z 2020-10-30T01:11:13Z OWNER

Should plugins be able to add forms like the logout form here, or should they be restricted to adding navigation links?

I can't think of a reason a plugin would need to add a form. The logout form is a special case to protect against logout-csrf attacks.

So I think plugins get to return a list of dictionaries, each with a label and an href:

python return [{ "label": "Upload CSVs", "href": datasette.urls.path("/-/upload-csvs") }] But... is there an argument for returning headings, to divide up the menu?

I think so. I also like the idea that a default plugin checks for the root user and outputs links to the different debugging tools - maybe those should be wrapped in a section heading.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Navigation menu plus plugin hook 732798913  
719109770 https://github.com/simonw/datasette/issues/1064#issuecomment-719109770 https://api.github.com/repos/simonw/datasette/issues/1064 MDEyOklzc3VlQ29tbWVudDcxOTEwOTc3MA== simonw 9599 2020-10-30T01:08:14Z 2020-10-30T01:08:14Z OWNER

How should the plugin hook work?

Here's the first version of the HTML: html <div class="nav-menu-inner"> <ul> <li><a href="{{ urls.instance() }}">Home</a></li> <li><a href="{{ urls.path('/-/plugins') }}">Installed plugins</a></li> <li><a href="{{ urls.path('/-/versions') }}">Software versions</a></li> <li><a href="{{ urls.path('/-/metadata') }}">Metadata</a></li> {% if show_logout %} <form action="{{ urls.logout() }}" method="post"> <input type="hidden" name="csrftoken" value="{{ csrftoken() }}"> <button class="button-as-link">Log out</button> </form>{% endif %} </ul> </div>

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Navigation menu plus plugin hook 732798913  
719106174 https://github.com/simonw/datasette/issues/1064#issuecomment-719106174 https://api.github.com/repos/simonw/datasette/issues/1064 MDEyOklzc3VlQ29tbWVudDcxOTEwNjE3NA== simonw 9599 2020-10-30T00:55:12Z 2020-10-30T00:55:12Z OWNER

So what should go in this menu?

If the user is logged in as root, I'll link to the various debug pages.

If they're not logged in at all I don't think the menu should appear.

If they are logged in as anyone, it should display to give them access to the "log out" button.

Plugins can add links to it. If those plugins add links, the menu will display.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Navigation menu plus plugin hook 732798913  
719105641 https://github.com/simonw/datasette/issues/1064#issuecomment-719105641 https://api.github.com/repos/simonw/datasette/issues/1064 MDEyOklzc3VlQ29tbWVudDcxOTEwNTY0MQ== simonw 9599 2020-10-30T00:53:00Z 2020-10-30T00:53:00Z OWNER

Tips for making this accessible: https://css-tricks.com/accessible-svgs/

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Navigation menu plus plugin hook 732798913  
719104883 https://github.com/simonw/datasette/issues/1064#issuecomment-719104883 https://api.github.com/repos/simonw/datasette/issues/1064 MDEyOklzc3VlQ29tbWVudDcxOTEwNDg4Mw== simonw 9599 2020-10-30T00:50:01Z 2020-10-30T00:52:29Z OWNER

Here's what the prototype looks like so far:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Navigation menu plus plugin hook 732798913  
719105197 https://github.com/simonw/datasette/issues/1064#issuecomment-719105197 https://api.github.com/repos/simonw/datasette/issues/1064 MDEyOklzc3VlQ29tbWVudDcxOTEwNTE5Nw== simonw 9599 2020-10-30T00:51:16Z 2020-10-30T00:51:16Z OWNER

I used a <details><summary> for this: https://github.com/simonw/datasette/blob/0d7ac764861d84be24d661cf4104ce61ea11a82a/datasette/templates/base.html#L16-L36

I added a bit of JavaScript so that clicking outside the menu would close it: https://github.com/simonw/datasette/blob/0d7ac764861d84be24d661cf4104ce61ea11a82a/datasette/templates/base.html#L59-L74

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Navigation menu plus plugin hook 732798913  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
, [performed_via_github_app] TEXT);
CREATE INDEX [idx_issue_comments_issue]
                ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
                ON [issue_comments] ([user]);
Powered by Datasette · Queries took 523.142ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows