home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

16 rows where issue = 1448143294 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 2

  • simonw 15
  • fgregg 1

author_association 2

  • OWNER 15
  • CONTRIBUTOR 1

issue 1

  • Autocomplete text entry for filter values that correspond to facets · 16 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1317889323 https://github.com/simonw/datasette/issues/1890#issuecomment-1317889323 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OjWUr fgregg 536941 2022-11-17T00:47:36Z 2022-11-17T00:47:36Z CONTRIBUTOR

amazing! thanks @simonw

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Autocomplete text entry for filter values that correspond to facets 1448143294  
1316262169 https://github.com/simonw/datasette/issues/1890#issuecomment-1316262169 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OdJEZ simonw 9599 2022-11-16T03:22:40Z 2022-11-16T03:22:40Z OWNER

Actually this works as it should in desktop Safari:

I'm going to just put up with the weird behaviour in Mobile Safari.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Autocomplete text entry for filter values that correspond to facets 1448143294  
1316242752 https://github.com/simonw/datasette/issues/1890#issuecomment-1316242752 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OdEVA simonw 9599 2022-11-16T03:10:52Z 2022-11-16T03:12:47Z OWNER

https://bugs.webkit.org/show_bug.cgi?id=201768 - " Datalist option's label not used" - marked as RESOLVED FIXED on March 31st 2020.

The commit: https://trac.webkit.org/changeset/259330/webkit

And here's the test mirrored on GitHub: https://cs.github.com/qtwebkit/webkit-mirror/blob/cc3fcd0b4bad1f7cf77c26e34aa01d16618d6d5e/LayoutTests/fast/forms/datalist/datalist-option-labels.html?q=datalist-option-labels.html

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Autocomplete text entry for filter values that correspond to facets 1448143294  
1316240839 https://github.com/simonw/datasette/issues/1890#issuecomment-1316240839 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OdD3H simonw 9599 2022-11-16T03:09:11Z 2022-11-16T03:09:11Z OWNER

Here's a polyfill for <datalist>: https://github.com/mfranzke/datalist-polyfill

It shouldn't be necessary now that Safari has shipped support (apparently added in https://developer.apple.com/documentation/safari-release-notes/safari-12_1-release-notes#3130314 Safari 12.1 in March 2019).

But it does look like Safari doesn't support differing label and value attributes, though documentation about this is hard to come by.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Autocomplete text entry for filter values that correspond to facets 1448143294  
1316233532 https://github.com/simonw/datasette/issues/1890#issuecomment-1316233532 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OdCE8 simonw 9599 2022-11-16T03:00:58Z 2022-11-16T03:00:58Z OWNER

Oops, introduced a test failure:

``` def test_table_html_foreign_key_facets(app_client): response = app_client.get( "/fixtures/foreign_key_references?_facet=foreign_key_with_blank_label" ) assert response.status == 200

  assert (
        '<li><a href="http://localhost/fixtures/foreign_key_references?_facet=foreign_key_with_blank_label&amp;foreign_key_with_blank_label=3">'
        "-</a> 1</li>"
    ) in response.text

E assert '

  • - 1
  • ' in '<!DOCTYPE html>\n<html>\n<head>\n <title>fixtures: foreign_key_references: 2 rows</title>\n <link rel="styleshe.../script>\n\n\n<!-- Templates considered: table-fixtures-foreign_key_references.html, *table.html -->\n</body>\n</html>' E + where '<!DOCTYPE html>\n<html>\n<head>\n <title>fixtures: foreign_key_references: 2 rows</title>\n <link rel="styleshe.../script>\n\n\n\n</body>\n</html>' = <datasette.utils.testing.TestResponse object at 0x7fd1b0080640>.text ``` Need to fix this test:

    https://github.com/simonw/datasette/blob/eac028d3f77aa5473a5fcf59240635a1bca80f7d/tests/test_table_html.py#L616-L624

    {
        "total_count": 0,
        "+1": 0,
        "-1": 0,
        "laugh": 0,
        "hooray": 0,
        "confused": 0,
        "heart": 0,
        "rocket": 0,
        "eyes": 0
    }
    Autocomplete text entry for filter values that correspond to facets 1448143294  
    1314891228 https://github.com/simonw/datasette/issues/1890#issuecomment-1314891228 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OX6Xc simonw 9599 2022-11-15T07:23:01Z 2022-11-15T07:23:01Z OWNER

    Annoying: Mobile Safari doesn't seem to support separate labels and values. I should probably disable this feature on that browser, at least for foreign key facets (for the moment).

    {
        "total_count": 0,
        "+1": 0,
        "-1": 0,
        "laugh": 0,
        "hooray": 0,
        "confused": 0,
        "heart": 0,
        "rocket": 0,
        "eyes": 0
    }
    Autocomplete text entry for filter values that correspond to facets 1448143294  
    1314856513 https://github.com/simonw/datasette/issues/1890#issuecomment-1314856513 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OXx5B simonw 9599 2022-11-15T06:56:29Z 2022-11-15T06:56:29Z OWNER

    Looks like I can fix that like so: html <datalist id="datalist-_city_id"> <option label="San Francisco" value="1"></option> <option label="Los Angeles" value="2"></option> <option label="Detroit" value="3"></option> <option label="Memnonia" value="4"></option> </datalist>

    {
        "total_count": 0,
        "+1": 0,
        "-1": 0,
        "laugh": 0,
        "hooray": 0,
        "confused": 0,
        "heart": 0,
        "rocket": 0,
        "eyes": 0
    }
    Autocomplete text entry for filter values that correspond to facets 1448143294  
    1314850524 https://github.com/simonw/datasette/issues/1890#issuecomment-1314850524 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OXwbc simonw 9599 2022-11-15T06:48:37Z 2022-11-15T06:48:37Z OWNER

    Spotted a bug with this on https://latest.datasette.io/fixtures/facetable?_facet=_city_id - the _city_id column is a foreign key, so you need to type 1 or 2 - but the autocomplete list shows the full text names for the cities.

    {
        "total_count": 0,
        "+1": 0,
        "-1": 0,
        "laugh": 0,
        "hooray": 0,
        "confused": 0,
        "heart": 0,
        "rocket": 0,
        "eyes": 0
    }
    Autocomplete text entry for filter values that correspond to facets 1448143294  
    1314849867 https://github.com/simonw/datasette/issues/1890#issuecomment-1314849867 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OXwRL simonw 9599 2022-11-15T06:47:51Z 2022-11-15T06:47:51Z OWNER

    Demo now live here: https://congress-legislators.datasettes.com/legislators/legislator_terms?_facet=party - select party and start typing.

    {
        "total_count": 0,
        "+1": 0,
        "-1": 0,
        "laugh": 0,
        "hooray": 0,
        "confused": 0,
        "heart": 0,
        "rocket": 0,
        "eyes": 0
    }
    Autocomplete text entry for filter values that correspond to facets 1448143294  
    1314848432 https://github.com/simonw/datasette/issues/1890#issuecomment-1314848432 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OXv6w simonw 9599 2022-11-15T06:46:08Z 2022-11-15T06:46:08Z OWNER

    Wrote a TIL about <datalist>: https://til.simonwillison.net/html/datalist

    {
        "total_count": 0,
        "+1": 0,
        "-1": 0,
        "laugh": 0,
        "hooray": 0,
        "confused": 0,
        "heart": 0,
        "rocket": 0,
        "eyes": 0
    }
    Autocomplete text entry for filter values that correspond to facets 1448143294  
    1314835740 https://github.com/simonw/datasette/issues/1890#issuecomment-1314835740 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OXs0c simonw 9599 2022-11-15T06:30:26Z 2022-11-15T06:30:26Z OWNER

    That prototype actually works really well! I'm going to add that to table.js.

    {
        "total_count": 0,
        "+1": 0,
        "-1": 0,
        "laugh": 0,
        "hooray": 0,
        "confused": 0,
        "heart": 0,
        "rocket": 0,
        "eyes": 0
    }
    Autocomplete text entry for filter values that correspond to facets 1448143294  
    1314833881 https://github.com/simonw/datasette/issues/1890#issuecomment-1314833881 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OXsXZ simonw 9599 2022-11-15T06:27:21Z 2022-11-15T06:27:21Z OWNER

    Here's a prototype: ```javascript function createDataLists() { var facetResults = document.querySelectorAll(".facet-results [data-column]"); Array.from(facetResults).forEach(function (facetResult) { // Use link text from all links in the facet result var linkTexts = Array.from( facetResult.querySelectorAll("li:not(.facet-truncated) a") ).map(function (link) { return link.textContent; }); // Create a datalist element var datalist = document.createElement("datalist"); datalist.id = "datalist-" + facetResult.dataset.column; // Create an option element for each link text linkTexts.forEach(function (linkText) { var option = document.createElement("option"); option.value = linkText; datalist.appendChild(option); }); // Add the datalist to the facet result facetResult.appendChild(datalist); }); } createDataLists();

    // When any select with name=_filter_column changes, update the datalist document.body.addEventListener("change", function (event) { if (event.target.name === "_filter_column") { event.target .closest(".filter-row") .querySelector(".filter-value") .setAttribute("list", "datalist-" + event.target.value); } }); ```

    {
        "total_count": 0,
        "+1": 0,
        "-1": 0,
        "laugh": 0,
        "hooray": 0,
        "confused": 0,
        "heart": 0,
        "rocket": 0,
        "eyes": 0
    }
    Autocomplete text entry for filter values that correspond to facets 1448143294  
    1314829751 https://github.com/simonw/datasette/issues/1890#issuecomment-1314829751 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OXrW3 simonw 9599 2022-11-15T06:20:50Z 2022-11-15T06:20:50Z OWNER

    This finds the right links on the page:

    document.querySelectorAll('.facet-results [data-column] li:not(.facet-truncated) a')
    
    {
        "total_count": 0,
        "+1": 0,
        "-1": 0,
        "laugh": 0,
        "hooray": 0,
        "confused": 0,
        "heart": 0,
        "rocket": 0,
        "eyes": 0
    }
    Autocomplete text entry for filter values that correspond to facets 1448143294  
    1314825019 https://github.com/simonw/datasette/issues/1890#issuecomment-1314825019 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OXqM7 simonw 9599 2022-11-15T06:13:36Z 2022-11-15T06:13:36Z OWNER

    This could start out as a purely JavaScript enhancement for pages that already figured out the available values through faceting, like you suggested.

    {
        "total_count": 0,
        "+1": 0,
        "-1": 0,
        "laugh": 0,
        "hooray": 0,
        "confused": 0,
        "heart": 0,
        "rocket": 0,
        "eyes": 0
    }
    Autocomplete text entry for filter values that correspond to facets 1448143294  
    1314823752 https://github.com/simonw/datasette/issues/1890#issuecomment-1314823752 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OXp5I simonw 9599 2022-11-15T06:11:49Z 2022-11-15T06:11:49Z OWNER

    I tried this out on https://congress-legislators.datasettes.com/legislators/legislator_terms for the party column - here's the demo:

    I made this work by dropping the following HTML into the page in the browser DevTools: ```html <datalist id="party">

    <option value="Anti-Administration"> <option value="Pro-Administration"> <option value="Republican"> <option value="Federalist"> <option value="Democratic Republican"> <option value="Pro-administration"> <option value="Anti-administration"> <option value="Unknown"> <option value="Adams"> <option value="Jackson"> <option value="Jackson Republican"> <option value="Crawford Republican"> <option value="Whig"> <option value="Jacksonian Republican"> <option value="Jacksonian"> <option value="Anti-Jacksonian"> <option value="Adams Democrat"> <option value="Nullifier"> <option value="Anti Mason"> <option value="Anti Masonic"> <option value="Anti Jacksonian"> <option value="Democrat"> <option value="Anti Jackson"> <option value="Union Democrat"> <option value="Conservative"> <option value="Ind. Democrat"> <option value="Independent"> <option value="Law and Order"> <option value="American"> <option value="Liberty"> <option value="Free Soil"> <option value="Ind. Republican-Democrat"> <option value="Ind. Whig"> <option value="Unionist"> <option value="States Rights"> <option value="Anti-Lecompton Democrat"> <option value="Constitutional Unionist"> <option value="Independent Democrat"> <option value="Unconditional Unionist"> <option value="Conservative Republican"> <option value="Ind. Republican"> <option value="Liberal Republican"> <option value="National Greenbacker"> <option value="Readjuster Democrat"> <option value="Readjuster"> <option value="Union"> <option value="Union Labor"> <option value="Populist"> <option value="Silver Republican"> <option value="Free Silver"> <option value="Silver"> <option value="Democratic and Union Labor"> <option value="Progressive Republican"> <option value="Progressive"> <option value="Prohibitionist"> <option value="Socialist"> <option value="Farmer-Labor"> <option value="American Labor"> <option value="Nonpartisan"> <option value="Coalitionist"> <option value="Popular Democrat"> <option value="Liberal"> <option value="New Progressive"> <option value="Republican-Conservative"> <option value="Democrat-Liberal"> <option value="AL"> <option value="Libertarian"> </datalist> ``` And then adding `list="party"` to the input element in the filter form.
    {
        "total_count": 0,
        "+1": 0,
        "-1": 0,
        "laugh": 0,
        "hooray": 0,
        "confused": 0,
        "heart": 0,
        "rocket": 0,
        "eyes": 0
    }
    Autocomplete text entry for filter values that correspond to facets 1448143294  
    1314821337 https://github.com/simonw/datasette/issues/1890#issuecomment-1314821337 https://api.github.com/repos/simonw/datasette/issues/1890 IC_kwDOBm6k_c5OXpTZ simonw 9599 2022-11-15T06:08:19Z 2022-11-15T06:08:19Z OWNER

    Oh interesting... this doesn't even need to be attached to the visible faceting feature, necessarily: Datasette could try to detect when a column has a limited number of options (which the faceting code handles already) and could turn those into an auto-complete interface.

    There's actually a native HTML element for this these days: the <datalist> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist

    {
        "total_count": 0,
        "+1": 0,
        "-1": 0,
        "laugh": 0,
        "hooray": 0,
        "confused": 0,
        "heart": 0,
        "rocket": 0,
        "eyes": 0
    }
    Autocomplete text entry for filter values that correspond to facets 1448143294  

    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 21.063ms · About: github-to-sqlite
    • Sort ascending
    • Sort descending
    • Facet by this
    • Hide this column
    • Show all columns
    • Show not-blank rows