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

Feature/dashboard mvp #39

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Feature/dashboard mvp #39

wants to merge 6 commits into from

Conversation

benforshey
Copy link
Contributor

This branch is a bit experimental, so I'm putting it up for a PR just to get some feedback. This is a first attempt at making some kind of useful dashboard for mEditor. Would you check it out and let me know what concerns / comments you have?

Resolved comments were being incorrectly counted as active comments in the document header. Now the document header only counts unresolved comments.

Comments were infinitely nestable. Now only top-level comments can be replied to.

Resolving comments would only affect root and first-level comments, leaving deeply-nested comments unresolved. By allowing only one level of nesting, future comments will be correctly reresolved without affecting current comments.
@benforshey benforshey added the enhancement New feature or request label Oct 10, 2023
@benforshey benforshey self-assigned this Oct 10, 2023
@@ -56,6 +56,17 @@ class CommentsDb {
return makeSafeObjectIDs(comments)
}

async getCommentsForUser(uid: string) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to build most of the dashboard functionality without adding services, but comments needed this.

  • write tests to cover service addition

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Branched from fix/comments. See that PR for better context.

@@ -61,7 +61,7 @@ const SUPPORTED_ICONS = {
MdWarning,
}

const ModelIcon = ({ name = '', color = '#000' }) => {
const ModelIcon = ({ name = '', color = '#000', className = '' }) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opens up ModelIcon for external styling.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Branched from fix/comments. See that PR for better context.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • write service tests

)}
<Toast />
</Layout>
{canLoadPage ? (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our dashboard layout needed the escape from this <Layout>. In several pages you'll see <Layout> added. Without using the app folder, our version of Next.js doesn't support layout files per level of nesting, so we just add it in manually to the other pages.


@media (min-width: 64em) {
.main {
grid-template-areas:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template areas will probably need to go if we expand to more modules / cards on the dashboard page. For now, it's a pretty neat way to position the different cards.

className="dashboard-model"
{!modelCategories.length && <UnderMaintenance />}

<article className={`${styles.card} rounded shadow-sm`}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are three fairly similar <article> cards on this dashboard page now. I know that I'm bordering on needing to refactor this, but I often find that early abstractions need more refactoring later than if I would have just waited a bit to see a few different use cases. If it doesn't bother you all too much, I'd like to wait until we get a few different cards / modules on the dashboard before figuring out the right abstraction—right now they're all pretty similar in that they display a list of links.

@@ -296,3 +270,14 @@ fieldset.field-array fieldset.field-array {
.modal-sm {
max-width: 400px;
}

/* https://www.scottohara.me/blog/2017/04/14/inclusively-hidden.html */
.visually-hidden:not(:focus):not(:active) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're running the version of Bootstrap that doesn't yet include this. In our consideration of mEditor as enterprise software, do you all think we should look into the Horizon Design System and what CSS framework, if any, would help us match it?

name={userIconMap[model].name}
color={userIconMap[model].color}
/>
<span
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reasons beyond me, browsers don't play well with CSS-truncated text and screen readers. We ARIA hide the truncated text and visually hide the full text. This works well for me on VoiceOver on Ventura.

@benforshey
Copy link
Contributor Author

benforshey commented Oct 23, 2023

  • handle logged out user (both in the sense that we currently throw an error for logged-out and that we need do decide what content to show or action to take)

@benforshey benforshey marked this pull request as draft August 22, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant