From dc448c0005e76f8389f8cb8517bdbc5715a1931e Mon Sep 17 00:00:00 2001 From: Chris McCormick Date: Mon, 5 Jan 2026 08:10:08 +0800 Subject: [PATCH] Show warning if Filesystem API missing. --- TODO.md | 2 +- index.html | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 54bd3c6..e18bcad 100644 --- a/TODO.md +++ b/TODO.md @@ -8,13 +8,13 @@ ## TODO -- [ ] Warning colored note on home and about page if browser doesn't support FileSystem Access API. - [ ] Display sub-lines of the form `key: value` immediately after item ## Bugs ## Done +- [x] Warning colored note on home and about page if browser doesn't support FileSystem Access API. - [x] Ability to delete an item, with confirmation. - [x] When the dots menu shows on a 'completed' item the stuff behind it shows through - [x] Pressing + in a column and then cancel removes the button entirely diff --git a/index.html b/index.html index 2a1e93c..d6856bd 100644 --- a/index.html +++ b/index.html @@ -660,6 +660,13 @@ border-radius: var(--radius); } + .warning { + background-color: #885500; + color: #ffa500; + padding: 0.5em 1em; + border-radius: var(--radius); + } + .modal { position: fixed; z-index: 1000; @@ -812,6 +819,9 @@ chmod 755 kbtd
  • CLI tool to launch as a Chrome app: kbtd TODO.md
  • Two-way binding between UI and text file
  • +
    @@ -915,6 +925,9 @@ chmod 755 kbtd
  • Single HTML file - upload to self-host
  • CLI tool to launch as a Chrome app: kbtd TODO.md
  • +

    Source code for self-hosting

    Copyright © Chris McCormick 2025

    @@ -961,6 +974,10 @@ chmod 755 kbtd baseIndent: '' }; + function checkFileSystemAccessAPI() { + return 'showOpenFilePicker' in window; + } + function h(tag, props = {}, ...children) { const el = document.createElement(tag); for (const [k, v] of Object.entries(props)) { @@ -2368,6 +2385,12 @@ chmod 755 kbtd insertInstallInstructions('landing-instructions'); insertInstallInstructions('about-instructions'); + if (!checkFileSystemAccessAPI()) { + $('#api-warning').style.display = 'block'; + $('#about-api-warning').style.display = 'block'; + $('#open-file-btn').disabled = true; + } + const params = new URLSearchParams(window.location.search); state.filePath = params.get('file');