惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
C
Check Point Blog
G
Google Developers Blog
V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
MongoDB | Blog
MongoDB | Blog
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
D
Docker
Hugging Face - Blog
Hugging Face - Blog
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
A
About on SuperTechFans
Recent Announcements
Recent Announcements
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
阮一峰的网络日志
阮一峰的网络日志
Stack Overflow Blog
Stack Overflow Blog
Vercel News
Vercel News

RSS Minima activity

Commits · main · Dan Wolff / RSS Minima · GitLab Simplify focusability check - just use CSS selector (54a793c2) · Commits · Dan Wolff / RSS Minima · GitLab Add options for wraparound; remove "singleton" version: use more constants (9645e697) · Commits · Dan Wolff / RSS Minima · GitLab Keyboard nav: Extract constants (bbbc3736) · Commits · Dan Wolff / RSS Minima · GitLab Keyboard nav: Refactor (1c3d583a) · Commits · Dan Wolff / RSS Minima · GitLab Refactor keyboard nav (b7f4c485) · Commits · Dan Wolff / RSS Minima · GitLab 89b30bd99cd47db3f069b1afa1dab30ae768e80f to af96dfe02ba2e1bb1f8e305ec418e1dff4b4ef11 · Dan Wolff / RSS Minima · GitLab Support specifying a copy format, e.g. a yt-dlp command (89b30bd9) · Commits · Dan Wolff / RSS Minima · GitLab a28898e0b013a75a7f103049894ecab36ae3f990 to 46ac7df8d6b151c6c6f1eede52fdb75a5dca4ce4 · Dan Wolff / RSS Minima · GitLab ef463f06d6b3e3850441482fba774d61a91ab477 to a28898e0b013a75a7f103049894ecab36ae3f990 · Dan Wolff / RSS Minima · GitLab 339ccf9ac2206fdd123a9a38b5c9b05c426392e7 to ef463f06d6b3e3850441482fba774d61a91ab477 · Dan Wolff / RSS Minima · GitLab 3dcfae9d95512e48127a97effc2cc5071b60ecdd to 085fced8c32f6a71b9b256fa44828d016dd5fc9b · Dan Wolff / RSS Minima · GitLab Show the add feed form in the 'highlight' area (3dcfae9d) · Commits · Dan Wolff / RSS Minima · GitLab 6346d59cd010c1513ac9b7d4bf0a67424eb2d3b0 to 1df02a1b329902ab0e56fd1976851b8c0f715e65 · Dan Wolff / RSS Minima · GitLab c4da933b50794d649c07324c051c8b60ed45a770 to 6346d59cd010c1513ac9b7d4bf0a67424eb2d3b0 · Dan Wolff / RSS Minima · GitLab e21d4054912d86e30be16c105f916d35661ccb6f to c4da933b50794d649c07324c051c8b60ed45a770 · Dan Wolff / RSS Minima · GitLab Update readme (e21d4054) · Commits · Dan Wolff / RSS Minima · GitLab f6bc674460abacff785466f41feba4f73d3140d6 to fe6633a595231107eeb35f03b1d202fe1bd67626 · Dan Wolff / RSS Minima · GitLab Dan Wolff / RSS Minima · GitLab
Support enabling and disabling feeds (339ccf9a) · Commits...
Dan Wolff · 2023-02-05 · via RSS Minima activity
Original line number Diff line number Diff line
@@ -165,6 +165,8 @@
    "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/circle-dot.tsx": "1808df8c99ce83480354efe36a87093c0b64e9d090a48a341d53dfbb39944bce",
    "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/circle.tsx": "d18a2316dca0b4409706f54da187a8aac2f4cef4382f78501ee1eb7e3f361ae5",
    "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/copy.tsx": "990d45680d8839fd89ae9ef69222fc2b74e2226ea919ff0d0b04425840fdbd34",
    "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/eye-off.tsx": "ed21825f9aeac5473e5cf412346239f72d606ab4a6ae202035322db765ec9f55",
    "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/eye.tsx": "e473e51513658c7642fc50536ab9cf84c17273b1d03d8a68cd86579cb96bffea",
    "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/info-circle.tsx": "95f8ce0771c4c8f9d8e1cd073adaa2e37fb118d8f0512fa0de35851cf15b3fe2",
    "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/loader-2.tsx": "2043834bfba87c2121706d66aebdd7c0a3083460a59ed384e6b79df55ec5fe33",
    "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/triangle.tsx": "a5c7202080d3e3cc2a3a102f10878fe497da3f1d91b4d9a7141e3b75b19fdd56",
Original line number Diff line number Diff line
import IconAlertTriangle from "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/alert-triangle.tsx";
import IconCircle from "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/circle.tsx";
import IconCircleDot from "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/circle-dot.tsx";
import IconEye from "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/eye.tsx";
import IconEyeOff from "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/eye-off.tsx";
import { FunctionComponent } from "preact";
import Progress from "../components/Progress.tsx";
import listDisplayContext from "../lib/listDisplayContext.ts";
@@ -12,6 +14,7 @@ import {
  refreshFeed,
  removeFeed,
  setFeedCustomName,
  setFeedEnabled,
  setFeedUpdateFrequency,
} from "../state/operations.ts";
import { Feed } from "../state/State.ts";
@@ -43,6 +46,12 @@ const HighlightFeed: FunctionComponent<HighlightFeedProps> = function ({

  const resetTooltip = useTooltip(`Replace custom name '${feed.name}'`);

  const toggleEnabledTooltip = useTooltip(
    `${feed.enabled ? "Disable" : "Enable"} automatic feed updates`
  );
  const ToggleEnabledIcon = feed.enabled ? IconEye : IconEyeOff;
  const toggleEnabledText = `Feed ${feed.enabled ? "enabled" : "disabled"}`;

  const count = items.length;
  const readCount = items.reduce((sum, a) => sum + (a.isRead ? 1 : 0), 0);
  const unreadCount = count - readCount;
@@ -110,7 +119,7 @@ const HighlightFeed: FunctionComponent<HighlightFeedProps> = function ({
          Last update: <RelativeTime time={feed.lastUpdatedDateTime} />
        </div>
      )}
      <div>
      <div class={feed.enabled ? undefined : "opacity-60"}>
        Update frequency:{" "}
        <Select
          variant="transparent"
@@ -145,6 +154,19 @@ const HighlightFeed: FunctionComponent<HighlightFeedProps> = function ({
          </Button>
        </div>
      )}
      <div>
        {toggleEnabledTooltip.node}
        <Link
          ref={toggleEnabledTooltip.ref}
          onClick={() => dispatch(setFeedEnabled, feedId, !feed.enabled)}
        >
          <ToggleEnabledIcon
            size={"1em" as unknown as number}
            class="inline-block align-middle mr-2"
          />
          {toggleEnabledText}
        </Link>
      </div>
      <h3 class="text-xl mt-6 mb-4">Entries</h3>
      <div class="mb-2">
        <Button
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ import {
  highlightItem,
  markFeedAsRead,
  markFeedAsUnread,
  setFeedEnabled,
  setFeedExpanded,
} from "../state/operations.ts";
import useAppState from "../state/useAppState.ts";
@@ -15,6 +16,7 @@ import Link from "./Link.tsx";
import IconAlertTriangle from "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/alert-triangle.tsx";
import IconChevronRight from "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/chevron-right.tsx";
import IconChevronDown from "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/chevron-down.tsx";
import IconEyeOff from "https://deno.land/x/tabler_icons_tsx@0.0.2/tsx/eye-off.tsx";
import ListFeedEntry from "./ListFeedEntry.tsx";
import { Feed, FeedItem } from "../state/State.ts";
import useTooltip from "../lib/useTooltip.tsx";
@@ -25,6 +27,19 @@ interface ListFeedProps {
  feed: Feed;
}

const EnableButton: FunctionComponent<{
  onClick(): void;
}> = ({ onClick }) => {
  const t = useTooltip("Enable feed");

  return (
    <>
      {t.node}
      <IconButton ref={t.ref} icon={IconEyeOff} onClick={onClick} />
    </>
  );
};

const ExpandButton: FunctionComponent<{
  expanded: boolean;
  dimmed: boolean;
@@ -134,7 +149,7 @@ const EntriesList: FunctionComponent<{
const ListFeed: FunctionComponent<ListFeedProps> = ({ feed }) => {
  const { dispatch } = useAppState();

  let { feedId, expanded, items, name, lastError } = feed;
  let { feedId, expanded, enabled, items, name, lastError } = feed;

  const count = items.length;
  const readCount = items.reduce((sum, a) => sum + (a.isRead ? 1 : 0), 0);
@@ -154,7 +169,16 @@ const ListFeed: FunctionComponent<ListFeedProps> = ({ feed }) => {

  const expandShowsNothing = displayEntries === "unread" && items.length === 0;

  const expandButton = (
  const enableButton = !enabled && (
    <EnableButton
      onClick={() => {
        dispatch(setFeedEnabled, feedId, !enabled);
        dispatch(highlightItem, { type: "feed", feedId }, { force: true });
      }}
    />
  );

  const expandButton = enabled && (
    <ExpandButton
      expanded={expanded}
      dimmed={expandShowsNothing}
@@ -163,7 +187,7 @@ const ListFeed: FunctionComponent<ListFeedProps> = ({ feed }) => {
    />
  );

  const toggleReadButton = (
  const toggleReadButton = enabled && (
    <ToggleReadButton
      hasUnread={unreadCount > 0}
      disabled={count === 0}
@@ -189,13 +213,15 @@ const ListFeed: FunctionComponent<ListFeedProps> = ({ feed }) => {
      }
      error={!!lastError}
      name={name}
      unreadCount={expanded && !expandShowsNothing ? undefined : unreadCount}
      bold={unreadCount > 0 && displayFeeds === "all"}
      unreadCount={
        !enabled || (expanded && !expandShowsNothing) ? undefined : unreadCount
      }
      bold={enabled && unreadCount > 0 && displayFeeds === "all"}
      onClick={() => dispatch(highlightItem, { type: "feed", feedId })}
    />
  );

  const entriesList = expanded && (
  const entriesList = enabled && expanded && (
    <EntriesList
      feedId={feedId}
      text={
@@ -221,8 +247,9 @@ const ListFeed: FunctionComponent<ListFeedProps> = ({ feed }) => {

  return (
    <>
      <div class="flex gap-2">
      <div class={`flex gap-2 ${enabled ? "" : "opacity-60"}`}>
        <div class="whitespace-pre">
          {enableButton}
          {expandButton}
          {toggleReadButton}
        </div>
Original line number Diff line number Diff line
@@ -181,6 +181,10 @@ export default class BackEndApi {
    updateUserFeed({ userId: this.#userId, feedId, updateFrequencyMinutes });
  }

  setFeedEnabled(feedId: number, enabled: boolean) {
    updateUserFeed({ userId: this.#userId, feedId, enabled });
  }

  saveSettings(settings: string) {
    updateUser({
      userId: this.#userId,
Original line number Diff line number Diff line
export default {
  id: "10_add_userFeed.enabled",
  sql: `
    ALTER TABLE userFeed
    ADD COLUMN enabled INTEGER NOT NULL DEFAULT 1;
    `,
};