laurenhall1526-netizen commented on issue #64336: URL: https://github.com/apache/airflow/issues/64336#issuecomment-4161452886
Thanks for the PR, this looks great 👍 I like the toast idea too — it would definitely improve UX, especially for _self. That said, I agree it’s better to keep this PR focused on the target support and handle the toast as a follow-up. Happy to collaborate on that next once this is merged. On Mon, Mar 30, 2026, 11:27 PM Subham ***@***.***> wrote: > *Subham-KRLX* left a comment (apache/airflow#64336) > <https://github.com/apache/airflow/issues/64336#issuecomment-4159787943> > > @Subham-KRLX <https://github.com/Subham-KRLX> - Thanks so much for the > PR. Your changes look solid! > > While you are touching the ExtraLinks stack, I had a quick thought for a > UX enhancement. What if we allowed DAG authors to pass a structured Toaster > object (Dictionary or Dataclass) directly from their BaseOperatorLink? > > Could we flow a custom toast object from the Python backend to the > frontend onClick event. It would give users instant visual feedback when > they click a link (especially useful for target="_self"), allowing authors > to define custom titles, descriptions, and status colors. > > Here is the rough blueprint of how it could seamlessly fit into your > current branch: > > 1. *The Python Backend (airflow/models/baseoperator.py)* > We can define a simple TypedDict or Dataclass for the toast, and add > it to the base link: > > from typing import TypedDict > > class LinkToastInfo(TypedDict, total=False): > title: str > description: str > type: str # 'info', 'success', 'warning', 'error' > > class BaseOperatorLink: > name: str = "" > target: str = "_blank" > # New attribute for structured UI feedback > toast: LinkToastInfo | None = None > 2. *The FastAPI Schema > (airflow/api_fastapi/core_api/datamodels/task_instances.py)* > Pass the nested dictionary through the Pydantic model: > > class ExtraLinkToast(BaseModel): > title: str > description: str > type: str = "info" > > class ExtraLinkItem(BaseModel): > name: str > url: str | None > target: str = "_blank" > toast: ExtraLinkToast | None = None # Flow the object to the UI > 3. *The React Frontend (ExtraLinks.tsx)* > Hook into Chakra v3's centralized toaster object to pop the notification. > Because we passed a structured object, React can just destructure it > > import { toaster } from "src/components/ui"; > > // ... inside your button mapping ... > <Button > as="a" > href={link.url} > target={link.target || "_blank"} > onClick={() => { > // Pop the custom toast if the DAG author provided the dictionary! > if (link.toast) { > toaster.create({ > title: link.toast.title || "Action Triggered", > description: link.toast.description, > type: link.toast.type || "info", > }); > } > }} > > {link.name} > > Let me know what you think — happy to help contribute this piece if you'd > like to collaborate on it! > > That’s a fantastic idea for a UX enhancement Providing immediate visual > feedback via a structured toast object would definitely make the _self > target feel much more integrated into the Core UI. To keep the scope of > this PR focused on the core target attribute and ensure we get this > stabilized and merged quickly (especially now that the CI static checks are > passing) I would suggest we track the "Toast UI" enhancement for a separate > follow-up PR. I would be very happy to collaborate on that once this > foundational piece is in. > > — > Reply to this email directly, view it on GitHub > <https://github.com/apache/airflow/issues/64336?email_source=notifications&email_token=B7IHA4YXSD6BCEAHSKEWY734TNCJZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJVHE3TQNZZGQZ2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-4159787943>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/B7IHA42BV6DCHIIZ3JLHW2D4TNCJZAVCNFSM6AAAAACXCRVO2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCNJZG44DOOJUGM> > . > You are receiving this because you are subscribed to this thread.Message > ID: ***@***.***> > -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
