# @fluid-internal/devtools-view This library contains a simple view for visualizing data generated by Fluid Devtools. This library also powers our [Chrome Extension](https://developer.chrome.com/docs/extensions/overview/): [@fluid-internal/devtools-browser-extension][]. **IMPORTANT: Fluid Framework uses this package as an implementation detail.** **Do not use it as a public dependency.** **We do not guarantee the stability of this package or its APIs.** ## Usage This library has 2 primary entry-points: 1. A React component: `DevtoolsPanel`. 2. An environment-agnostic rendering hook: TODO. ## Working in the package ### Build To build the package locally, first ensure you have run `pnpm install` from the root of the mono-repo. Next, to build the code, run `npm run build` from the root of the mono-repo, or use [fluid-build](https://github.com/microsoft/FluidFramework/tree/main/build-tools/packages/build-tools#running-fluid-build-command-line) via `fluid-build -t build`. - Note: Once you have run a build from the root, assuming no other changes outside of this package, you may run `npm run build` directly within this directory for a faster build. If you make changes to any of this package's local dependencies, you will need to run a build again from the root before building again from directly within this package. ### Testing This package uses [Mocha](https://mochajs.org/) and [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/) to power its unit tests. The corresponding test modules can be found under `src/test`. To run only the unit tests, first ensure you have followed the [build](#build) steps above. Next, run `npm run test:mocha` from a terminal within this directory. ### Accessibility Best Practices When developing components for this library, it's important to have accessibility in mind. Here are some guidelines and best practices to ensure your components are accessible to all users: 1. Keyboard Navigation: - Ensure all interactive elements are reachable via keyboard navigation. Use the `tabIndex` attribute to control the tab order of elements. For example, setting `tabIndex="0"` will include an element in the natural tab order, while `tabIndex="-1"` will remove it from the tab order but still allow it to receive focus programmatically. - Ensure that components such as dropdowns, buttons, and links can be operated using the keyboard. Implement keyboard event handling (`onKeyDown`, `onKeyPress`) for actions like opening a dropdown with the "Enter" key or navigating between items with the arrow keys. 2. ARIA Attributes: - Use [ARIA](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (Accessible Rich Internet Applications) attributes to provide additional information about UI components to screen readers. For example, use `aria-label`, `aria-labelledby`, or `aria-describedby` to provide accessible names or descriptions. - For components like dropdowns or modal dialogs, consider using roles such as `role="menu"` and `role="dialog"` to convey the purpose of the elements to assistive technologies. 3. Color Contrast: - Ensure that the color contrast ratio between text and background is sufficient. Aim for a contrast ratio of at least 4.5:1. You can use online tools to verify color contrast compliance with [WCAG](https://www.w3.org/WAI/standards-guidelines/act/rules/09o5cg/proposed/) (Web Content Accessibility Guidelines). The left navigation uses `aria-current="page"` to identify the selected item. Each activation updates a persistent, polite status region through `ScreenReaderAnnouncement`, without a focus change. The message confirms the selection, not the completion of data loading. Keep the status region mounted and clear its text before a repeated announcement. ## Contribution Guidelines You can [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid Framework in these ways: - Answer questions in [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions). - [Submit bug reports](https://github.com/microsoft/FluidFramework/issues) and help verify fixes. - Review [source code changes](https://github.com/microsoft/FluidFramework/pulls). - [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md). For detailed instructions, read the [repo documentation](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Home.md). This project follows the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, read the [Code of Conduct frequently asked questions](https://opensource.microsoft.com/codeofconduct/faq/). For questions or comments, contact . This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services. Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. ## Help Read the [Fluid Framework documentation](https://fluidframework.com/docs/) for information about Fluid Framework concepts and APIs. To request information that the documentation does not contain, [create an issue](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Contributing/Submitting-Bugs-and-Feature-Requests.md). ## Trademark This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services. Use of these trademarks or logos must follow Microsoft's [Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. [@fluid-internal/devtools-browser-extension]: https://github.com/microsoft/FluidFramework/tree/main/packages/tools/devtools/devtools-browser-extension