Skip to content

Conversation

mdonahoo
Copy link

@mdonahoo mdonahoo commented Jul 8, 2025

Summary

This PR adds a new pause indicator that displays prominently on station screens when a flight is paused. This
improves the user experience by providing clear visual feedback to crew members when the simulation is not
actively running.

Changes

  • Added FlightPauseIndicator component that shows a large, centered pause warning
  • Created useFlightStatus hook for accessing flight state information
  • Integrated pause indicator into the station layout
  • Updated UI with semi-transparent black overlay and warning panel design

Implementation Details

New Components:

  • FlightPauseIndicator: Displays a centered warning panel with:
    • Semi-transparent black background overlay (75% opacity)
    • Large "FLIGHT PAUSED" text with warning icon
    • Instruction text for crew members
    • Responsive design that works across screen sizes
  • useFlightStatus hook: Provides convenient access to:
    • Flight active/paused state
    • Flight name and date
    • Flight director status
    • Raw flight data

Visual Design:

  • Uses existing warning panel styling from the design system
  • Fixed positioning with high z-index to overlay station cards
  • Non-interactive overlay prevents accidental inputs during pause
  • Clear, accessible messaging with proper ARIA attributes

Testing

  • Tested pause indicator appears when flight is paused
  • Verified indicator disappears when flight resumes
  • Confirmed overlay prevents interaction with underlying cards
  • Validated responsive behavior on different screen sizes
  • Checked accessibility with screen readers

Screenshots

image

image

Breaking Changes

None - This is a purely additive feature that doesn't affect existing functionality.

PS. Also added some ignore rules for my dev setup. Should be harmless.

Closes #553

* @since 1.0.0
*/
export function useFlightStatus() {
const [flight] = q.flight.active.useNetRequest();
Copy link
Member

Choose a reason for hiding this comment

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

All of this information is pretty much already accessible from the q.flight.active request. This hook is just an extra hoop to jump through. Let's keep it simple and remove this hook please.

FLIGHT PAUSED
</span>
<span className="text-lg text-center opacity-80 select-none">
Please wait for the flight director to resume the simulation
Copy link
Member

Choose a reason for hiding this comment

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

We can't count on a Flight Director being part of the mission. Let's just remove this copy. We don't need the extra text to explain what's going on.

aria-live="polite"
>
<div className="panel panel-warning px-12 py-8 flex flex-col items-center gap-6 shadow-2xl max-w-md mx-4">
<Icon name="ban" size="2xl" aria-hidden="true" className="text-warning" />
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to use an actual pause icon rather than the ban icon, which means something very different elsewhere in the UI. Something like this is good. https://lucide.dev/icons/octagon-pause

>
<div className="panel panel-warning px-12 py-8 flex flex-col items-center gap-6 shadow-2xl max-w-md mx-4">
<Icon name="ban" size="2xl" aria-hidden="true" className="text-warning" />
<span className="font-bold text-4xl select-none text-center">
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to have the text be lowercase and then use CSS to style it as uppercase using the uppercase Tailwind class. That renders better for some screen readers.

/binaries/

.wrangler
.wrangler
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer if we didn't add extra ignores here. You can ignore the files for just your repo by following this suggestion: https://stackoverflow.com/a/653458/4697675

* @since 1.0.0
*/
export function FlightPauseIndicator() {
const { isPaused } = useFlightStatus();
Copy link
Member

Choose a reason for hiding this comment

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

Replace this with a q.flight.active request and remove the extraneous hook.

import { Icon } from "@thorium/ui/Icon";
import { useFlightStatus } from "@thorium/hooks/useFlightStatus";

/**
Copy link
Member

Choose a reason for hiding this comment

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

This comment is unnecessarily verbose for a relatively small, self-explanatory component. Did an AI write this?

aria-live="polite"
>
<div className="panel panel-warning px-12 py-8 flex flex-col items-center gap-6 shadow-2xl max-w-md mx-4">
<Icon name="ban" size="2xl" aria-hidden="true" className="text-warning" />
Copy link
Member

Choose a reason for hiding this comment

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

It also seems like size="2xl" doesn't pass type checks properly for some reason.

@mdonahoo
Copy link
Author

mdonahoo commented Jul 9, 2025

Great feedback! I'm an old rusty dev and new to the game. I'll catch on soon.

@alexanderson1993
Copy link
Member

Closing due to lack of activity. If you want to address the feedback and get this over the finish line, we can reopen it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an indicator to the card to show that the flight is paused

2 participants