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

feat: Display empty detour table icon when the table is empty #2777

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

joshlarson
Copy link
Contributor

@joshlarson joshlarson commented Sep 9, 2024

@joshlarson joshlarson force-pushed the jdl/feat/format-detour-list-table-on-mobile branch from 76c6374 to b4ba629 Compare September 9, 2024 15:10
@joshlarson joshlarson force-pushed the jdl/feat/empty-detour-table-icon branch from c7cfa7e to 8d4e0b6 Compare September 9, 2024 15:48
@joshlarson joshlarson force-pushed the jdl/feat/format-detour-list-table-on-mobile branch from 6ed52d0 to 7fca2cf Compare September 9, 2024 15:49
@joshlarson joshlarson force-pushed the jdl/feat/empty-detour-table-icon branch from 8d4e0b6 to 4b1a60e Compare September 9, 2024 15:49
@joshlarson joshlarson force-pushed the jdl/feat/format-detour-list-table-on-mobile branch from 7fca2cf to 8efa5ed Compare September 9, 2024 15:52
@joshlarson joshlarson force-pushed the jdl/feat/empty-detour-table-icon branch from 4b1a60e to ccff018 Compare September 9, 2024 15:52
@joshlarson joshlarson marked this pull request as ready for review September 9, 2024 15:55
@joshlarson joshlarson requested a review from a team as a code owner September 9, 2024 15:55
@joshlarson joshlarson marked this pull request as draft September 9, 2024 15:58
@joshlarson joshlarson force-pushed the jdl/feat/format-detour-list-table-on-mobile branch from 8efa5ed to b30b0d0 Compare September 9, 2024 16:01
@joshlarson joshlarson force-pushed the jdl/feat/empty-detour-table-icon branch from 4c1be6c to 67b3662 Compare September 9, 2024 16:01
@joshlarson joshlarson marked this pull request as ready for review September 9, 2024 16:02
Base automatically changed from jdl/feat/format-detour-list-table-on-mobile to main September 9, 2024 16:06
@joshlarson joshlarson force-pushed the jdl/feat/empty-detour-table-icon branch from 67b3662 to 38a1833 Compare September 9, 2024 16:13
@joshlarson
Copy link
Contributor Author

I originally did this work as two separate chunks - creating the icon (and the storybook story), and then adding it to the table, but then combined the work into this one PR.

If you'd prefer that I split this back into two PR's (see the two commits on this branch), lemme know - I'm happy to do it.

Copy link

github-actions bot commented Sep 9, 2024

Coverage of commit f922304

Summary coverage rate:
  lines......: 93.0% (3299 of 3547 lines)
  functions..: 72.5% (1360 of 1876 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

Copy link

Coverage of commit 2c933e0

Summary coverage rate:
  lines......: 93.0% (3299 of 3547 lines)
  functions..: 72.5% (1360 of 1876 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

@@ -61,6 +61,12 @@ $table-border-radius: 0.5rem;
td:last-child {
border-bottom-right-radius: $table-border-radius;
}

@include media-breakpoint-down(md) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an unrelated visual bug fix, but I noticed it while working on this PR and didn't realize until just now that I had accidentally lumped it into this PR.

I can split it out to a separate PR if you'd all prefer, but I didn't necessarily think it was worth the effort.

@joshlarson joshlarson force-pushed the jdl/feat/empty-detour-table-icon branch from 2c933e0 to 26e6fb2 Compare September 10, 2024 18:51
Copy link

Coverage of commit 26e6fb2

Summary coverage rate:
  lines......: 93.0% (3318 of 3567 lines)
  functions..: 72.5% (1364 of 1882 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

)

export const EmptyDetourTableIcon = (props: ComponentProps<"svg">) => (
<svg
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I'd prefer this icon to be stored with the others at like static/images/icon-bus-circle.svg

Copy link
Member

Choose a reason for hiding this comment

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

There is previous conversion on why to prefer not doing it that way https://mbta.slack.com/archives/C047ZT8ACP5/p1725466195051749?thread_ts=1725464812.285259&cid=C047ZT8ACP5

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ohhh... I read this and then forgot about it once I saw the code out of context. Hmm, perhaps I should reply there? But how do we avoid distributing otherwise-reusable icons throughout the repo in a way that is hard to track?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another worthwhile question: should this icon (and other icons) be moved somewhere more consistent?

I figured it was likely that this icon would only ever be used on this page, so it wasn't necessary to create a separate home for it, but I don't feel strongly about that.

Copy link
Member

Choose a reason for hiding this comment

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

maybe a skateIcons.tsx similar to bsIcons.tsx? Then we can have consistent tests for them. IMO This would be for "simple" icons which contain only SVG and don't take other props.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That makes sense to me. Or perhaps a folder that contains a Reacty icon component per file? I prefer surfing icons by file name, but that's maybe too-personal a preference.

Also, turning my feedback to non-blocking, since this had already been discussed (and I forgot), and the requested change is mainly an organizational one at this point

Copy link
Member

Choose a reason for hiding this comment

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

I like the bsIcons route because it makes it easy to apply uniform tests to all the icons without needing to edit the tests. But I'm open to other options.

Comment on lines 24 to 57
<tbody>
<DetourRows data={data} status={status} />
</tbody>
</Table>
)
Copy link
Member

Choose a reason for hiding this comment

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

nit: I'd prefer if we didn't abstract this yet, and avoid any prop drilling that we'd need to do by having this intermediate component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which part do you not want to abstract? I can't quite tell, but I think Github might be rendering this weird.

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking that <DetourRows/> would be inlined here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

Coverage of commit d7f3495

Summary coverage rate:
  lines......: 93.0% (3318 of 3567 lines)
  functions..: 72.5% (1364 of 1882 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

@joshlarson joshlarson removed their assignment Sep 13, 2024
Copy link
Member

@firestack firestack left a comment

Choose a reason for hiding this comment

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

marking as changes requested for github overview screens

@joshlarson joshlarson force-pushed the jdl/feat/empty-detour-table-icon branch from b2fe361 to 5c17e94 Compare September 23, 2024 20:29
Copy link

Coverage of commit 5c17e94

Summary coverage rate:
  lines......: 92.5% (3310 of 3580 lines)
  functions..: 71.4% (1366 of 1912 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

@joshlarson joshlarson merged commit b1bcaf5 into main Sep 23, 2024
8 of 9 checks passed
@joshlarson joshlarson deleted the jdl/feat/empty-detour-table-icon branch September 23, 2024 20:53
Copy link

Coverage of commit 5c17e94

Summary coverage rate:
  lines......: 92.5% (3310 of 3580 lines)
  functions..: 71.4% (1366 of 1912 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants