diff --git a/docs/design/ja/feeds.md b/docs/design/ja/feeds.md index f7f8955..53c10f7 100644 --- a/docs/design/ja/feeds.md +++ b/docs/design/ja/feeds.md @@ -150,6 +150,9 @@ source指定と組み合わせ、既存の未読・star・検索・keysetペー 絞り込み対象は最新200記事のcache内に限られ、購読を選んでも履歴全件を外部取得しません。 購読の追加・削除やカテゴリの編集はFreshRSS側で行います。 +ショートカットヘルプは`?`で開閉し、`Esc`または閉じるボタンでも閉じます。 +ヘルプだけを閉じる操作では閲覧中の記事や入力フォームを変更せず、エラー等のstatus表示も保持します。 + ## 既読とstarの書戻し server-authoritative stateと未送信の操作を分けます。操作ごとのrequest_idで重複を防ぎ、成功応答前に確定済みと表示しません。newsboat等で同時変更された場合、古いローカルcacheをまとめて送り返しません。接続解除・認可失効時は未送信変更を勝手に再送しません。 @@ -274,6 +277,13 @@ previewはsource UUID・設定versionのsnapshotを返し、適用時に一致 既定はURL、出典、短いメモの保存です。全文保存は取得可能性・利用条件・個人用途等を確認する独立操作とし、feedが短いからといって有料記事を自動取得しません。保存先が自動公開範囲なら内容と添付の公開を明示確認します。 +タスク拡張が有効な場合、Wiki親Pathの初期値はDomain・本人単位の個人設定`wiki_prefix`を使います。 +「個人設定 → メール・RSS取り込みの既定Wiki親Path」で設定し、メール取り込みと共通です。 +RSS画面を読み込んだ時点の値を初期表示し、取り込みごとの上書き・空欄への変更を許します。 +空欄でタスク作成を選んだ場合はWikiを作らず、個人設定の値を再適用しません。 +未設定またはタスク拡張が無効な場合は空欄です。プロジェクトのWiki配下への暗黙の補完はRSSでは行いません。 +保存時の公開範囲確認とACL検査は省略しません。既存preferencesを利用するため追加のschema変更はありません。 + Wiki単独は親Path配下の `rss-{request UUID}` に新規作成します。既存Pathを上書きせず、Page・Path・ 初回Revision・活動outbox・再送receiptを同じDB transactionで保存します。権限はtransaction内でも 再確認します。初期版の単独保存は通常Wiki空間のみで、独自所有契約を持つ`/u`・`/g`は対象外です。 diff --git a/internal/server/feeds.go b/internal/server/feeds.go index c36deed..8c238a4 100644 --- a/internal/server/feeds.go +++ b/internal/server/feeds.go @@ -38,7 +38,16 @@ func (s *Server) handleFeeds(w http.ResponseWriter, r *http.Request) { taskError(w, e) return } - s.renderWithContext(w, r, "feeds.gohtml", map[string]any{"Title": "RSS", "FeedWritable": active}) + prefix := "" + if s.systemExtensionEnabled(domain, "organizer.tasks") { + preferences, e := s.store.TaskPreferences(r.Context(), domain, actor) + if e != nil { + taskError(w, e) + return + } + prefix = preferences.WikiPrefix + } + s.renderWithContext(w, r, "feeds.gohtml", map[string]any{"Title": "RSS", "FeedWritable": active, "FeedWikiPrefix": prefix}) return } key := strings.TrimPrefix(r.URL.Path, feedsAPI) diff --git a/internal/server/feeds_test.go b/internal/server/feeds_test.go index 95698cf..16679e1 100644 --- a/internal/server/feeds_test.go +++ b/internal/server/feeds_test.go @@ -531,6 +531,14 @@ func TestFeedsChromium(t *testing.T) { t.Skip("opt-in Chromium") } s, token, domain, actor, source := feedFixture(t) + prefs, err := s.store.TaskPreferences(context.Background(), domain, actor) + if err != nil { + t.Fatal(err) + } + prefs.WikiPrefix = "/notes/rss-default" + if _, err = s.store.SaveTaskPreferences(context.Background(), domain, actor, prefs, time.Now()); err != nil { + t.Fatal(err) + } claim, e := s.store.ClaimFeed(context.Background(), source) if e != nil { t.Fatal(e) diff --git a/internal/server/testdata/feeds.js b/internal/server/testdata/feeds.js index 787740b..a40d2b3 100644 --- a/internal/server/testdata/feeds.js +++ b/internal/server/testdata/feeds.js @@ -20,7 +20,7 @@ d.dispatchEvent(new w.KeyboardEvent('keydown',{key:'/',bubbles:true}));await wait(()=>d.activeElement.type==='search');d.activeElement.value='119';d.activeElement.dispatchEvent(new w.Event('input',{bubbles:true}));await wait(()=>d.querySelectorAll('.feed-row').length===1); d.querySelector('.feed-row').click();await wait(()=>d.querySelector('#feed-reader .feed-body')); d.querySelector('#feed-reader .feed-actions button:last-child').click();await wait(()=>d.querySelector('#feed-reader form')); - const form=d.querySelector('#feed-reader form'),inputs=form.querySelectorAll('input');inputs[2].value='/notes/feed-ui';inputs[2].dispatchEvent(new w.Event('input'));inputs[5].checked=true;form.requestSubmit();await wait(()=>d.querySelector('#feed-reader a[href^="/v/uuid:"]')); + const form=d.querySelector('#feed-reader form'),inputs=form.querySelectorAll('input');assert(inputs[2].value==='/notes/rss-default','Wiki default not filled');assert(form.querySelector('a[href="/-/sys/config?panel=organizer"]'),'Default settings link missing');inputs[2].value='/notes/feed-ui';inputs[2].dispatchEvent(new w.Event('input'));inputs[5].checked=true;form.requestSubmit();await wait(()=>d.querySelector('#feed-reader a[href^="/v/uuid:"]')); const search=d.querySelector('#feed-toolbar input');search.value='';search.dispatchEvent(new w.Event('input',{bubbles:true}));await wait(()=>d.querySelectorAll('.feed-row').length===100);d.querySelector('.feed-row').click();await wait(()=>d.querySelector('#feed-reader .feed-body')); assert(d.documentElement.scrollWidth<=w.innerWidth,'Reader overflow'); d.getElementById('feed-opml').click();await wait(()=>d.getElementById('feed-opml-file')); diff --git a/static/js/feeds.js b/static/js/feeds.js index 762a88e..2677099 100644 --- a/static/js/feeds.js +++ b/static/js/feeds.js @@ -178,7 +178,8 @@ editing=true;detailSeq++;reader.replaceChildren();const form=el('form');reader.append(form);form.append(el('h1',t('Attributed Wiki note / task','出典付きWikiメモ・タスク'))); const title=field(form,t('Title','件名'),item.title.slice(0,250));title.required=true;title.maxLength=300; const task=field(form,t('Also create a task','タスクを作成する'),'','checkbox');task.disabled=root.dataset.tasks!=='true'; - const prefix=field(form,t('Wiki parent Path (empty = task only)','Wikiの親Path(空ならタスクのみ)'),'');prefix.placeholder='/notes/feeds';prefix.required=true; + const prefix=field(form,t('Wiki parent Path (empty = task only)','Wikiの親Path(空ならタスクのみ)'),root.dataset.wikiPrefix||'');prefix.placeholder='/notes/feeds';prefix.required=true;prefix.maxLength=500; + if(root.dataset.tasks==='true'){const settings=el('a','⚙');settings.href='/-/sys/config?panel=organizer';settings.target='_blank';settings.rel='noopener';settings.title=settings.ariaLabel=t('Configure default Wiki parent path in personal settings','個人設定で既定のWiki親Pathを設定');prefix.parentElement.append(settings);} const notes=field(form,t('Your note','メモ'));const copy=field(form,t('Include cached text (explicit copy)','取得済み本文も保存する(明示コピー)'),'','checkbox'); const confirm=field(form,t('I checked the destination publication policy and the material to copy.','保存先の公開範囲と、コピーする内容を確認しました。'),'','checkbox');confirm.required=true; const validate=()=>{prefix.required=!task.checked;confirm.required=!!prefix.value.trim()||!task.checked;};task.onchange=prefix.oninput=validate; diff --git a/static/js/task-productivity.js b/static/js/task-productivity.js index 7b38520..862fd85 100644 --- a/static/js/task-productivity.js +++ b/static/js/task-productivity.js @@ -5,7 +5,7 @@ const word={tasks:['Tasks','タスク'],report:['Activity report','達成度・作業レポート'],settings:['Task defaults and email','タスクの既定値・メール'],contacts:['Contacts','連絡先'],completed:['Completed','完了件数'],points:['Points','ポイント'],work:['Work hours','作業時間'],focus:['Pomodoro hours','集中時間'],save:['Save','保存'],saved:['Saved','保存しました'],refresh:['Refresh','更新'],project_uuid:['Default project','既定のプロジェクト'],assignee_uuid:['Assignee UUID (annotation only)','担当者UUID(管理用メモ)'],due_days:['Due in days','期限までの日数'],start_days:['Start in days','着手までの日数'],planned_days:['Plan in days','取り組む日までの日数'],review_days:['Review in days','見直しまでの日数'],estimate_minutes:['Estimated minutes','見込み工数(分)'],complexity:['Complexity (1–5)','複雑度(1〜5)'],digest_enabled:['Email daily task list to my account email','毎日のやることリストを自分のメールに送る'],digest_time:['Delivery time','配信時刻'],timezone:['IANA timezone','タイムゾーン(IANA)'],none:['None','なし'],empty:['No records in this period.','この期間の記録はありません。'],partial:['Partial results: narrow the period.','件数上限に達しました。期間を狭めてください。'],error:['Request failed. Input is retained.','処理に失敗しました。入力は保持しています。'],email_required:['Set your account email first.','先にプロフィールにメールアドレスを設定してください。'],smtp_unavailable:['Ask an administrator to configure SMTP.','管理者によるSMTP設定が必要です。']}; const t=k=>(word[k]||[k,k])[ja?1:0],el=(tag,text)=>{const n=document.createElement(tag);if(text!==undefined)n.textContent=text;return n;}; Object.assign(word,{notify_due:['Notify on due dates','期限日に通知する'],notify_planned:['Notify on planned dates','取り組む日に通知する'],reminder_time:['Default notification time','通知の既定時刻']}); - Object.assign(word,{wiki_prefix:['Default Wiki parent path for mail','メール本文の既定Wiki親Path']}); + Object.assign(word,{wiki_prefix:['Default Wiki parent path for mail / RSS','メール・RSS取り込みの既定Wiki親Path']}); const status=root.querySelector('#productivity-status'),content=root.querySelector('#productivity-content'); root.querySelectorAll('[data-word]').forEach(n=>n.textContent=t(n.dataset.word));root.querySelector('h1,h2,h3').textContent=t(root.dataset.view==='settings'?'settings':'report'); async function request(path,options={}){const timeout=AbortSignal.timeout(15000);const r=await fetch(api+path,{credentials:'same-origin',cache:'no-store',signal:signal?AbortSignal.any([signal,timeout]):timeout,...options,headers:{'Content-Type':'application/json',...options.headers}});const d=await r.json().catch(()=>({}));if(!r.ok||r.redirected)throw Error(t(d.error||'error'));return d;} @@ -26,7 +26,7 @@ if(key==='project_uuid')for(const option of input.options)option.defaultSelected=option.selected=option.value===(p.project_uuid||''); else if(input.type==='checkbox')input.defaultChecked=input.checked; else input.defaultValue=input.value; - if(key==='wiki_prefix'){input.placeholder='/private/mail';input.maxLength=500;const help=el('p',ja?'メール本文をWikiに保存する親Pathです。空欄ならプロジェクトのWiki配下を使います。保存した本文はそのPathの公開範囲・閲覧権限に従います。':'Parent path for mail Wiki pages. If blank, use the project Wiki subtree. Saved mail inherits the destination path’s visibility and read permissions.');help.className='productivity-note';form.append(help);} + if(key==='wiki_prefix'){input.placeholder='/notes';input.maxLength=500;const help=el('p',ja?'メール本文・RSSのWiki取り込みに使う親Pathです。RSSでは入力欄の初期値になり、空にすればタスクのみ作成できます。設定が空欄の場合、メールはプロジェクトのWiki配下を使い、RSSは未入力になります。保存内容はそのPathの公開範囲・閲覧権限に従います。':'Parent path for mail / RSS Wiki captures. RSS pre-fills this value; clearing it allows task-only capture. If unset, mail uses the project Wiki subtree and RSS leaves the field blank. Saved content inherits the destination visibility and read permissions.');help.className='productivity-note';form.append(help);} if(key==='reminder_time'){const help=el('p',ja?'新規タスクの対応する日付が設定されている場合だけ通知します。既存タスクは変更しません。通知時刻は保存時のドメインのタイムゾーン('+data.timezone+')を使用します。':'Reminders apply only to new tasks with the corresponding date. Existing tasks are unchanged. Times use the Domain timezone on save ('+data.timezone+').');help.className='productivity-note';form.append(help);} } const note=el('p',ja?'日数は作成日からの暦日です。空欄は未設定、0は当日。担当者の指定では閲覧権限は付与されません。メールは今日の計画・期限到来分を最大100件送ります。SMTPは管理者設定を使用し、配信時刻にはキュー待ちの遅延があります。':'Offsets are calendar days from creation; blank means unset, 0 means today. Assignment does not grant access. Email includes up to 100 tasks planned or due today, using administrator SMTP settings. Queue delays may apply.');note.className='productivity-note';form.append(note); diff --git a/templates/pages/feeds.gohtml b/templates/pages/feeds.gohtml index f1c84e1..543de6d 100644 --- a/templates/pages/feeds.gohtml +++ b/templates/pages/feeds.gohtml @@ -3,7 +3,7 @@ {{ T "feeds.title" }} · {{ .WikiName }}
{{ .WikiName }}
{{ template "auth-menu" . }}
{{ template "organizer-nav" . }} -
+

{{ end }} diff --git a/templates/pages/organizer_dashboard.gohtml b/templates/pages/organizer_dashboard.gohtml index b39508d..44b4fc5 100644 --- a/templates/pages/organizer_dashboard.gohtml +++ b/templates/pages/organizer_dashboard.gohtml @@ -4,4 +4,4 @@ {{ template "organizer-nav" . }}

{{ T "organizer.dashboard" }}

{{ .Today }} · {{ .Timezone }}

-
{{ end }} +
{{ end }} diff --git a/templates/pages/organizer_settings.gohtml b/templates/pages/organizer_settings.gohtml index a3e8576..cdea39d 100644 --- a/templates/pages/organizer_settings.gohtml +++ b/templates/pages/organizer_settings.gohtml @@ -6,4 +6,4 @@ {{ if .FeedsEnabled }}

{{ T "feeds.title" }}

{{ T "feeds.help" }}

⚙ {{ T "feeds.title" }}
{{ end }} {{ if .TasksEnabled }}

{{ end }} {{ if .CalendarEnabled }}

{{ T "organizer.calendar_defaults" }}

{{ end }} -{{ end }} +{{ end }}