Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feed Example: Move display of example from separate page into standard APG example page #2775

Merged
merged 29 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
76aea70
Move feed example inside the page
ariellalgilmore Aug 10, 2023
86d965b
missing closing div
ariellalgilmore Aug 10, 2023
6bd013d
fix feed modal in mobile
ariellalgilmore Aug 10, 2023
bb2bee4
update tests
ariellalgilmore Aug 10, 2023
d515772
update feed example to use iframe
ariellalgilmore Aug 28, 2023
76492cb
fix linting issues
ariellalgilmore Aug 28, 2023
97e0565
fix feed tests
ariellalgilmore Aug 28, 2023
8869202
fix iframe reference
ariellalgilmore Aug 29, 2023
afc6dec
fix: update feed
andreancardona Aug 30, 2023
be5f596
fix delay time call
ariellalgilmore Aug 31, 2023
d060cdd
fix iframe src
ariellalgilmore Aug 31, 2023
a6c4fb7
update to example options
ariellalgilmore Sep 26, 2023
0edc38e
Update feed.html
andreancardona Sep 28, 2023
9239b1b
Make some editorial revisions to the introduction and remove fieldset…
mcking65 Oct 1, 2023
9d07514
Move label and further refine description of loadin delay
mcking65 Oct 1, 2023
788766d
Trigger the generation of a "preview" deployment
jugglinmike Oct 2, 2023
e731b07
Empty commit to trigger rebuild
howard-e Nov 1, 2023
f0aaf77
add button after feed
ariellalgilmore Dec 19, 2023
894dfa1
fix(feed): test update
ariellalgilmore Jan 8, 2024
b689ae4
fix(feed): color contrast
ariellalgilmore Jan 16, 2024
54fcb8e
fix(feed): bookmark button size
ariellalgilmore Jan 16, 2024
3c4fa26
Merge remote-tracking branch 'upstream/main' into issue-2747-feed-exa…
ariellalgilmore Jan 16, 2024
50f7a04
Merge remote-tracking branch 'origin/main' into issue-2747-feed-example
mcking65 Apr 7, 2024
2574099
update coverage & update ctrl-end to terms-of-use
ariellalgilmore Apr 30, 2024
fe7f062
Merge remote-tracking branch 'origin/main' into issue-2747-feed-example
mcking65 May 5, 2024
b83b2fb
Merge branch 'issue-2747-feed-example' of https://github.com/w3c/aria…
mcking65 May 5, 2024
dc06d9b
revise intro
mcking65 May 21, 2024
2e3b159
Correction to ctrl+home documentation
mcking65 May 21, 2024
f8307ad
Make link text match new example page title
mcking65 May 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions content/index/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h2 id="examples_by_role_label">Examples by Role</h2>
</tr>
<tr>
<td><code>article</code></td>
<td><a href="../patterns/feed/examples/feed.html">Feed</a></td>
<td><a href="../patterns/feed/examples/feed.html">Infinite Scrolling Feed</a></td>
</tr>
<tr>
<td><code>banner</code></td>
Expand Down Expand Up @@ -124,7 +124,7 @@ <h2 id="examples_by_role_label">Examples by Role</h2>
</tr>
<tr>
<td><code>feed</code></td>
<td><a href="../patterns/feed/examples/feed.html">Feed</a></td>
<td><a href="../patterns/feed/examples/feed.html">Infinite Scrolling Feed</a></td>
</tr>
<tr>
<td><code>form</code></td>
Expand Down Expand Up @@ -482,7 +482,7 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
</tr>
<tr>
<td><code>aria-busy</code></td>
<td><a href="../patterns/feed/examples/feed.html">Feed</a></td>
<td><a href="../patterns/feed/examples/feed.html">Infinite Scrolling Feed</a></td>
</tr>
<tr>
<td><code>aria-checked</code></td>
Expand Down Expand Up @@ -555,7 +555,7 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<li><a href="../patterns/combobox/examples/combobox-datepicker.html">Date Picker Combobox</a> (<abbr title="High Contrast Support">HC</abbr>)</li>
<li><a href="../patterns/dialog-modal/examples/datepicker-dialog.html">Date Picker Dialog</a> (<abbr title="High Contrast Support">HC</abbr>)</li>
<li><a href="../patterns/dialog-modal/examples/dialog.html">Modal Dialog</a></li>
<li><a href="../patterns/feed/examples/feed.html">Feed</a></li>
<li><a href="../patterns/feed/examples/feed.html">Infinite Scrolling Feed</a></li>
<li><a href="../patterns/table/examples/table.html">Table</a></li>
</ul>
</td>
Expand Down Expand Up @@ -672,7 +672,7 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<li><a href="../patterns/combobox/examples/grid-combo.html">Editable Combobox with Grid Popup</a></li>
<li><a href="../patterns/dialog-modal/examples/datepicker-dialog.html">Date Picker Dialog</a> (<abbr title="High Contrast Support">HC</abbr>)</li>
<li><a href="../patterns/dialog-modal/examples/dialog.html">Modal Dialog</a></li>
<li><a href="../patterns/feed/examples/feed.html">Feed</a></li>
<li><a href="../patterns/feed/examples/feed.html">Infinite Scrolling Feed</a></li>
<li><a href="../patterns/grid/examples/data-grids.html">Data Grid</a></li>
<li><a href="../patterns/grid/examples/layout-grids.html">Layout Grid</a></li>
<li><a href="../patterns/listbox/examples/listbox-collapsible.html">(Deprecated) Collapsible Dropdown Listbox</a></li>
Expand Down Expand Up @@ -755,7 +755,7 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<td><code>aria-posinset</code></td>
<td>
<ul>
<li><a href="../patterns/feed/examples/feed.html">Feed</a></li>
<li><a href="../patterns/feed/examples/feed.html">Infinite Scrolling Feed</a></li>
<li><a href="../patterns/treegrid/examples/treegrid-1.html">Treegrid Email Inbox</a></li>
<li><a href="../patterns/treeview/examples/treeview-1b.html">File Directory Treeview Using Declared Properties</a></li>
</ul>
Expand Down Expand Up @@ -825,7 +825,7 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<td><code>aria-setsize</code></td>
<td>
<ul>
<li><a href="../patterns/feed/examples/feed.html">Feed</a></li>
<li><a href="../patterns/feed/examples/feed.html">Infinite Scrolling Feed</a></li>
<li><a href="../patterns/treegrid/examples/treegrid-1.html">Treegrid Email Inbox</a></li>
<li><a href="../patterns/treeview/examples/treeview-1b.html">File Directory Treeview Using Declared Properties</a></li>
</ul>
Expand Down
23 changes: 2 additions & 21 deletions content/patterns/feed/examples/feed-display.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,11 @@
<script src="js/main.js"></script>
</head>
<body>
<main>
<h1>Recommended Restaurants</h1>

<section>
<h2>About This Example</h2>
<p>
<strong>NOTE:</strong> The feed role is a new WAI-ARIA feature, introduced by WAI-ARIA 1.1.
This page provides a proposed implementation of a feed component.
This proposal does not yet have ARIA Practices Task Force consensus.
Feedback is welcome in <a href="https://github.com/w3c/aria-practices/issues/565">issue 565.</a>
</p>
</section>
<h3>Recommended Restaurants</h3>

<section id="main-content">
<div id="restaurant-feed" role="feed"></div>
</section>

<section id="side-panel">
<label for="delay-time-select">Select article loading delay</label>
<select id="delay-time-select" name="delay_time">
<option value="200">200 ms</option>
<option value="400">400 ms</option>
</select>
</section>
</main>

</body>
</html>
24 changes: 19 additions & 5 deletions content/patterns/feed/examples/feed.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Feed Example</title>
<title>Infinite Scrolling Feed Example</title>

<!-- Core JS and CSS shared by all examples -->
<link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2016/base.css">
Expand All @@ -21,7 +21,7 @@
</ul>
</nav>
<main>
<h1>Feed Example</h1>
<h1>Infinite Scrolling Feed Example</h1>

<section>
<h2>About This Example</h2>
Expand All @@ -34,16 +34,30 @@ <h2>About This Example</h2>
<p>
The example below implements the <a href="../feed-pattern.html">Feed Pattern</a> for a restaurant review site.
To imitate an infinitely scrolling set of data, information about ten restaurants is repeatedly loaded as the user reads the feed.
Outside of the feed, an article load time selector is available for simulating data fetch delays.
This example includes an article load time selector that simulates data fetch delays.
</p>
<p>Unlike other examples in the WAI-ARIA Authoring Practices, the example experience has its own page separate from this documentation page.</p>
</section>

<section>
<h2>Example Usage Option</h2>
<p id="feed-controls-desc">
The following article loading delay time selector enables simulation of different amounts of latency introduced by data fetches.
Such latency can affect assistive technology behavior when using assistive technology functions for navigating by article.
</p>
<label for="delay-time-select"> Loading delay</label>
<select id="delay-time-select" name="delay_time" aria-describedby="feed-controls-desc">
<option value="200">200 ms</option>
<option value="400">400 ms</option>
</select>
</section>

<section>
<h2 id="ex_label">Example</h2>
<div role="separator" id="ex_start_sep" aria-labelledby="ex_start_sep ex_label" aria-label="Start of"></div>
<div id="ex1">
<p>The example feed experience is presented on a separate <a href="feed-display.html">feed display page.</a></p>
<p>The example feed experience below is presented in an iframe in order not to obstruct from the rest of the content of the page.</p>
<iframe id="feed_frame" src="./feed-display.html" height="500" title="Feed example" style="width: 100%"></iframe>
a11ydoer marked this conversation as resolved.
Show resolved Hide resolved
<button onclick="alert('This is just for demo purposes')">Terms of use</button>
</div>
<div role="separator" id="ex_end_sep" aria-labelledby="ex_end_sep ex_label" aria-label="End of"></div>
</section>
Expand Down
Binary file removed content/patterns/feed/examples/imgs/rating-1.png
Binary file not shown.
Binary file removed content/patterns/feed/examples/imgs/rating-2.png
Binary file not shown.
Binary file removed content/patterns/feed/examples/imgs/rating-3.png
Binary file not shown.
Binary file removed content/patterns/feed/examples/imgs/rating-4.png
Binary file not shown.
Binary file removed content/patterns/feed/examples/imgs/rating-5.png
Binary file not shown.
2 changes: 1 addition & 1 deletion content/patterns/feed/examples/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
window.addEventListener('load', function () {
var feedNode = document.getElementById('restaurant-feed');
var delaySelect = document.getElementById('delay-time-select');
var delaySelect = window.parent.document.getElementById('delay-time-select');
var restaurantFeed = new aria.Feed(feedNode, delaySelect);

var restaurantFeedDisplay = new aria.FeedDisplay(restaurantFeed, function () {
Expand Down
17 changes: 4 additions & 13 deletions test/tests/feed_feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const assertAriaDescribedby = require('../util/assertAriaDescribedby');
const exampleFile = 'content/patterns/feed/examples/feed.html';

const ex = {
feedLinkSelector: '#ex1 a',
frameID: 'feed_frame',
feedSelector: '[role="feed"]',
articleSelector: '[role="article"]',
timeToLoad10Articles: 2500,
Expand All @@ -19,17 +19,7 @@ const ex = {
};

const navigateToFeed = async function (t) {
await t.context.session.findElement(By.css(ex.feedLinkSelector)).click();

return t.context.session.wait(
() => {
return t.context.session.getCurrentUrl().then((url) => {
return url != t.context.url;
});
},
t.context.waitTime,
'The feed url did not load after clicking: ' + ex.feedLinkSelector
);
await t.context.session.switchTo().frame(ex.frameID);
};

const waitForArticlesToLoad = async function (t) {
Expand Down Expand Up @@ -264,7 +254,8 @@ ariaTest(
await waitForArticlesToLoad(t);

let articles = await t.context.queryElements(t, ex.articleSelector);
articles[0].sendKeys(Key.chord(Key.CONTROL, Key.END));
await articles[0].sendKeys(Key.chord(Key.CONTROL, Key.END));
await t.context.session.switchTo().defaultContent();

t.true(
await checkFocus(t, ex.delayTimeSelector, 0),
Expand Down
Loading