feeds-fun 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feeds-fun",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "author": "Aliaksei Yaletski (Tiendil) <a.eletsky@gmail.com> (https://tiendil.org/)",
5
5
  "description": "Frontend for the Feeds Fun — web-based news reader",
6
6
  "keywords": [
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="ffun-info-attention">
3
+ <p> Make your first rule to experience the reader's full capabilities! </p>
4
+
5
+ <ul class="list-decimal list-inside">
6
+ <li>Click a tag under a news.</li>
7
+ <li>Select more tags if needed.</li>
8
+ <li>Set a score for the rule.</li>
9
+ <li>Click "Create Rule".</li>
10
+ <li>See how the news gets organized based on your preferences!</li>
11
+ </ul>
12
+ </div>
13
+ </template>
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <notification-openai-api-key v-if="showOpenAIKeyNotification" />
3
3
  <notification-collections v-if="showCollectionsNotification" />
4
+ <notification-create-rule-help v-if="showCreateRuleHelpNotification" />
4
5
  </template>
5
6
 
6
7
  <script lang="ts" setup>
@@ -10,6 +11,7 @@
10
11
  const properties = defineProps<{
11
12
  openaiApiKey: boolean;
12
13
  collections: boolean;
14
+ createRuleHelp: boolean;
13
15
  }>();
14
16
 
15
17
  const globalSettings = useGlobalSettingsStore();
@@ -26,7 +28,16 @@
26
28
  return properties.collections;
27
29
  });
28
30
 
31
+ const showCreateRuleHelpNotification = computed(() => {
32
+ return !showCollectionsNotification.value && properties.createRuleHelp;
33
+ });
34
+
29
35
  const showOpenAIKeyNotification = computed(() => {
30
- return !showCollectionsNotification.value && properties.openaiApiKey && showApiKeyMessage.value;
36
+ return (
37
+ !showCollectionsNotification.value &&
38
+ !showCreateRuleHelpNotification.value &&
39
+ properties.openaiApiKey &&
40
+ showApiKeyMessage.value
41
+ );
31
42
  });
32
43
  </script>
package/src/main.ts CHANGED
@@ -28,6 +28,7 @@ import OpenaiTokensUsage from "./components/OpenaiTokensUsage.vue";
28
28
  import FaviconElement from "./components/FaviconElement.vue";
29
29
  import NotificationCollections from "./components/NotificationCollections.vue";
30
30
  import NotificationOpenaiApiKey from "./components/NotificationOpenaiApiKey.vue";
31
+ import NotificationCreateRuleHelp from "./components/NotificationCreateRuleHelp.vue";
31
32
  import Notifications from "./components/Notifications.vue";
32
33
  import RuleForList from "./components/RuleForList.vue";
33
34
  import UserSettingForNotification from "./components/UserSettingForNotification.vue";
@@ -71,6 +72,7 @@ app.component("OpenaiTokensUsage", OpenaiTokensUsage);
71
72
  app.component("FaviconElement", FaviconElement);
72
73
  app.component("NotificationCollections", NotificationCollections);
73
74
  app.component("NotificationOpenaiApiKey", NotificationOpenaiApiKey);
75
+ app.component("NotificationCreateRuleHelp", NotificationCreateRuleHelp);
74
76
  app.component("Notifications", Notifications);
75
77
  app.component("RuleForList", RuleForList);
76
78
  app.component("UserSettingForNotification", UserSettingForNotification);
@@ -47,6 +47,7 @@
47
47
 
48
48
  <notifications
49
49
  v-if="entriesStore.loadedEntriesReport !== null"
50
+ :create-rule-help="hasEntries && !hasRules"
50
51
  :openai-api-key="true"
51
52
  :collections="!hasEntries" />
52
53
 
@@ -167,6 +168,21 @@
167
168
  return entriesNumber.value > 0;
168
169
  });
169
170
 
171
+ const hasRules = computed(() => {
172
+ if (!hasEntries.value) {
173
+ return false;
174
+ }
175
+
176
+ // TODO: is is heuristics (score could be 0 even with rules)
177
+ // must be refactored to something more stable
178
+ for (const entryId of entriesReport.value) {
179
+ if (entriesStore.entries[entryId].score != 0) {
180
+ return true;
181
+ }
182
+ }
183
+ return false;
184
+ });
185
+
170
186
  const timeField = computed(() => {
171
187
  const orderProperties = e.EntriesOrderProperties.get(globalSettings.entriesOrder);
172
188