The issue of citizenship and Hong Kong is a bit of a weird one. If you want a short answer to your question, the answer is that citizenship was handled indirectly.
The Sino-British Joint Declaration of 1984 hammered out the terms that Hong Kong would be returned to China in 1997. However, even with a deal on paper, the idea of what a handover would look like was still a bit of a mystery at the time. The PRC's approach was fairly straightforward in that ethnic Chinese residents of Hong Kong automatically became Chinese nationals when the handover occurred. The British approach, on the other hand, created several schemes designed to provide at the very least nationality status and create a system that avoided creating stateless persons when the handover took place.
These schemes enabled Hong Kong residents, namely Hong Kong's Indian minority, to register as British Dependent Territory Citizens which would transfer to become British Overseas Citizens when the handover occurred.
This became further complicated when news of the Tiananmen Square Massacre reached Hong Kong sparking a new wave of fears about post-handover Hong Kong. The British response was to create a scheme where 50,000 people and their families could be granted British citizenship. In addition to government schemes, many Hong Kong residents took the matter into their own hands and left Hong Kong, mostly to Canada, the UK, and the United States going into 1997 as anxiety over the handover reached its peak.
One of the issues when discussing Hong Kong is that it can quickly become a political conversation rather than a historic conversation. The issue of the handover is definitely a highly politicized and will be for the foreseeable future.