Skip to content

Commit 51ce79a

Browse files
authored
feat: link included feeds to the instance feed directory (#901)
## Summary - link the included-feeds utility entry to the instance feed directory - refine the disabled feed-creation state into a clearer included-feeds card - keep the affected UI states aligned across create and token-gate flows ## Verification - docker compose -f .devcontainer/docker-compose.yml up -d - docker exec devcontainer-app-1 bash -lc 'cd /workspace && make setup' - docker exec devcontainer-app-1 bash -lc 'cd /workspace && make ready' - browser smoke at http://127.0.0.1:4001/ for default composer, token prompt, and feed-creation-disabled included-feed state
1 parent b4e62ad commit 51ce79a

4 files changed

Lines changed: 75 additions & 18 deletions

File tree

frontend/src/__tests__/App.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ describe('App', () => {
400400
});
401401

402402
it('shows the utility links in a user-focused order', () => {
403+
window.history.replaceState({}, '', 'http://localhost:3000/#result');
403404
render(<App />);
404405

405406
fireEvent.click(screen.getByRole('button', { name: 'More' }));
@@ -419,7 +420,7 @@ describe('App', () => {
419420
);
420421
expect(screen.getByRole('link', { name: 'Try included feeds' })).toHaveAttribute(
421422
'href',
422-
'https://html2rss.github.io/web-application/how-to/use-included-configs/'
423+
'https://html2rss.github.io/feed-directory/#!url=http%3A%2F%2Flocalhost%3A3000%2F'
423424
);
424425
expect(screen.getByRole('link', { name: 'Install from Docker Hub' })).toHaveAttribute(
425426
'href',

frontend/src/components/AppPanels.tsx

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,20 @@ export function CreateFeedPanel({
152152
role="status"
153153
aria-label="Included feeds"
154154
>
155+
<p class="ui-eyebrow">Included feeds</p>
155156
<div class="notice__title">Try a working included feed</div>
156-
<p>Start with one of the embedded configs from this instance:</p>
157-
{featuredFeeds.map((feed) => (
158-
<p key={feed.path}>
159-
<a href={feed.path}>{feed.title}</a>
160-
{' - '}
161-
{feed.description}
162-
</p>
163-
))}
164-
<p>
157+
<p class="notice__intro">Start with a ready-made feed from this instance.</p>
158+
<div class="featured-feed-list" role="list" aria-label="Featured feeds">
159+
{featuredFeeds.map((feed) => (
160+
<div key={feed.path} class="featured-feed-item" role="listitem">
161+
<a href={feed.path} class="featured-feed-item__link" aria-label={feed.title}>
162+
<span class="featured-feed-item__title">{feed.title}</span>
163+
<span class="featured-feed-item__description">{feed.description}</span>
164+
</a>
165+
</div>
166+
))}
167+
</div>
168+
<p class="notice__meta">
165169
<a
166170
href="https://html2rss.github.io/web-application/how-to/use-included-configs/"
167171
target="_blank"
@@ -255,6 +259,14 @@ export function UtilityStrip({
255259
onClearToken,
256260
}: UtilityStripProps) {
257261
const [isOpen, setIsOpen] = useState(false);
262+
const includedFeedsHref = (() => {
263+
const directoryUrl = new URL('https://html2rss.github.io/feed-directory/');
264+
if (typeof window === 'undefined') return directoryUrl.toString();
265+
266+
const instanceUrl = new URL('/', window.location.origin);
267+
directoryUrl.hash = `!url=${encodeURIComponent(instanceUrl.toString())}`;
268+
return directoryUrl.toString();
269+
})();
258270

259271
if (hidden) return null;
260272

@@ -270,12 +282,7 @@ export function UtilityStrip({
270282
</button>
271283
{isOpen && (
272284
<div class="utility-strip__items">
273-
<a
274-
href="https://html2rss.github.io/web-application/how-to/use-included-configs/"
275-
target="_blank"
276-
rel="noopener noreferrer"
277-
class="utility-link"
278-
>
285+
<a href={includedFeedsHref} target="_blank" rel="noopener noreferrer" class="utility-link">
279286
Try included feeds
280287
</a>
281288
<Bookmarklet />

frontend/src/styles/main.css

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,55 @@ a:focus-visible {
345345
font-weight: var(--text-strong);
346346
}
347347

348+
.notice__intro,
349+
.notice__meta {
350+
color: var(--text-muted);
351+
}
352+
353+
.featured-feed-list {
354+
display: grid;
355+
gap: var(--space-3);
356+
}
357+
358+
.featured-feed-item {
359+
padding: var(--space-3);
360+
border: var(--border-default);
361+
border-radius: var(--radius-md);
362+
background: var(--surface-elevated);
363+
}
364+
365+
.featured-feed-item__link {
366+
display: grid;
367+
gap: var(--space-1);
368+
transition:
369+
border-color var(--transition-fast),
370+
background-color var(--transition-fast),
371+
transform var(--transition-fast);
372+
}
373+
374+
.featured-feed-item:hover,
375+
.featured-feed-item:focus-within {
376+
border-color: var(--border-strong);
377+
background: rgba(255, 255, 255, 0.065);
378+
}
379+
380+
.featured-feed-item__link:hover,
381+
.featured-feed-item__link:focus-visible {
382+
text-decoration: none;
383+
transform: translateY(-0.04rem);
384+
}
385+
386+
.featured-feed-item__title {
387+
color: var(--text-strong);
388+
font-size: var(--font-size-1);
389+
font-weight: 600;
390+
}
391+
392+
.featured-feed-item__description {
393+
color: var(--text-muted);
394+
line-height: 1.4;
395+
}
396+
348397
.notice[data-tone="error"] {
349398
border-color: rgba(248, 113, 113, 0.22);
350399
background: var(--bg-danger);

public/shared-ui.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Shared design-system primitives for both the app UI and RSS/XSL surfaces. See docs/design-system.md before changing this file. */
22
:root {
33
color-scheme: dark;
4-
--font-family-ui: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
5-
--font-family-display: "Fraunces", "Iowan Old Style", "Georgia", serif;
4+
--font-family-ui: system-ui, -apple-system, "Segoe UI", sans-serif;
5+
--font-family-display: system-ui, -apple-system, "Segoe UI", sans-serif;
66
--font-family-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
77
--font-size-00: 0.8125rem;
88
--font-size-0: 0.9375rem;

0 commit comments

Comments
 (0)